-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Open
Labels
parserRelated to parsingRelated to parsing
Description
Problem
Related grammar:
extras: ($) => [/[ \t]/, $.comment],
...
ctrl_error: ($) =>
seq(
"error",
"make",
optional($._flag), // <--- works fine without this line
field("error_record", $.val_record),
),
You can see that the "make" token starts early at [0, 5] instead of [0, 9].
If I remove the line of optional($._flag), it outputs correct region again.
The code of the _flag rule is here, I think it has nothing to do with whitespaces.
Steps to reproduce
git clone https://github.com/nushell/tree-sitter-nu
cd tree-sitter-nu
tree-sitter generateExpected behavior
The "make" token should start at [0, 9] as expected.
Tree-sitter version (tree-sitter --version)
tree-sitter 0.24.3
Operating system/version
macOS 15.1.1
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
parserRelated to parsingRelated to parsing