-
Notifications
You must be signed in to change notification settings - Fork 109
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
Invalid variable names are not marked as errors #204
Labels
Comments
I believe it will be possible to fix this issue only once tree-sitter/tree-sitter#246 is merged. Right now there is no way to say "an identifier but not a keyword" in the grammar. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The following piece of code is invalid but it is parsed correctly:
Here's a link to the TypeScript Playground showing that the snippet above is invalid JavaScript or TypeScript
The output of
tree-sitter
playground is the following:Each of these lines should be a syntax error.
A more special case is
let
:var let = 2
is valid, butlet let = 2
orconst let = 2
is not.Also
let in
is a syntax error because it's an incompletebinary_expression
unlikeconst in
orlet in
which are errors becausein
is an invalid identifier.The other identifiers I've listed are invalid in
var
/let
/const
.The text was updated successfully, but these errors were encountered: