Closed
Description
Hi!
The following piece of code is invalid but it is parsed correctly:
module x
let a = 0
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:
(program [0, 0] - [3, 0]
(module [0, 0] - [0, 8]
name: (identifier [0, 7] - [0, 8]))
(lexical_declaration [2, 0] - [2, 9]
(variable_declarator [2, 4] - [2, 9]
name: (identifier [2, 4] - [2, 5])
value: (number [2, 8] - [2, 9]))))
I think body should not be optional here:
The issue template asks for a link to official documentation but I am not sure where to start looking