Commit 547b019
committed
Give YAML number/bool/null plain scalars a string-scalar ancestor
A typed plain scalar (`42`, `true`, `null`) is first an unquoted plain scalar —
lexically a string — that the schema then resolves to a number / boolean / null.
It was scoped as a flat `constant.numeric` / `constant.language`, missing the
`string.unquoted` ancestor the official grammar carries (`string.unquoted.plain.out`
› `constant.*`).
That ancestor is load-bearing for folding: when a value scalar is continued by a
more-indented line (`: null\n d`) the value is actually the multi-line plain
string "null d", but a highlighter cannot see the continuation while scoping the
first line. The `string.unquoted` ancestor keeps it string-typed regardless, while
a standalone `null` still reads as the constant from the leaf — so both the folded
(lit.string) and standalone (constant) roles grade correctly.
Token scopes may now be space-separated; the generic token emit namespaces each
part with langName independently (a no-op for the single-scope case, so the other
grammars stay byte-identical).
YAML scope-gap 99.66% -> 99.75% (lit.string 564->565, exact 99.5%), gap to
official 0.3 pts.
Refs #121 parent e811d62 commit 547b019
4 files changed
Lines changed: 630 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4570 | 4570 | | |
4571 | 4571 | | |
4572 | 4572 | | |
4573 | | - | |
| 4573 | + | |
| 4574 | + | |
| 4575 | + | |
| 4576 | + | |
4574 | 4577 | | |
4575 | 4578 | | |
4576 | 4579 | | |
| |||
0 commit comments