Commit 9c21b3f
committed
Derive YAML plain-fold region literals from the indent config
The multi-line plain-scalar fold regions (gen-tm §2a′/§2a″) and the block-scalar
value-prefix hardcoded YAML structural literals (`#`, `-`/`?`, `---`/`...`, the flow
brackets, `:`) in their regexes. Derive them from the indent config instead so the
YAML region code is data-driven, not hardcoded: comment from `indent.comment`,
compact indicators from `indent.compactIndicators`, document markers from
`blockScalar.documentMarkers`, the flow-bracket exclusion from `indent.flowOpen` /
`indent.flowClose`, and the mapping key/value separator from a new
`indent.keyValueSeparator` field (defaults to ':'). The one remaining inline literal
— node-property `&`/`!` in the block-scalar prop prefix — is anchor/tag-specific
(it derives from the Anchor/Tag tokens, not the indent config) and is left as is.
These regions are gated on `grammar.indent.blockScalar`, so the other six grammars
regenerate byte-identical (verified).
The regenerated YAML grammar is tokenization-IDENTICAL to before: the only byte
changes are two semantically-equivalent char-class normalizations from the derivation
(`[-?]` → `[\-?]`, `[^\n{}[]]` → `[^\n[{]}]`), and a full-corpus tokenization diff over
the yaml-test-suite (406 inputs) shows 0 differences. yaml-issue12-regressions stays
6 pass / 4 known-bug / 0 regression; scope-gap Monogram-wrong unchanged at 8; agnostic
guard 9/9; sanity 15/15; scope-roles 47/47 + 9/9; tm-highlight-guards 22/0; RedCMD
Onigmo diagnostics clean.
Refs #121 parent e2b0a02 commit 9c21b3f
4 files changed
Lines changed: 29 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4645 | 4645 | | |
4646 | 4646 | | |
4647 | 4647 | | |
| 4648 | + | |
| 4649 | + | |
| 4650 | + | |
| 4651 | + | |
| 4652 | + | |
| 4653 | + | |
| 4654 | + | |
| 4655 | + | |
| 4656 | + | |
| 4657 | + | |
| 4658 | + | |
| 4659 | + | |
| 4660 | + | |
| 4661 | + | |
4648 | 4662 | | |
4649 | 4663 | | |
4650 | 4664 | | |
| |||
4739 | 4753 | | |
4740 | 4754 | | |
4741 | 4755 | | |
4742 | | - | |
| 4756 | + | |
4743 | 4757 | | |
4744 | 4758 | | |
4745 | 4759 | | |
| |||
4832 | 4846 | | |
4833 | 4847 | | |
4834 | 4848 | | |
4835 | | - | |
| 4849 | + | |
4836 | 4850 | | |
4837 | 4851 | | |
4838 | 4852 | | |
| |||
4844 | 4858 | | |
4845 | 4859 | | |
4846 | 4860 | | |
4847 | | - | |
| 4861 | + | |
4848 | 4862 | | |
4849 | 4863 | | |
4850 | 4864 | | |
| |||
4897 | 4911 | | |
4898 | 4912 | | |
4899 | 4913 | | |
4900 | | - | |
| 4914 | + | |
4901 | 4915 | | |
4902 | 4916 | | |
4903 | 4917 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
311 | 311 | | |
312 | 312 | | |
313 | 313 | | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
314 | 319 | | |
315 | 320 | | |
316 | 321 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
318 | 318 | | |
319 | 319 | | |
320 | 320 | | |
321 | | - | |
| 321 | + | |
322 | 322 | | |
323 | 323 | | |
324 | 324 | | |
| |||
606 | 606 | | |
607 | 607 | | |
608 | 608 | | |
609 | | - | |
610 | | - | |
| 609 | + | |
| 610 | + | |
611 | 611 | | |
612 | 612 | | |
613 | 613 | | |
| |||
661 | 661 | | |
662 | 662 | | |
663 | 663 | | |
664 | | - | |
665 | | - | |
| 664 | + | |
| 665 | + | |
666 | 666 | | |
667 | 667 | | |
668 | 668 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
614 | 614 | | |
615 | 615 | | |
616 | 616 | | |
| 617 | + | |
617 | 618 | | |
618 | 619 | | |
619 | 620 | | |
| |||
0 commit comments