-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Parser for Vim9 Script #6372
Comments
I have considered making a tree representation before producing code. I estimate that it will add quite a bit of overhead and does not have much gain. Creating the tree nodes and later cleaning them up, instead of mostly using stack space, can easily consume a lot of time. The possible gain of producing more efficient code is likely small, unless a full optimizer is used, which is again quite time consuming. |
Could tree be created as by-product instead? i.e. as an option |
What I mean is: let compiler create AST while parsing, but not use it in any way |
Can a real grammar be written for vim9? In other words, is the vim9 language 'nicely specified' with low context-sensitivity? |
Most likely not. |
Describe the solution you'd like
If vim source included parser for Vim9 Script (i.e. function that converts source to ast), it would be very useful for implementing highlighting and language servers for Vim9 Script. Currently if one wants to do so he/she needs to create Vim9 parser from scratch... and keep it up do date with changes in it
As far as I can tell from current source vim doesn't generate AST, and compiles code directly instead, yes? Could this be potentially changed to produce AST, maybe as byproduct?
The text was updated successfully, but these errors were encountered: