You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Highlight YAML malformed directives (#4) and explicit-indent block scalars (#10)
The last two monogram#12 items, highlighter-only (parser unaffected — src-coverage-yaml
alignment stays 100%; the other six grammars regenerate byte-identical).
#4 — `%YAML 1.2 foo` (a malformed directive). A directive owns its whole line (§6.8), so a
trailing param is illegal: YamlDirective's arity lookahead fails and the generic Directive
excludes the `%YAML ` prefix, so neither token matches and `foo` falls through to the plain-
scalar tokens (mis-scoped as a stray string.unquoted). A `%` can never begin a plain scalar
(§7.3.3 — `%` is a c-indicator), so a `%`-led line the clean directive tokens did not claim is
always a malformed directive. A `#directive-malformed` fallback re-scopes the whole line as an
invalid directive; the indicator is read from the directive tokens' leading literal (not
hardcoded), ranked below the clean directives and above the plain scalars (scopeOrder 6.5).
#10 — `abc: |5` (explicit indentation indicator). An explicit `|N` pins the content indent at
parent+N, overriding the funky body's auto-detect (which floors at the FIRST content line, so a
deeper first line releases a real body line at parent+N as a comment). TextMate cannot use a
captured digit as a repeat count portably (RedCMD does, via Oniguruma `{\N}` backref-as-count +
conditionals + subroutines — all rejected by Onigmo / GitHub-Linguist), so the portable spelling
is a region per digit with a literal `{N}` count. Same structure as the auto-detect block scalars
(forward-captured node indent + an inner introducer rule); the `while` bound becomes `\1 {N}` and
the body is painted via `contentName` (the floor is known, so no auto-detect is needed). Emitted
for digits 1–9 in both value position (covering nested and doc-root `--- |N`) and sequence
position (`- a: |N`, whose floor adds the dash column via `\3`). Verified: empty-line survival,
deeper key-shaped body lines stay opaque, `>N` and chomping in either order, all Onigmo-clean.
yaml-issue12-regressions now passes 10/10 with no `bug:` flags (all hard-gated). scope-gap-yaml
monogramWrong 8 → 7 (99.66% > official 99.51%); agnostic 9/9; tm-diagnostics clean; tsc clean.
Refs #12
{id: '#4',title: '`%YAML 1.2 foo` — the trailing param is part of the directive line',
55
55
src: '%YAML 1.2 foo\n---\n',at: 'foo',col: 0,
56
-
should: (s)=>isDirectiveish(s),why: 'CST emits one `directive` token `%YAML 1.2 foo`; the trailing token is directive content, not a stray plain string.unquoted scalar',bug: true},
56
+
should: (s)=>isDirectiveish(s),why: 'CST emits one `directive` token `%YAML 1.2 foo`; the trailing token is directive content, not a stray plain string.unquoted scalar'},
57
57
58
58
{id: '#5',title: 'an escape inside a double-quoted scalar is highlighted',
0 commit comments