You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A more special case is let: var let = 2 is valid, but let let = 2 or const let = 2 is not.
Also let in is a syntax error because it's an incomplete binary_expression unlike const in or let in which are errors because in 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:
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.
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: