Skip to content
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

New version of the grammar #1

Open
PierreMarchand20 opened this issue Dec 6, 2019 · 1 comment
Open

New version of the grammar #1

PierreMarchand20 opened this issue Dec 6, 2019 · 1 comment

Comments

@PierreMarchand20
Copy link

FYI, I defined a new grammar for a vscode extension here. IMHO, it allows for a better differentiation of keywords. For example, with the current syntax defined in this repo (but in vscode):
Capture d’écran 2019-12-06 à 23 39 47
and with the grammar I defined:
Capture d’écran 2019-12-06 à 23 43 31
This is an example with my color theme, but I generally define more specifically keywords. So it is a lot of small improvements, for example:

  • punctuation is defined
  • operators are defined
  • type and functions are differentiated
  • parameters of functions like dim, coef... are only defined when used like it. Example, in the current grammar, they are picked up everywhere so

image

I took care of it, it is a regular variable outside of function arguments:

image

They are still some improvements to do, but I think the new grammar allows for a better differentiation of keywords, and it is easy to add new function/type name in scopes named builtin-foo and the regex should be ok.

@PierreMarchand20
Copy link
Author

PierreMarchand20 commented Dec 6, 2019

And since all the editors like VSCode, atom, Sublime etc. use TextMate grammars, may be it would be better to centralised the .tmLanguage file in a repo and let repositories defining extensions for these editors refer to this centralised repository. So that you do not have to maintain yourself extensions for all these editors but just the grammar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant