File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -521,12 +521,11 @@ module.exports = grammar({
521
521
// check that `_foo` is an invalid identifier. It seems simpler to parse `_foo` as a
522
522
// single identifier, and then let downstream consumers do further checks on the
523
523
// validity as needed (#71).
524
- // NOTE: Due to the linked tree-sitter bug, if `_identifier` and `_quoted_identifier`
525
- // are their own hidden rules, then we can't detect implied `identifier`s as missing
526
- // with `ts_node_is_missing()`, essentially making that function useless since
527
- // tree-sitter seems to fill in named missing nodes with `identifier` most of the
528
- // time. The workaround used here inlines the regexes, and wraps the `choice()` call
529
- // in a single terminal `token()` so `identifier` can still be used as the `word` rule.
524
+ // NOTE: Due to the linked tree-sitter discussion, if `_identifier` and
525
+ // `_quoted_identifier` are their own hidden rules, then we can't detect error
526
+ // recovered `identifier`s as missing with `ts_node_is_missing()`. The workaround used
527
+ // here inlines the regexes, and wraps the `choice()` call in a single terminal
528
+ // `token()` so `identifier` can still be used as the `word` rule.
530
529
// https://github.com/tree-sitter/tree-sitter/issues/3332
531
530
identifier : $ => {
532
531
const _identifier = / [ \p{ XID_Start} . _ ] [ \p{ XID_Continue} . ] * / ;
You can’t perform that action at this time.
0 commit comments