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
The per-language issue ledger covered TS/TSX/HTML/Vue but not YAML. Add a YAML
section: 9 real upstream YAML-grammar bugs as data in test/yaml-issue-cases.ts
(same {id,title,src,at,want} shape as the others), wired into test/issue-table.ts
(loads the maintained RedCMD official grammar + its version sub-grammars, grades
each case against it and Monogram, emits the table).
Each case cites the underlying tracker — the canonical aggregator is
RedCMD/YAML-Syntax-Highlighter#1 ("Pre-existing grammar issues"), which links the
VS Code / textmate-yaml.tmbundle / atom-language-yaml issues: e.g. tmbundle#38
(block scalar mis-colored after a leading newline), atom/language-yaml#114 (`#` in
a block body), #119 (escapes in a quoted key), vscode#170032 (frontmatter `---`),
tmbundle#18 (`{}` in literal style), #39 (int-vs-string).
Result: YAML Monogram 9/9 vs the maintained official 8/9 — eight both handle, and
the block-scalar-used-as-an-explicit-key is scoped as a key name only by Monogram.
linkify extended for the atom/RedCMD owner/repo slugs and a per-language tmbundle
prefix; the TS/TSX/HTML/Vue sections are byte-identical.
Copy file name to clipboardExpand all lines: README.md
+21-1Lines changed: 21 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -66,7 +66,7 @@ The same question, every language at once: take the bugs reported against each *
66
66
67
67
<!-- issues:start -->
68
68
<!-- generated by `npm run bench:issues` — do not edit by hand -->
69
-
_Each hand-written **official** grammar vs Monogram's **derived** one, on the bugs filed against it: **TypeScript 26/26** (official 8/26) · **TSX 11/11** (official 5/11) · **HTML 20/20** (official 13/20) · **Vue 23/23** (official 18/23). Per-issue detail below — auto-generated by `npm run bench:issues`._
69
+
_Each hand-written **official** grammar vs Monogram's **derived** one, on the bugs filed against it: **TypeScript 26/26** (official 8/26) · **TSX 11/11** (official 5/11) · **HTML 20/20** (official 13/20) · **Vue 23/23** (official 18/23) · **YAML 9/9** (official 8/9). Per-issue detail below — auto-generated by `npm run bench:issues`._
70
70
71
71
#### TypeScript
72
72
| issue | Monogram | official |
@@ -190,6 +190,26 @@ _Each hand-written **official** grammar vs Monogram's **derived** one, on the bu
190
190
|[#2666](https://github.com/vuejs/language-tools/issues/2666) — dynamic slot name from a template literal | ✓ | ✓ |
191
191
|[#2560](https://github.com/vuejs/language-tools/issues/2560)/[#1290](https://github.com/vuejs/language-tools/issues/1290) — `type` as a v-for loop variable | ✓ | ✓ |
192
192
193
+
</details>
194
+
195
+
#### YAML
196
+
| issue | Monogram | official |
197
+
|---|:--:|:--:|
198
+
|[RedCMD/YAML-Syntax-Highlighter#1](https://github.com/RedCMD/YAML-Syntax-Highlighter/issues/1) — a block scalar used AS an explicit key is scoped as a key name | ✓ | · |
199
+
200
+
<details><summary>… and 8 more both grammars already handle (✓ / ✓)</summary>
201
+
202
+
| issue | Monogram | official |
203
+
|---|:--:|:--:|
204
+
|[vscode#170032](https://github.com/microsoft/vscode/issues/170032) — document markers `---` / `...` are document structure, not stray punctuation | ✓ | ✓ |
205
+
|[atom/language-yaml#114](https://github.com/atom/language-yaml/issues/114) — a `#` in a block-scalar body is content, not a comment | ✓ | ✓ |
206
+
|[tmbundle#38](https://github.com/textmate/yaml.tmbundle/issues/38) — a block scalar with leading/internal EMPTY lines stays one string region | ✓ | ✓ |
207
+
|[tmbundle#18](https://github.com/textmate/yaml.tmbundle/issues/18) — JSON-ish punctuation (`{`/`}`) and a tab indicator inside a block scalar stay content | ✓ | ✓ |
208
+
|[RedCMD/YAML-Syntax-Highlighter#1](https://github.com/RedCMD/YAML-Syntax-Highlighter/issues/1) — an anchor `&a` in explicit-key (`?`) position is still an anchor | ✓ | ✓ |
209
+
|[RedCMD/YAML-Syntax-Highlighter#1](https://github.com/RedCMD/YAML-Syntax-Highlighter/issues/1) — a bare `?` opening an explicit multi-line sequence key is the map-key indicator | ✓ | ✓ |
210
+
|[atom/language-yaml#119](https://github.com/atom/language-yaml/issues/119) — an escape inside a double-quoted KEY is highlighted | ✓ | ✓ |
211
+
|[tmbundle#39](https://github.com/textmate/yaml.tmbundle/issues/39) — a plain scalar resolving to `null` is lexically a string that resolves to a constant | ✓ | ✓ |
constisAnchor=(s: string)=>s.includes('anchor')&&!!s.replace(/source\.yaml/g,'').match(/entity\.name|variable\.other/);// an anchor scope, not bare source
21
+
constisMapKeyPunct=(s: string)=>s.includes('punctuation.definition.map.key');// the `?` explicit-key indicator
constisTag=(s: string)=>s.includes('entity.name.tag');// scoped as a key NAME (entity.name.tag.yaml)
24
+
conststringResolvesTo=(lang: string)=>(s: string)=>s.includes('string.unquoted')&&s.includes(lang);// plain scalar is lexically a string that RESOLVES to a typed constant
25
+
26
+
exportconstcases: YamlCase[]=[
27
+
// ── document structure ──
28
+
{id: 'vscode#170032',title: 'document markers `---` / `...` are document structure, not stray punctuation',src: '---\nfoo: bar\n...\n',
29
+
at: '---',want: isDocMarker},// both scope it entity.other.document.{begin,end}.yaml — Monogram derives the marker from the grammar, the official hand-rolls it (vscode#170032: frontmatter hyphens were unscoped)
30
+
31
+
// ── block scalars (`|` / `>`): the body is opaque string content, regardless of what it contains ──
32
+
{id: 'atom/language-yaml#114',title: 'a `#` in a block-scalar body is content, not a comment',src: '- >\n \n \n # detected\n',
33
+
at: '# detected',want: isBlockScalar},// the `# detected` line is inside the folded scalar → string.unquoted.block, NOT comment.line (atom#114: a hash sign breaks highlighting)
34
+
{id: 'tmbundle#38',title: 'a block scalar with leading/internal EMPTY lines stays one string region',src: '>\n\n folded\n line\n\n next\n * bullet\n',
35
+
at: 'bullet',want: isBlockScalar},// `* bullet` sits after an empty line, deeper-indented — it is block-scalar content, not a sequence item or a new scalar (tmbundle#38: text after `|`/`>` colorized differently when a leading newline exists). Checkpoint is `bullet` (downstream of the empty line — the hardest span); `folded` passes identically
36
+
{id: 'tmbundle#18',title: 'JSON-ish punctuation (`{`/`}`) and a tab indicator inside a block scalar stay content',src: 'block:\t|\n void main() {\n }\n',
37
+
at: '}',want: isBlockScalar},// the `}` is literal block-scalar content, not punctuation — and the indicator follows a TAB (tmbundle#18: `{ }` inside literal style breaks highlighting; #17 is the sibling colon case)
38
+
39
+
// ── explicit-key (`?`) constructs ──
40
+
{id: 'RedCMD/YAML-Syntax-Highlighter#1',title: 'an anchor `&a` in explicit-key (`?`) position is still an anchor',src: '? &a a\n: &b b\n: *a\n',
41
+
at: '&a',want: isAnchor},// `&a` after the explicit-key `?` is an anchor (entity.name.type.anchor / variable.other.anchor), not bare source — the original monogram#12 multi-item repro
42
+
{id: 'RedCMD/YAML-Syntax-Highlighter#1',title: 'a bare `?` opening an explicit multi-line sequence key is the map-key indicator',src: '?\n- a\n- b\n:\n- c\n- d\n',
43
+
at: '?',want: isMapKeyPunct},// the lone `?` (its value is the multi-line block sequence below) is punctuation.definition.map.key.yaml — both grammars handle the explicit complex-key form
44
+
{id: 'RedCMD/YAML-Syntax-Highlighter#1',title: 'a block scalar used AS an explicit key is scoped as a key name',src: '? |\n block key\n: v\n',
45
+
at: 'block key',want: isTag},// MONOGRAM-ONLY ✓: Monogram scopes the block-scalar explicit key as a key NAME (entity.name.tag.yaml); the official leaves it string.unquoted.block (it has no entity.name.tag) → only-Monogram
46
+
47
+
// ── quoted KEYS carry their escapes / plain scalars carry a string ancestor ──
48
+
{id: 'atom/language-yaml#119',title: 'an escape inside a double-quoted KEY is highlighted',src: '"foo\\nbar": 23\n',
49
+
at: '\\n',want: isEscape},// the `\n` inside the quoted key `"foo\nbar"` is constant.character.escape (atom#119: keys with escaped chars within are not highlighted correctly) — both grammars sub-scope escapes inside the key now
50
+
{id: 'tmbundle#39',title: 'a plain scalar resolving to `null` is lexically a string that resolves to a constant',src: 'a: null\n',
51
+
at: 'null',want: stringResolvesTo('constant.language')},// the FULL chain carries BOTH string.unquoted (it is lexically a plain scalar) AND constant.language (it resolves to null) — not constant.language alone (tmbundle#39: integers recognized as strings / vice versa; the string ancestor must survive)
0 commit comments