Grammar: Start implementing expression grammar and use it for template literals#930
Grammar: Start implementing expression grammar and use it for template literals#930DZakh wants to merge 2 commits intorescript-lang:masterfrom
Conversation
| { "include": "#constant" }, | ||
| { "include": "#bracketAccess" }, | ||
| { "include": "#string" }, | ||
| { "include": "#number" }, | ||
| { "include": "#character" } |
There was a problem hiding this comment.
There should be much more than these 5.
There was a problem hiding this comment.
And bracketAccess should be replaced with an array constructor.
| { "include": "#operator" }, | ||
| { "include": "#punctuations" }, |
There was a problem hiding this comment.
Instead of highlighting operators and punctuations separately, they should be part of expression
| { "include": "#template-substitution-element" } | ||
| ] | ||
| }, | ||
| "template-substitution-element": { |
There was a problem hiding this comment.
Structured it more similar to ts grammar
|
@DZakh it's great that you're having a look at the highlighting! I don't know too much about the highlighting, but I'm happy to merge the PRs outstanding now + more if needed, just that we'll need to help each other out testing. Actually, I'll do a quick stable release of the features unreleased now, and we can merge these + experiment a little bit more calmly. |
|
Could you rebase this please? |
|
I've figured out how it works, so I'll modify the PR to solve the problem in a more complete way. And the #932 is ready to be merged. How it works:
|
|
@DZakh fantastic! And great write up. |
|
Can this be done via semantic highlighting? |
|
I don't know much about the semantic highlighting. I'll investigate. |
Highlight
int,float,bool, andcharembeded in template literals.Also highlight comments.
Before:
After:
It's not finished, and there are quite a lot of things that need to be done to make highlighting perfect. But it's already a good improvement, so it can be reviewed and merged.