Closed AlexCid closed 7 months ago
tree-sitter --version
No response
The Rust parser emits an error token for the following code:
match foo { 1.. => {} };
Right half-open inclusive ranges (such as ..=1) are also concerned.
The code above is parsed to the following s-expression:
(source_file (expression_statement (match_expression value: (identifier) body: (match_block (match_arm pattern: (match_pattern (remaining_field_pattern)) (ERROR (integer_literal)) value: (block))))) (empty_statement))
The expected s-expression would be rather
(source_file (expression_statement (match_expression value: (identifier) body: (match_block (match_arm pattern: (match_pattern (range_expression (integer_literal))) ) value: (block))))) (empty_statement))
or something similar
Thanks, fixed on master
Did you check existing issues?
Tree-Sitter CLI Version, if relevant (output of
tree-sitter --version
)No response
Describe the bug
The Rust parser emits an error token for the following code:
Right half-open inclusive ranges (such as ..=1) are also concerned.
Steps To Reproduce/Bad Parse Tree
The code above is parsed to the following s-expression:
Expected Behavior/Parse Tree
The expected s-expression would be rather
or something similar
Repro