Skip to content

Commit a9bb22e

Browse files
chore: remove the Vue grammar (moved to vuejs/language-tools) (#50)
1 parent 479ff7a commit a9bb22e

43 files changed

Lines changed: 29 additions & 7675 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

KNOWN-GAPS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ commits) so the ledger is deterministic and commit-trackable.
1414

1515
Regenerate: `node test/gap-ledger.ts --write` · verify up-to-date: `node test/gap-ledger.ts --check`.
1616

17-
**0 gaps** across 7 grammars · 0 dropped.
17+
**0 gaps** across 6 grammars · 0 dropped.
1818

1919
_No gaps currently surface._ The generative check reports no valid-input flat-highlighter
2020
divergence on the derived corpus. (This is the ledger MECHANISM; it lists what the check finds.)

README.md

Lines changed: 13 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,15 @@ Write a language's grammar **once**, as an executable definition. Monogram runs
99
- **TypeScript** ([`typescript.ts`](typescript.ts)) — mature: 100% valid-code coverage, 97.8% bidirectional vs `tsc`.
1010
- **JavaScript** ([`javascript.ts`](javascript.ts)) — the standalone ECMAScript base TypeScript [builds on](#adding-a-language) (subset → superset); parses real-world JS, with less conformance-corpus depth than TS so far.
1111
- **HTML** ([`html.ts`](html.ts)) — the engine reaching *past token streams into markup*; ~95 lines, validated against [`parse5`](https://github.com/inikulin/parse5).
12-
- **Vue** ([`vue.ts`](vue.ts)) — a dialect of `html.ts`: SFC blocks that embed Monogram's own TS/JS/CSS, plus directives and `{{ }}` interpolation.
12+
- **YAML** ([`yaml.ts`](yaml.ts)) — indentation-sensitive markup on the shared engine; validated against the maintained [RedCMD/YAML-Syntax-Highlighter](https://github.com/RedCMD/YAML-Syntax-Highlighter).
13+
14+
## Used by
15+
16+
Projects shipping Monogram-derived grammars:
17+
18+
- [**vuejs/language-tools**](https://github.com/vuejs/language-tools) — the Vue TextMate grammars + VS Code language configuration ([vuejs/language-tools#6085](https://github.com/vuejs/language-tools/pull/6085)).
19+
20+
Using Monogram in your project? Open a PR to add it here.
1321

1422
## Quick start
1523

@@ -77,7 +85,6 @@ This matters because `tsc`'s *parser* is not the same thing as the language. It
7785
| TSX | 96.7% · 65.7% | 95.6% vs 95.4% |
7886
| HTML | 95.3% · 49.3% | 100.0% vs 98.8% |
7987
| YAML | 100.0% · 73.9% | 100.0% vs 99.5% |
80-
| Vue || 98.0% vs 98.0% |
8188
<!-- coverage:end -->
8289

8390
Measured against the *maintained* official grammar where it matters, not a dead bundle: JS/TS use Microsoft's maintained [TypeScript-TmLanguage](https://github.com/microsoft/TypeScript-TmLanguage); YAML uses the maintained [RedCMD/YAML-Syntax-Highlighter](https://github.com/RedCMD/YAML-Syntax-Highlighter) that VS Code switched to ([microsoft/vscode#232244](https://github.com/microsoft/vscode/pull/232244)); only HTML's baseline is the unmaintained [textmate/html.tmbundle](https://github.com/textmate/html.tmbundle) — the #203212 case Monogram targets.
@@ -88,7 +95,7 @@ Take the bugs reported against each *hand-written* official grammar and ask whet
8895

8996
<!-- issues:start -->
9097
<!-- generated by `npm run bench:issues` — do not edit by hand -->
91-
_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 8/8** (official 8/8). Per-issue detail below — auto-generated by `npm run bench:issues`._
98+
_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) · **YAML 8/8** (official 8/8). Per-issue detail below — auto-generated by `npm run bench:issues`._
9299

93100
#### TypeScript
94101
| issue | Monogram | official |
@@ -180,40 +187,6 @@ _Each hand-written **official** grammar vs Monogram's **derived** one, on the bu
180187

181188
</details>
182189

183-
#### Vue
184-
| issue | Monogram | official |
185-
|---|:--:|:--:|
186-
| [#6007](https://github.com/vuejs/language-tools/issues/6007)/[#2096](https://github.com/vuejs/language-tools/issues/2096)/[#520](https://github.com/vuejs/language-tools/issues/520)`as` type assertion in directive value || · |
187-
| [#2060](https://github.com/vuejs/language-tools/issues/2060)-inline — `` const a = 1;</script> `` (content on the close line) embeds + clean close || · |
188-
| [#2060](https://github.com/vuejs/language-tools/issues/2060)-inline-adjacent — an unterminated union before a same-line `` </script> ``, then a second `<script setup>` block || · |
189-
| [#5660](https://github.com/vuejs/language-tools/issues/5660)`as const` cast in a v-for value || · |
190-
| [#4716](https://github.com/vuejs/language-tools/issues/4716)/[#5571](https://github.com/vuejs/language-tools/issues/5571)`as` cast followed by another attribute || · |
191-
192-
<details><summary>… and 18 more both grammars already handle (✓ / ✓)</summary>
193-
194-
| issue | Monogram | official |
195-
|---|:--:|:--:|
196-
| [#3400](https://github.com/vuejs/language-tools/issues/3400)`instanceof` in {{ }} |||
197-
| [#5370](https://github.com/vuejs/language-tools/issues/5370)`typeof x !==` in v-if |||
198-
| [#5118](https://github.com/vuejs/language-tools/issues/5118)`?.` / `??` in {{ }} |||
199-
| [#1675](https://github.com/vuejs/language-tools/issues/1675) — arrow `=>` in {{ }} |||
200-
| [#6039](https://github.com/vuejs/language-tools/issues/6039)/[#4741](https://github.com/vuejs/language-tools/issues/4741)`<` operator in {{ }} (not a tag!) |||
201-
| [#5722](https://github.com/vuejs/language-tools/issues/5722) — negated ternary + quotes in {{ }} |||
202-
| [#5538](https://github.com/vuejs/language-tools/issues/5538)/[#2060](https://github.com/vuejs/language-tools/issues/2060) — trailing `export type` before `` </script> `` |||
203-
| [#3999](https://github.com/vuejs/language-tools/issues/3999) — a force-wrapped multi-line `<script lang="ts">` start tag keeps the body as the `ts` family (no .ts→.js flip) |||
204-
| [#4769](https://github.com/vuejs/language-tools/issues/4769) — tag name starting with `template` |||
205-
| [#5701](https://github.com/vuejs/language-tools/issues/5701)`{{` inside a `<script>` string |||
206-
| [#6070](https://github.com/vuejs/language-tools/issues/6070) — capitalized component then a `<style>` block |||
207-
| [#4291](https://github.com/vuejs/language-tools/issues/4291)`<script lang="tsx">` body embeds the DECLARED `source.tsx` (not a source.js fallback) |||
208-
| [#4291](https://github.com/vuejs/language-tools/issues/4291)-jsx — `<script lang="jsx">` body embeds the DECLARED `source.js.jsx` |||
209-
| generic="T" — `generic="T extends U">` type-param list embeds as TS |||
210-
| [#4410](https://github.com/vuejs/language-tools/issues/4410) — dynamic directive argument `:[attr]` |||
211-
| [#3727](https://github.com/vuejs/language-tools/issues/3727)`.prop` modifier shorthand |||
212-
| [#2666](https://github.com/vuejs/language-tools/issues/2666) — dynamic slot name from a template literal |||
213-
| [#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 |||
214-
215-
</details>
216-
217190
#### YAML
218191
_No asymmetries — both grammars handle all 8 filed bugs below._
219192

@@ -233,7 +206,7 @@ _No asymmetries — both grammars handle all 8 filed bugs below._
233206
</details>
234207
<!-- issues:end -->
235208

236-
<sub>A sampled ledger of real tracker issues, not an exhaustive audit. Run `npm run bench:issues` to regenerate (needs the official grammars: VS Code's installed TS/JS/HTML, and the Vue fixtures — see [`test/vue-bench.ts`](test/vue-bench.ts)). Sources: [`test/issue-cases.ts`](test/issue-cases.ts), [`test/html-issue-cases.ts`](test/html-issue-cases.ts), [`test/vue-issue-cases.ts`](test/vue-issue-cases.ts).</sub>
209+
<sub>A sampled ledger of real tracker issues, not an exhaustive audit. Run `npm run bench:issues` to regenerate (needs the official grammars: VS Code's installed TS/JS/HTML). Sources: [`test/issue-cases.ts`](test/issue-cases.ts), [`test/html-issue-cases.ts`](test/html-issue-cases.ts).</sub>
237210

238211

239212
### The ceiling — and the bar for claiming it
@@ -363,7 +336,7 @@ const Regex = token(seq(
363336
});
364337
```
365338

366-
[`test/agnostic.ts`](test/agnostic.ts) proves it directly — the same engine parses a toy grammar whose identifier token is `Word`, with no templates or regex. The deeper proof is [`html.ts`](html.ts): markup shares *nothing* with TypeScript's token stream, yet the same engine handles it (and Vue layers SFC blocks + `{{ }}` interpolation on top).
339+
[`test/agnostic.ts`](test/agnostic.ts) proves it directly — the same engine parses a toy grammar whose identifier token is `Word`, with no templates or regex. The deeper proof is [`html.ts`](html.ts): markup shares *nothing* with TypeScript's token stream, yet the same engine handles it.
367340

368341
## Adding a language
369342

@@ -373,7 +346,7 @@ A new language is **one grammar file** on the unchanged engine:
373346
2. **Prove it as a parser** against the language's own official test suite, measured **bidirectionally** (accept what the reference accepts, reject what it rejects).
374347
3. **Drop in the official TextMate grammar** as the baseline, so highlighter coverage is measured against what you're replacing, not asserted.
375348

376-
The lexer, CST types, and all three highlighters fall out of step 1; a *dialect* (`.tsx`/`.jsx` via [`jsx.ts`](jsx.ts), or Vue on [`html.ts`](html.ts)) reuses a base grammar's rules by name in a few lines. The conformance/highlighter harnesses are currently TypeScript-specific (they call `tsc` and read VS Code's grammar) — point them at your own reference compiler.
349+
The lexer, CST types, and all three highlighters fall out of step 1; a *dialect* (`.tsx`/`.jsx`, or a markup dialect on [`html.ts`](html.ts)) reuses a base grammar's rules by name in a few lines. The conformance/highlighter harnesses are currently TypeScript-specific (they call `tsc` and read VS Code's grammar) — point them at your own reference compiler.
377350

378351
## Known differences from the official highlighter
379352

TESTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The suite produces **four kinds of report**, each answering a different question
1717
The CI-blocking pass/fail checks (no external corpus needed). One runner, one ✓/✗ table, one
1818
exit code — instead of a dozen scripts with a dozen formats. Covers: sanity / agnostic /
1919
refactor-guard / issue-cases · conformance (js, tsx, jsx, html) · highlighter guards + RedCMD
20-
diagnostics + Monarch + HTML embed/lexer · Vue directives/embeds/interpolation · YAML
20+
diagnostics + Monarch + HTML embed/lexer · YAML
2121
issue-12 + depth-witnesses · the generative **scope≡role** check + the gap-ledger selftest +
2222
`--check`. `node test/check.ts <substr>` runs a subset (e.g. `… yaml`).
2323

@@ -64,7 +64,7 @@ Neither subsumes the other. `check` (self-consistency) does **not** replace the
6464

6565
## 4. Bench — on demand
6666

67-
`npm run bench:perf`, `bench:html-official`, `bench:vue-*`, `bench:issues` (the README bug ledger),
67+
`npm run bench:perf`, `bench:html-official`, `bench:issues` (the README bug ledger),
6868
`gate:treesitter`, `compat`. Informational — perf, official-comparison detail, repo-compat. Not gates.
6969

7070
---

package-lock.json

Lines changed: 0 additions & 215 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)