Commit a8a5ed2
authored
A bare plain scalar that is a node — a document value, or the leading value of an
indented block — folds across SAME-COLUMN (not only deeper) continuation lines:
`scalar\n%YAML 1.2` is the one plain scalar "scalar %YAML 1.2", so the `%YAML` line
is plain content, not a directive (RedCMD monogram#12 item #9). The earlier
`#plain-continuation` region only handled a strictly-deeper continuation under an
inline-value header, so a same-column continuation was missed and a `%`/`!`/digit-
led line fell through to `#directive`/`#tag`/`#num`.
Highlighter-only (`src/gen-tm.ts`); `yaml.ts` and the parser are unchanged; the
other six grammars regenerate byte-identical. A new region `#plain-bare-fold`:
- begins only on a BARE plain scalar line (a plain head that is NOT a mapping key /
`- ` / `? ` / doc marker — excluded via the structural-release lookahead), so a
mapping or sequence sibling never opens it (`a: b\nc: d`, `- a\n- b` don't fold);
- `while` continues over same-column-or-deeper non-structural lines and releases at
a structural line (key / `- ` / `? ` / marker / comment) at any depth and at a
dedent below the node column;
- the header line keeps its normal token scoping (a standalone `42`/`true` stays
numeric/boolean); a leftmost catch-all scopes a continuation line that opens with
a non-token char (`%`) as string.unquoted, while the header includes win the
leftmost tie on the header line.
All regex is portable (fixed-width lookbehind only).
Verified: yaml-issue12-regressions #6/#7/#9 PASS (6 pass / 4 known-bug / 0
regression); sanity 15/15; scope-roles 47/47 + 9/9; tm-highlight-guards 22/0;
RedCMD Onigmo diagnostics clean; the other six grammars byte-identical; YAML
scope-gap Monogram-wrong dropped 11 -> 8 (no over-fold — mapping/sequence siblings,
nested mappings, and standalone typed scalars verified unchanged).
Refs #12
1 parent 5abb37f commit a8a5ed2
2 files changed
Lines changed: 101 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4879 | 4879 | | |
4880 | 4880 | | |
4881 | 4881 | | |
| 4882 | + | |
| 4883 | + | |
| 4884 | + | |
| 4885 | + | |
| 4886 | + | |
| 4887 | + | |
| 4888 | + | |
| 4889 | + | |
| 4890 | + | |
| 4891 | + | |
| 4892 | + | |
| 4893 | + | |
| 4894 | + | |
| 4895 | + | |
| 4896 | + | |
| 4897 | + | |
| 4898 | + | |
| 4899 | + | |
| 4900 | + | |
| 4901 | + | |
| 4902 | + | |
| 4903 | + | |
| 4904 | + | |
| 4905 | + | |
| 4906 | + | |
| 4907 | + | |
| 4908 | + | |
| 4909 | + | |
| 4910 | + | |
| 4911 | + | |
| 4912 | + | |
| 4913 | + | |
| 4914 | + | |
| 4915 | + | |
| 4916 | + | |
4882 | 4917 | | |
4883 | 4918 | | |
4884 | 4919 | | |
| |||
7442 | 7477 | | |
7443 | 7478 | | |
7444 | 7479 | | |
| 7480 | + | |
| 7481 | + | |
| 7482 | + | |
| 7483 | + | |
| 7484 | + | |
7445 | 7485 | | |
7446 | 7486 | | |
7447 | 7487 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
29 | 32 | | |
30 | 33 | | |
31 | 34 | | |
| |||
120 | 123 | | |
121 | 124 | | |
122 | 125 | | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
123 | 129 | | |
124 | 130 | | |
125 | 131 | | |
| |||
654 | 660 | | |
655 | 661 | | |
656 | 662 | | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
657 | 718 | | |
658 | 719 | | |
659 | 720 | | |
| |||
0 commit comments