Commit ee67de3
committed
Fix CRLF RawValue consistency in line continuation and stop-parsing state
Three fixes found during edge-case review:
- Line continuation RawValue: for CRLF (backtick + \r\n), the previous
code added \r and \n to RawValue then only removed two runes, leaving
the backtick in RawValue. Now the peeked newline runes are consumed
from the stream without being added to RawValue, so only one
removeLastRaw (for the escape char) is needed. This makes LF and CRLF
produce identical RawValue (no backtick or newline residue).
- Stop-parsing token State: the Next() handler was overriding
token.State with t.state (START_STATE) after scanStopParsing had
already correctly set it to IN_WORD_STATE. Removed the override so
the state set by scanStopParsing is preserved.
- Added CRLF RawValue consistency regression test.
Assisted-by: Crush:glm-5.21 parent 1c42226 commit ee67de3
2 files changed
Lines changed: 21 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | | - | |
133 | | - | |
134 | | - | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
135 | 139 | | |
136 | 140 | | |
137 | 141 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
489 | 489 | | |
490 | 490 | | |
491 | 491 | | |
492 | | - | |
| 492 | + | |
493 | 493 | | |
494 | | - | |
495 | 494 | | |
496 | 495 | | |
497 | | - | |
| 496 | + | |
498 | 497 | | |
499 | 498 | | |
500 | 499 | | |
501 | 500 | | |
502 | | - | |
503 | | - | |
| 501 | + | |
504 | 502 | | |
| 503 | + | |
505 | 504 | | |
506 | 505 | | |
507 | 506 | | |
| |||
643 | 642 | | |
644 | 643 | | |
645 | 644 | | |
646 | | - | |
| 645 | + | |
647 | 646 | | |
648 | 647 | | |
649 | 648 | | |
650 | | - | |
| 649 | + | |
651 | 650 | | |
652 | 651 | | |
653 | 652 | | |
654 | 653 | | |
655 | | - | |
656 | | - | |
657 | | - | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
658 | 657 | | |
659 | 658 | | |
660 | 659 | | |
| |||
675 | 674 | | |
676 | 675 | | |
677 | 676 | | |
678 | | - | |
| 677 | + | |
679 | 678 | | |
680 | 679 | | |
681 | 680 | | |
682 | | - | |
| 681 | + | |
683 | 682 | | |
684 | 683 | | |
685 | 684 | | |
686 | 685 | | |
687 | | - | |
688 | | - | |
| 686 | + | |
| 687 | + | |
689 | 688 | | |
690 | 689 | | |
691 | 690 | | |
| |||
1023 | 1022 | | |
1024 | 1023 | | |
1025 | 1024 | | |
1026 | | - | |
| 1025 | + | |
1027 | 1026 | | |
1028 | 1027 | | |
1029 | 1028 | | |
| |||
0 commit comments