-
Notifications
You must be signed in to change notification settings - Fork 109
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
Parse the condition of a for loop into a dedicated node #315
Comments
Essentially what I'm looking for is a tree like this:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When parsing a
for
, the condition is parsed such that thefor
keyword and the parentheses are included directly into the parentfor_in_statement
node. For example, this input:Produces a tree like so (the output here is from NeoVim's
:InspectTree
command):For consumers of the tree that wish to implement bracket matching, this requires special handling as there's nothing in the tree that clearly indicates the
(
and)
are paired together (see also yorickpeterse/nvim-tree-pairs#1). Various languages that I've tried (e.g. Rust, Lua, Python, etc) include the(
and)
(or any other bracket for that matter) into a dedicated node, making it easy to find out the start/end of the rang.Would it be possible to also apply this to this JavaScript parser, thereby making bracket matching easier?
The text was updated successfully, but these errors were encountered: