-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Grammar: Start implementing expression grammar and use it for template literals #930
base: master
Are you sure you want to change the base?
Conversation
{ "include": "#constant" }, | ||
{ "include": "#bracketAccess" }, | ||
{ "include": "#string" }, | ||
{ "include": "#number" }, | ||
{ "include": "#character" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be much more than these 5.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And bracketAccess
should be replaced with an array
constructor.
{ "include": "#operator" }, | ||
{ "include": "#punctuations" }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
, andchar
embeded 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.