Syntax highlighter should allow $ in identifiers.
See original GitHub issueIt appears that the syntax highlighter isn’t expecting $
to occur within identifiers, so for instance, $return
will have keyword highlighting applied (while, say, this$
and $1$2$
use highlighting for distinguished variables and numeric literals, respectively).
Stopping this extra highlighting is easy enough by qualifying \b
s with negative lookaround for \$
, similar to VSCode’s JavaScript grammar.
The harder part is ensuring that $
doesn’t stop desired highlighting from occurring. The problem is the grammar here seems to be 10x shorter than a lot of other languages—all we really have are some naive definitions for class / function / constant identifiers, so I’m at a loss for the “right” thing to do.
I can submit a PR with my suggestion: to remove the constant definition (which is actually bogus 😛) and loosen the other two (which should get us pretty close to correct, anyway).
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (5 by maintainers)
Top GitHub Comments
Fixed in 017d17d279abc3e9d439e96b82d8aaab6ee96a7c.
I wondered why you’d be naming variables like this; but makes sense now!
Strange that the lowercase/uppercase a/z are different too!
I will test and merge when I get some free time at PC at home. Ta!