Skip to content

Commit 6d0733f

Browse files
committed
Tweak NOTE. Closes #135.
1 parent bf44417 commit 6d0733f

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

grammar.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -521,12 +521,11 @@ module.exports = grammar({
521521
// check that `_foo` is an invalid identifier. It seems simpler to parse `_foo` as a
522522
// single identifier, and then let downstream consumers do further checks on the
523523
// 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.
530529
// https://github.com/tree-sitter/tree-sitter/issues/3332
531530
identifier: $ => {
532531
const _identifier = /[\p{XID_Start}._][\p{XID_Continue}.]*/;

0 commit comments

Comments
 (0)