Skip to content

let a /* >_< */ = 1 #290

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

Closed
vird opened this issue Feb 1, 2024 · 1 comment · Fixed by #291
Closed

let a /* >_< */ = 1 #290

vird opened this issue Feb 1, 2024 · 1 comment · Fixed by #291
Labels

Comments

@vird
Copy link

vird commented Feb 1, 2024

The following piece of code is valid but it is parsed incorrectly:

let a /* >_< */ = 1

Here's a link to the TypeScript Playground showing that the snippet above is valid JavaScript or TypeScript:

https://www.typescriptlang.org/play?#code/DYUwLgBAhhD0BUEB8B9APBesIF4IEYg

The output of tree-sitter parse is the following:

> [email protected] parse
> tree-sitter parse 6.js

(program [0, 0] - [1, 0]
  (expression_statement [0, 0] - [0, 19]
    (assignment_expression [0, 0] - [0, 19]
      left: (identifier [0, 0] - [0, 3])
      (ERROR [0, 4] - [0, 5]
        (variable_declarator [0, 4] - [0, 5]
          name: (identifier [0, 4] - [0, 5])))
      (comment [0, 6] - [0, 15])
      right: (number [0, 18] - [0, 19]))))
6.js    0 ms    (ERROR [0, 4] - [0, 5])
@vird vird added the bug label Feb 1, 2024
@amaanq
Copy link
Member

amaanq commented Feb 1, 2024

thanks! sorry for the regression, I'll be adding support for the import attributes soon and fixing the tsx infinite loop bug (which partially needs a change here), so I'll put out a release with this fix then (few hrs?)

@amaanq amaanq mentioned this issue Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants