Skip to content
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

bug: shebang does not require semicolon #226

Open
2 tasks done
matthiaskrgr opened this issue Jun 2, 2024 · 0 comments
Open
2 tasks done

bug: shebang does not require semicolon #226

matthiaskrgr opened this issue Jun 2, 2024 · 0 comments
Labels

Comments

@matthiaskrgr
Copy link

matthiaskrgr commented Jun 2, 2024

Did you check existing issues?

  • I have read all the tree-sitter docs if it relates to using the parser
  • 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() {}
@matthiaskrgr matthiaskrgr changed the title bug: bug: shebang does not require semicolon Jun 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant