Commit fd837e1
Fix multiple consecutive block comments in switch expressions
When two or more block comments appeared after a switch_match body, the
scanner emitted a NEWLINE between each pair (/* is not a continuation
character). These extra NEWLINEs had nowhere to fit in the grammar,
causing tree-sitter error recovery to produce a MISSING node.
Fix by introducing _switch_body (same as _one_or_more_statements but
without the trailing optional delimiter) and moving delimiter consumption
into switch_expression and try_expression via
repeat(seq(switch_match, repeat(_statement_delimeter))). Trailing
NEWLINEs — including those between consecutive block comments — are now
absorbed at the switch/try level instead of being orphaned.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 33be075 commit fd837e1
4 files changed
Lines changed: 134650 additions & 134434 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| 103 | + | |
103 | 104 | | |
104 | 105 | | |
105 | 106 | | |
| |||
134 | 135 | | |
135 | 136 | | |
136 | 137 | | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
137 | 145 | | |
138 | 146 | | |
139 | 147 | | |
| |||
589 | 597 | | |
590 | 598 | | |
591 | 599 | | |
592 | | - | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
593 | 607 | | |
594 | 608 | | |
595 | 609 | | |
| |||
601 | 615 | | |
602 | 616 | | |
603 | 617 | | |
604 | | - | |
| 618 | + | |
605 | 619 | | |
606 | 620 | | |
607 | 621 | | |
| |||
616 | 630 | | |
617 | 631 | | |
618 | 632 | | |
619 | | - | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
620 | 641 | | |
621 | 642 | | |
622 | 643 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments