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
README: update conformance to 97.8% bidirectional (3585/3664)
Reflects this session's over-accept work (FP 120->79 across 8 classes): bidirectional
96.7%->97.8%, grammar 537->628 lines. Also frame the remaining gap honestly — most
of it is code TypeScript parses cleanly and only rejects with a *semantic* error,
which a context-free grammar isn't meant to catch (the practical grammar-only ceiling).
Copy file name to clipboardExpand all lines: README.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ A TextMate grammar is a pile of regexes guessing at a language's structure. It's
10
10
11
11
Monogram inverts the dependency:
12
12
13
-
1.**Write the grammar, then prove it.** The grammar is executable. Monogram runs it as a recursive-descent + Pratt parser over the TypeScript conformance suite and measures conformance *bidirectionally* — it must accept what `tsc` accepts **and** reject what `tsc` rejects. Today it parses **100% of valid single-file cases** (3376 / 3376 — zero valid-code gaps) and agrees with `tsc`**bidirectionally on 96.7%** (3544 / 3664); the remaining gap is *over-acceptance* (the grammar is still too permissive on some invalid inputs), and the goal is 100% both ways — a *verified, complete model* of the language's syntax, not an approximation.
13
+
1.**Write the grammar, then prove it.** The grammar is executable. Monogram runs it as a recursive-descent + Pratt parser over the TypeScript conformance suite and measures conformance *bidirectionally* — it must accept what `tsc` accepts **and** reject what `tsc` rejects. Today it parses **100% of valid single-file cases** (3376 / 3376 — zero valid-code gaps) and agrees with `tsc`**bidirectionally on 97.8%** (3585 / 3664); the remaining gap is *over-acceptance* (the grammar is still too permissive on some invalid inputs — and most of what's left is code TypeScript itself parses cleanly and only rejects later with a *semantic* error, which a context-free grammar is not meant to catch), and the goal is to push as close to 100% both ways as a pure grammar can — a *verified, complete model* of the language's syntax, not an approximation.
14
14
15
15
2.**Derive the highlighter from the proven grammar.** The TextMate grammar is generated from that same parser-validated grammar — never hand-written. Its correctness is underwritten by the parser conformance run, not by regex tuning.
16
16
@@ -34,11 +34,11 @@ And — from the same grammar — first-pass generators for the rest of the edit
34
34
35
35
## Results
36
36
37
-
Validated on TypeScript (grammar: [`examples/typescript.ts`](examples/typescript.ts), 537 lines):
37
+
Validated on TypeScript (grammar: [`examples/typescript.ts`](examples/typescript.ts), 628 lines):
0 commit comments