tree-sitter-rust
tree-sitter-rust copied to clipboard
bug: shebang does not require semicolon
trafficstars
Did you check existing issues?
- [X] I have read all the tree-sitter docs if it relates to using the parser
- [X] I have searched the existing issues of tree-sitter-rust
Tree-Sitter CLI Version, if relevant (output of tree-sitter --version)
No response
Describe the bug
FP parse error
Steps To Reproduce/Bad Parse Tree
(source_file (shebang) (expression_statement (binary_expression left: (identifier) right: (call_expression function: (identifier) (ERROR (identifier) (identifier)) arguments: (arguments))) (MISSING ";")) (expression_statement (block)))
[source_file](https://tree-sitter.github.io/tree-sitter/playground#) [0, 0] - [4, 0]
[shebang](https://tree-sitter.github.io/tree-sitter/playground#) [0, 0] - [2, 3]
[expression_statement](https://tree-sitter.github.io/tree-sitter/playground#) [2, 4] - [3, 9]
[binary_expression](https://tree-sitter.github.io/tree-sitter/playground#) [2, 4] - [3, 9]
left: [identifier](https://tree-sitter.github.io/tree-sitter/playground#) [2, 4] - [2, 9]
right: [call_expression](https://tree-sitter.github.io/tree-sitter/playground#) [2, 10] - [3, 9]
function: [identifier](https://tree-sitter.github.io/tree-sitter/playground#) [2, 10] - [2, 14]
[ERROR](https://tree-sitter.github.io/tree-sitter/playground#) [3, 0] - [3, 7]
[identifier](https://tree-sitter.github.io/tree-sitter/playground#) [3, 0] - [3, 2]
[identifier](https://tree-sitter.github.io/tree-sitter/playground#) [3, 3] - [3, 7]
arguments: [arguments](https://tree-sitter.github.io/tree-sitter/playground#) [3, 7] - [3, 9]
[MISSING ;](https://tree-sitter.github.io/tree-sitter/playground#) [3, 9] - [3, 9]
[expression_statement](https://tree-sitter.github.io/tree-sitter/playground#) [3, 10] - [3, 12]
[block](https://tree-sitter.github.io/tree-sitter/playground#) [3, 10] - [3, 12]
Expected Behavior/Parse Tree
there does not need to be a ";" as rustc accepts the code
Repro
#!
//@ check-pass
fn main() {}