{"action":"created","issue":{"url":"https://api.github.com/repos/ViktorQvarfordt/Sublime-WolframLanguage/issues/22","repository_url":"https://api.github.com/repos/ViktorQvarfordt/Sublime-WolframLanguage","labels_url":"https://api.github.com/repos/ViktorQvarfordt/Sublime-WolframLanguage/issues/22/labels{/name}","comments_url":"https://api.github.com/repos/ViktorQvarfordt/Sublime-WolframLanguage/issues/22/comments","events_url":"https://api.github.com/repos/ViktorQvarfordt/Sublime-WolframLanguage/issues/22/events","html_url":"https://github.com/ViktorQvarfordt/Sublime-WolframLanguage/pull/22","id":377129263,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI4MTYyMjY3","number":22,"title":"Add support for boxes and templates","user":{"login":"Shigma","id":33423008,"node_id":"MDQ6VXNlcjMzNDIzMDA4","avatar_url":"https://avatars3.githubusercontent.com/u/33423008?v=4","gravatar_id":"","url":"https://api.github.com/users/Shigma","html_url":"https://github.com/Shigma","followers_url":"https://api.github.com/users/Shigma/followers","following_url":"https://api.github.com/users/Shigma/following{/other_user}","gists_url":"https://api.github.com/users/Shigma/gists{/gist_id}","starred_url":"https://api.github.com/users/Shigma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shigma/subscriptions","organizations_url":"https://api.github.com/users/Shigma/orgs","repos_url":"https://api.github.com/users/Shigma/repos","events_url":"https://api.github.com/users/Shigma/events{/privacy}","received_events_url":"https://api.github.com/users/Shigma/received_events","type":"User","site_admin":false},"labels":[{"id":1112592410,"node_id":"MDU6TGFiZWwxMTEyNTkyNDEw","url":"https://api.github.com/repos/ViktorQvarfordt/Sublime-WolframLanguage/labels/feature","name":"feature","color":"a9bee8","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":13,"created_at":"2018-11-04T07:33:45Z","updated_at":"2018-11-09T20:36:22Z","closed_at":null,"author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/ViktorQvarfordt/Sublime-WolframLanguage/pulls/22","html_url":"https://github.com/ViktorQvarfordt/Sublime-WolframLanguage/pull/22","diff_url":"https://github.com/ViktorQvarfordt/Sublime-WolframLanguage/pull/22.diff","patch_url":"https://github.com/ViktorQvarfordt/Sublime-WolframLanguage/pull/22.patch"},"body":"#### Support built-in characters and character encoding in strings.\r\n```mathematica\r\n  \"\\[alpha]\"\r\n(* ^^^^^^^^ constant.character.built-in.wolfram *)\r\n\r\n  \"\\:123456\"\r\n(* ^^^^^^ constant.character.encoding.wolfram *)\r\n```\r\n---\r\n#### Not treat `\\` as escape anymore, but special characters like `\\n` will be recognized as escapes as usual.\r\n```mathematica\r\n  \"This is\\n\\a string. (* not a comment *)\"\r\n(*^ punctualation.defination.string.begin *)\r\n(*        ^^ constant.character.escape *)\r\n(*          ^^ string.quoted *)\r\n```\r\n---\r\n#### Support [string templates](https://reference.wolfram.com/language/ref/StringTemplate.html).\r\n```mathematica\r\n  StringTemplate[\"Value `a`: <* Range[#n] *>.\"][<|\"a\" -> 1234, \"n\" -> 3|>]\r\n(*                      ^^^ variable.parameter *)\r\n(*                           ^^ keyword.operator.template-expression *)\r\n```\r\n---\r\n#### Support [string representation of boxes](https://reference.wolfram.com/language/tutorial/StringRepresentationOfBoxes.html).\r\n```mathematica\r\n  \"box 1: \\!\\(x\\^2\\); box 2: \\(y\\^3\\) \"\r\n(*        ^ keyword.operator.string-box *)\r\n(*             ^^ keyword.operator.x-scriptBox *)\r\n(*                           ^^^^^^^^ string.quoted *)\r\n\r\n  \\( \\)\r\n(*^^ punctuation.section.box.begin.wolfram *)\r\n(*^^^^^ meta.box.wolfram *)\r\n(*   ^^ punctuation.section.box.end.wolfram *)\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/ViktorQvarfordt/Sublime-WolframLanguage/issues/comments/437487634","html_url":"https://github.com/ViktorQvarfordt/Sublime-WolframLanguage/pull/22#issuecomment-437487634","issue_url":"https://api.github.com/repos/ViktorQvarfordt/Sublime-WolframLanguage/issues/22","id":437487634,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNzQ4NzYzNA==","user":{"login":"chere005","id":28164815,"node_id":"MDQ6VXNlcjI4MTY0ODE1","avatar_url":"https://avatars2.githubusercontent.com/u/28164815?v=4","gravatar_id":"","url":"https://api.github.com/users/chere005","html_url":"https://github.com/chere005","followers_url":"https://api.github.com/users/chere005/followers","following_url":"https://api.github.com/users/chere005/following{/other_user}","gists_url":"https://api.github.com/users/chere005/gists{/gist_id}","starred_url":"https://api.github.com/users/chere005/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chere005/subscriptions","organizations_url":"https://api.github.com/users/chere005/orgs","repos_url":"https://api.github.com/users/chere005/repos","events_url":"https://api.github.com/users/chere005/events{/privacy}","received_events_url":"https://api.github.com/users/chere005/received_events","type":"User","site_admin":false},"created_at":"2018-11-09T20:36:22Z","updated_at":"2018-11-09T20:36:22Z","author_association":"COLLABORATOR","body":"> > I'm not sure, this is a much bigger issue than not supporting StringTemplate. I discussed this with @batracos at one point back in May actually and we couldn't find a good solution.. The closest thing I came up with was something along these lines for L140:\r\n> > ```\r\n> > (?<=[^a-zA-Z0-9$]|[\\\"\\`])\\`\\w*\\`|\\`\\w*\\`(?=[^a-zA-Z0-9$\"])\r\n> > ```\r\n> > It seems to work but @batracos didn't like it. @Shigma and @batracos can we improve this, use it, or come up with something better? If not, we should hold off on StringExpression backtick support\r\n> \r\n> I'm not sure I get your point by `` (?<=[^a-zA-Z0-9$]|[\\\"\\`]) `` but the thing is slots in a StringTemplate can be placed just between letters:\r\n> \r\n> ```mathematica\r\n> In[11]:= StringTemplate[\"FOO`BAR`BAZ`\"][<|\"BAR\" -> \"-\"|>]\r\n> Out[11]= \"FOO-BAZ`\"\r\n> ```\r\n> \r\n> The syntax for python didn't work out a solution for string templates, either:\r\n> \r\n> ```python\r\n> str = 'I just want a {plain} brace'\r\n>                    # ^^^^^^^ constant.other.placeholder.python\r\n> ```\r\n> \r\n> We don't show an attempt to `format` it and it appears as if we do.\r\n> \r\n> If you really want to distinguish those behaviour, maybe we can just match the function outside the string, for example, treat strings inside a `Begin` function as \"plain\" to some extent. I think provide different functions with different inner context is a good solution to all the problems like this, and functions like `Block` has applied this solution before.\r\n> \r\n> I'm interested in it but suggest not to do such things in this PR but open a new one instead because this PR has already does too many things.\r\n\r\nContexts show up in many other strings. We **absolutely cannot break this** for StringTemplated strings. All strings with backticks are valid containing backticks. Only in the case for StringTemplate are the backticks special. What this means is assume and default to the backtick being a normal backtick in a string. I was suggesting a hacky solution so that sometimes StringTemplate would be right but that contexts would always be right, but I'm less convinced by this. I 100% think we should not support StringTemplate backtick syntax, please remove it from this PR unless there is a much, much better solution."}}
{"actor":{"display_login":"chere005"}}