tree-sitter / tree-sitter-typescript

TypeScript grammar for tree-sitter
MIT License
341 stars 104 forks source link

Update to latest tree-sitter-javascript #192

Closed ruricolist closed 2 years ago

ruricolist commented 2 years ago

This updates the tree-sitter-javascript dependency to the latest version, fdeb68a. All the tests pass, and the success rate of parsing on example files has improved from 99.6% to 99.9%.

Translating the C changes from the JavaScript external scanner was straightforward, except that it was necessary to introduce a number of special cases to prevent the ? of optional arguments from being parsed as a ternary ?.

There were also a number of new conflicts. One of them was rather strange and requires a strange rule (a single-element list of conflicts, [$.class]) to resolve: ambiguity in a class expression inside parentheses, where the parser couldn’t decide where the decorators end and the class begins.

Checklist:

mjambon commented 2 years ago

great work, thank you!