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
gen-tm: model import defer * as ns so defer is a keyword (fixes TS #1058)
TS 5.9 deferred import — `import defer * as ns from "x"` — should scope
`defer` as a keyword; both grammars read it as an ordinary alias variable.
Two DATA edits in typescript.ts: ImportClause gains `['defer','*','as',Ident]`
(models the shape so `defer` is structural only before the namespace `*`),
and the scope map gains `keyword.control.import.phase: ['defer']`. `defer`
is NOT in any not()/reserved set, so it stays a valid identifier everywhere
else. A new agnostic detector in gen-tm (`usedAsKeywordOnlyBeforeStar`) finds
any keyword literal whose every occurrence sits right before `*` and emits it
positionally via #import-export-all `(import)\s+(?:(defer)\s+)?(\*)` — derived
from the rule graph, nothing hardcodes "defer". All four generators re-derive
it (TM, Monarch, tree-sitter).
Purely additive to the CFG (the parser already accepted the input as a
degenerate parse): conformance smoke test shows 0 accept/reject deltas vs
master. `defer` as an identifier is preserved (`const defer`, `defer()`,
`import defer from`). TS ledger 26->27/27 — only-official 0, both-miss 0.
agnostic 8/8, test-issues 350/0, tsx/jsx/js-conformance clean, 56/56, tsc
clean; JS/HTML/Vue byte-identical.
Copy file name to clipboardExpand all lines: README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,7 +46,7 @@ The same question, every language at once: take the bugs reported against each *
46
46
47
47
<!-- issues:start -->
48
48
<!-- generated by `npm run bench:issues` — do not edit by hand -->
49
-
_Each hand-written **official** grammar vs Monogram's **derived** one, on the bugs filed against it: **TypeScript 26/27** (official 9/27) · **TSX 11/11** (official 6/11) · **HTML 20/20** (official 13/20) · **Vue 19/19** (official 15/19). Per-issue detail below — auto-generated by `npm run bench:issues`._
49
+
_Each hand-written **official** grammar vs Monogram's **derived** one, on the bugs filed against it: **TypeScript 27/27** (official 9/27) · **TSX 11/11** (official 6/11) · **HTML 20/20** (official 13/20) · **Vue 19/19** (official 15/19). Per-issue detail below — auto-generated by `npm run bench:issues`._
50
50
51
51
#### TypeScript
52
52
| issue | Monogram | official |
@@ -68,7 +68,7 @@ _Each hand-written **official** grammar vs Monogram's **derived** one, on the bu
68
68
|[#891](https://github.com/microsoft/TypeScript-TmLanguage/issues/891) — `from` as an ordinary variable is not a keyword | ✓ | · |
69
69
|[#814](https://github.com/microsoft/TypeScript-TmLanguage/issues/814) — `a instanceof B & c` keeps the operand a value, not a type | ✓ | · |
70
70
|[#950](https://github.com/microsoft/TypeScript-TmLanguage/issues/950) — default import named `type` — the binding is a variable, not the `type` keyword | ✓ | · |
71
-
|[#1058](https://github.com/microsoft/TypeScript-TmLanguage/issues/1058) — `import defer` should scope `defer` as a keyword |·| · |
71
+
|[#1058](https://github.com/microsoft/TypeScript-TmLanguage/issues/1058) — `import defer` should scope `defer` as a keyword |✓| · |
72
72
73
73
<details><summary>… and 9 more both grammars already handle (✓ / ✓)</summary>
0 commit comments