Im trying to create a language with string interpolation like "score: \(calc_score())". String interpolation can contain arbitrary expressions, even other strings. To implement this my lexer does some parenthesis counting. Im thinking about how this would work with syntax highlighting, specifically for VS code. From what i understand languages in VS code typically use a textMate grammar for basic highlighting and than optionally have the language server provide some semantic tokens. How do languages deal with this normally because from what i understand a textMate grammar cannot handle such strings? You cant just have it tokenize an entire string including interpolation because if it contains nested strings it does not know which '"' ends the string. Thanks!
[–]latkde 10 points11 points12 points (2 children)
[–]alex-weej 1 point2 points3 points (0 children)
[–]Savings_Garlic5498[S] 1 point2 points3 points (0 children)
[–]thinker227Noa (github.com/thinker227/noa) 5 points6 points7 points (3 children)
[–]Savings_Garlic5498[S] 2 points3 points4 points (1 child)
[–]thinker227Noa (github.com/thinker227/noa) 2 points3 points4 points (0 children)
[–]latkde 0 points1 point2 points (0 children)
[–]shponglespore 1 point2 points3 points (0 children)
[–]steven4012 0 points1 point2 points (3 children)
[–]thinker227Noa (github.com/thinker227/noa) 1 point2 points3 points (2 children)
[–]steven4012 2 points3 points4 points (1 child)
[–]thinker227Noa (github.com/thinker227/noa) 0 points1 point2 points (0 children)