Commit 8b70dde
committed
Fix trailing comment lexing issues
The comment collection/preservation code in
`commentMetadataForCurrentToken` was incorrectly creating some comment
tokens for trailing comments in these two cases:
- `"# should not be a comment"`
- `%%# should not be a comment`
This was because the trailing comment lexing lookahead was being done
on STRING_OPEN_QUOTE and EMBED_OPEN_DELIM, even though it makes no sense
to embed comments in these constructs. Now fixed and tested.1 parent 9eed596 commit 8b70dde
File tree
2 files changed
+60
-17
lines changed- src
- commonMain/kotlin/org/kson/parser
- commonTest/kotlin/org/kson/parser
2 files changed
+60
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
629 | 629 | | |
630 | 630 | | |
631 | 631 | | |
632 | | - | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
633 | 637 | | |
634 | | - | |
635 | | - | |
636 | | - | |
637 | | - | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
638 | 660 | | |
639 | | - | |
640 | | - | |
641 | | - | |
642 | | - | |
643 | | - | |
644 | | - | |
645 | | - | |
646 | | - | |
647 | | - | |
648 | | - | |
649 | 661 | | |
650 | | - | |
651 | | - | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
652 | 665 | | |
653 | 666 | | |
654 | 667 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
842 | 842 | | |
843 | 843 | | |
844 | 844 | | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
845 | 875 | | |
0 commit comments