Closed raczosala closed 11 months ago
The following piece of code is valid but it is parsed incorrectly:
bar?.();
Here's a link to the TypeScript Playground showing that the snippet above is valid JavaScript or TypeScript:
https://www.typescriptlang.org/play?#code/EYQwTg-AdAFAlAbiA
The output of tree-sitter parse is the following:
tree-sitter parse
(program [0, 0] - [1, 0] (expression_statement [0, 0] - [0, 8] (call_expression [0, 0] - [0, 7] function: (identifier [0, 0] - [0, 3]) arguments: (arguments [0, 5] - [0, 7]))))
The optional_chain node should be part into the AST, or, at the very least, it should be identifiable through unnamed nodes.
optional_chain
my bad you can capture it with ?.
?.
The following piece of code is valid but it is parsed incorrectly:
Here's a link to the TypeScript Playground showing that the snippet above is valid JavaScript or TypeScript:
https://www.typescriptlang.org/play?#code/EYQwTg-AdAFAlAbiA
The output of
tree-sitter parse
is the following:The
optional_chain
node should be part into the AST, or, at the very least, it should be identifiable through unnamed nodes.