You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When parsing a for, the condition is parsed such that the for keyword and the parentheses are included directly into the parent for_in_statement node. For example, this input:
for (x of y) {
foo();
}
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:
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: