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
Like for #209, I don't think we have a high priority placed on failing on incorrect constructs.
I recently proposed that we even merge the javascript and typescript parsers into one so as to facilitate maintenance. This would create a lot of such cases since we'd parse javascript with a typescript/tsx parser. See #191 and maybe let us know if that would be good or bad for your application.
The issue template asks for a link to official documentation but I am not sure where to start looking
Sadly, the typescript team hasn't updated the spec since 2016.
I think it's optional for the sake of .d.ts files, it just isn't documented.
Currently having an optional node there makes the parser more resilient to errors while not compromising on parsing correctness, so I'd prefer to have it as it is over "fixing" it.
Hi!
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:
https://www.typescriptlang.org/play?#code/LYewJgrgNgpgBADwFBNgFzgQzgXjgBiA
The output of
tree-sitter parse
is the following:I think body should not be optional here:
tree-sitter-typescript/common/define-grammar.js
Line 482 in 111b077
The issue template asks for a link to official documentation but I am not sure where to start looking
The text was updated successfully, but these errors were encountered: