Commit 960cb12
committed
chore: simplify Comment token emission
Drops the per-comment `src.Slice(...).ToString()` allocation in
`ConsumeLineComment` so the Comment token uses `Value = ""` to match
the existing Whitespace / Continuation pattern — callers that need
the literal text can slice the original input via SourceStart /
SourceLength. Also tightens the dispatch comment in BashLexer's
outer scan loop and removes redundant `Assert.DoesNotContain` checks
in two lexer tests where the existing token-count assertion already
proves no Comment token is present.1 parent 9f78504 commit 960cb12
4 files changed
Lines changed: 26 additions & 34 deletions
File tree
- src/ShellSyntaxTree/Internal/Bash/Lexing
- tests/ShellSyntaxTree.Tests/Lexing
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
463 | 463 | | |
464 | 464 | | |
465 | 465 | | |
466 | | - | |
467 | | - | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
468 | 470 | | |
469 | 471 | | |
470 | 472 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
196 | 192 | | |
197 | 193 | | |
198 | 194 | | |
| |||
411 | 407 | | |
412 | 408 | | |
413 | 409 | | |
414 | | - | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
415 | 413 | | |
416 | 414 | | |
417 | 415 | | |
| |||
421 | 419 | | |
422 | 420 | | |
423 | 421 | | |
424 | | - | |
425 | 422 | | |
426 | | - | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | | - | |
431 | | - | |
| 423 | + | |
432 | 424 | | |
433 | 425 | | |
434 | 426 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
46 | 48 | | |
47 | 49 | | |
48 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
575 | 575 | | |
576 | 576 | | |
577 | 577 | | |
578 | | - | |
579 | 578 | | |
580 | 579 | | |
581 | 580 | | |
| |||
586 | 585 | | |
587 | 586 | | |
588 | 587 | | |
589 | | - | |
| 588 | + | |
590 | 589 | | |
591 | 590 | | |
592 | 591 | | |
| |||
605 | 604 | | |
606 | 605 | | |
607 | 606 | | |
608 | | - | |
| 607 | + | |
| 608 | + | |
609 | 609 | | |
610 | 610 | | |
611 | 611 | | |
| |||
625 | 625 | | |
626 | 626 | | |
627 | 627 | | |
| 628 | + | |
| 629 | + | |
628 | 630 | | |
629 | 631 | | |
630 | 632 | | |
631 | 633 | | |
632 | 634 | | |
633 | | - | |
634 | | - | |
635 | | - | |
636 | | - | |
637 | 635 | | |
638 | 636 | | |
639 | 637 | | |
| |||
645 | 643 | | |
646 | 644 | | |
647 | 645 | | |
648 | | - | |
649 | | - | |
650 | | - | |
651 | 646 | | |
652 | 647 | | |
653 | 648 | | |
| |||
676 | 671 | | |
677 | 672 | | |
678 | 673 | | |
679 | | - | |
| 674 | + | |
| 675 | + | |
680 | 676 | | |
681 | 677 | | |
682 | 678 | | |
| |||
686 | 682 | | |
687 | 683 | | |
688 | 684 | | |
689 | | - | |
690 | 685 | | |
691 | 686 | | |
692 | 687 | | |
| |||
697 | 692 | | |
698 | 693 | | |
699 | 694 | | |
700 | | - | |
| 695 | + | |
| 696 | + | |
701 | 697 | | |
702 | 698 | | |
703 | 699 | | |
| |||
0 commit comments