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:
[x] All tests pass in CI.
[x] There are sufficient tests for the new fix/feature.
[x] Grammar rules have not been renamed unless absolutely necessary.
[x] The conflicts section hasn't grown too much.
[x] The parser size hasn't grown too much (check the value of STATE_COUNT in src/parser.c).
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: