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: boolean negation are parsed as error union type #7

Open
1 of 2 tasks
polazarus opened this issue Jan 6, 2025 · 0 comments
Open
1 of 2 tasks

bug: boolean negation are parsed as error union type #7

polazarus opened this issue Jan 6, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@polazarus
Copy link

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

Tree-Sitter CLI Version, if relevant (output of tree-sitter --version)

No response

Describe the bug

All boolean negation seems to be parsed as error_union_type rather than as unary_expression.

Steps To Reproduce/Bad Parse Tree

  1. Parse the following program:

    const b = !true;
  2. Observe the tree:

    source_file [0, 0] - [1, 0]
      variable_declaration [0, 0] - [0, 17]
        kind: variable_declaration_kind [0, 0] - [0, 5]
        name: identifier [0, 6] - [0, 7]
        value: error_union_type [0, 10] - [0, 16]
          ok: error_union_type [0, 11] - [0, 16]
            ok: identifier [0, 12] - [0, 16]
    

Expected Behavior/Parse Tree

source_file [0, 0] - [1, 0]
  variable_declaration [0, 0] - [0, 16]
    kind: variable_declaration_kind [0, 0] - [0, 5]
    name: identifier [0, 6] - [0, 7]
    value: unary_expression [0, 10] - [0, 15]
      argument: identifier [0, 11] - [0, 15]

Repro

No response

@polazarus polazarus added the bug Something isn't working label Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant