Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions docs/COMPLETENESS.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,15 +260,15 @@ Written by `npm run gen` (`node test/tm-completeness.ts --gen`); CI's artifact d

| Grammar | Tokens | Keyword literals | Repo keys (reachable) | Leaf cross-check (corpus) |
|---|---:|---:|---:|---:|
| typescript | 11/11 | 75/75 | 163/163 | 107/107 |
| javascript | 12/12 | 52/52 | 108/108 | 84/84 |
| typescriptreact | 15/15 | 75/75 | 176/176 | 107/107 |
| javascriptreact | 16/16 | 52/52 | 121/121 | 90/90 |
| typescript | 11/11 | 75/75 | 163/163 | 89/89 |
| javascript | 12/12 | 52/52 | 108/108 | 82/82 |
| typescriptreact | 15/15 | 75/75 | 176/176 | 101/101 |
| javascriptreact | 16/16 | 52/52 | 121/121 | 96/96 |
| html | 7/7 | 0/0 | 28/28 | 175/175 |
| yaml | 19/19 | 0/0 | 54/54 | 1541/1541 |
| **total** | **80/80** | **254/254** | **650/650** | **2104/2104** |
| **total** | **80/80** | **254/254** | **650/650** | **2084/2084** |

**Decidable completeness: 984/984 = 100.00%** (token discharge 80/80 · keyword-literal discharge 254/254 · repository reachability 650/650) — a structural check on the emitted artifact, no corpus. Leaf cross-check (corpus, redundant): 2104/2104. **0 open completeness gaps.**
**Decidable completeness: 984/984 = 100.00%** (token discharge 80/80 · keyword-literal discharge 254/254 · repository reachability 650/650) — a structural check on the emitted artifact, no corpus. Leaf cross-check (corpus, redundant): 2084/2084. **0 open completeness gaps.**

<!-- COMPLETENESS-LEDGER:END -->

Expand Down
40 changes: 26 additions & 14 deletions docs/decisions/javascript.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ Every choice point of the grammar and how the generated parser (the portable pla

| choice point | sites | one token | two tokens | by attempt | longest match | take a mark |
|:--|--:|--:|--:|--:|--:|--:|
| rule alternatives | 14 | 2 | 3 | 0 | 9 | 11 |
| rule alternatives | 15 | 2 | 3 | 0 | 10 | 12 |
| NUD arms | 3 | 0 | 0 | 0 | 3 | 3 |
| LED connectors | 3 | 3 | 0 | 0 | 0 | 3 |
| inline choice | 84 | 41 | 0 | 43 | 0 | 42 |
| star | 57 | 56 | 0 | 1 | 0 | 36 |
| inline choice | 86 | 43 | 0 | 43 | 0 | 43 |
| star | 59 | 58 | 0 | 1 | 0 | 38 |
| opt | 86 | 54 | 0 | 32 | 0 | 53 |
| sep | 45 | 7 | 0 | 38 | 0 | 0 |

Expand Down Expand Up @@ -42,19 +42,30 @@ Per rule: its candidate lists (every key and what decides it), then the inline c

### DecoratorExpr

- DecoratorExpr: `opt('(' sep(Expr, ',') ')')`: one token; takes a mark: it can fail after `'('`
- DecoratorExpr: `sep(Expr, ',')`: by attempt
- DecoratorExpr (2 alternatives):
- `@`: two tokens: committed to at (#0), unless decorator (#1) admits the token (then the frame) (takes a mark: it can fail after `'@'`)
- <Ident>, <HexNumber>, <OctalNumber>, <BinaryNumber>, <BigInt>, <Number>, <LegacyNumber>, <String> and 7 more: no candidate, the list fails
- <Decorator>: one token: committed to decorator (#1)
- two tokens (pairs): at (#0) at `@` only before '('; decorator (#1) at `@` only before Ident
- two tokens (SECOND): at (#0) only before '('
- longest match: a candidate frame (a mark per new best) at the keys above where an `unless` candidate admits the token, over at (#0), decorator (#1)
- one token, no mark: 1 inline choice
- DecoratorExpr / at: `many((',' Expr))`: one token; takes a mark: it can fail after `','`
- DecoratorExpr / decorator: `alt(Decorator \| '@' !{'break'\|'case'\|'catch'\|'class'\|…3…`: one token; takes a mark: branch 1: it can fail after `'@'`
- DecoratorExpr / decorator: `many(('.' alt(Ident \| PrivateField)))`: one token; takes a mark: it can fail after `'.'`
- DecoratorExpr / decorator: `opt('(' sep(Expr, ',') ')')`: one token; takes a mark: it can fail after `'('`
- DecoratorExpr / decorator: `sep(Expr, ',')`: by attempt

### Expr

- Expr NUD (37 NUD arms):
- `!`, `+`, `++`, `-`, `--`, `delete`, `typeof`, `void` and 1 more: one token: committed to prefixOp (#10) (takes a mark: its operand can fail after the operator)
- `(`: two tokens: committed to paren (#23), unless arrow (#19) admits the token (then the frame) (takes a mark: it can fail after `'('`)
- `...`: one token: committed to spread (#11) (takes a mark: it can fail after `'...'`)
- `@`, `class`: two tokens: committed to namedClass (#35), unless anonymousClass (#36) admits the token (then the frame) (takes a mark: it can fail after `many(DecoratorExpr)`)
- `[`: one token: committed to array (#16) (takes a mark: it can fail after `'['`)
- `await`: two tokens: committed to prefixOp (#10), unless ident (#5), arrowIdentifier (#21) admit the token (then the frame) (takes a mark: its operand can fail after the operator)
- `break`, `case`, `catch`, `const`, `continue`, `debugger`, `default`, `do` and 16 more: no candidate, the list fails
- `class`: two tokens: committed to namedClass (#35), unless anonymousClass (#36) admits the token (then the frame) (takes a mark: it can fail after `many(DecoratorExpr)`)
- `false`: one token: committed to false_ (#1)
- `import`: one token: committed to import_ (#24) (takes a mark: it can fail after `'import'`)
- `null`: one token: committed to null_ (#2)
Expand All @@ -76,7 +87,7 @@ Per rule: its candidate lists (every key and what decides it), then the inline c
- <Decorator>: two tokens: committed to namedClass (#35), unless anonymousClass (#36) admits the token (then the frame) (takes a mark: it can fail after `many(DecoratorExpr)`)
- <PrivateField>: one token: committed to privateField (#25)
- <$templateMiddle>, <$templateTail>, punctuation: no candidate, the list fails
- two tokens (SECOND): asyncArrow (#18) only before '('; arrow (#19) only before ')'|'...'|'['|'{'|Decorator|Ident; asyncArrowIdentifier (#20) only before Ident; arrowIdentifier (#21) only before '=>'; namedClass (#35) only before '('|'class'|Decorator|Ident; anonymousClass (#36) only before '('|'class'|'extends'|'{'|Decorator
- two tokens (SECOND): asyncArrow (#18) only before '('; arrow (#19) only before ')'|'...'|'@'|'['|'{'|Decorator|…1; asyncArrowIdentifier (#20) only before Ident; arrowIdentifier (#21) only before '=>'; namedClass (#35) only before '('|'.'|'@'|'class'|Decorator|Ident; anonymousClass (#36) only before '('|'.'|'@'|'class'|'extends'|'{'|…2
- longest match: a candidate frame (a mark per new best) at `async`, `function`, `new`, the keys above where an `unless` candidate admits the token, every token of a kind no case names, over ident (#5), template (#8), prefixOp (#10), newDotTarget (#12), construct (#13), newNamedClass (#14) and 13 more
- Expr LED (7 connectors, 39 binary operators):
- `(`: one token: led_paren (takes a builder checkpoint: led_paren: it can fail after `sep(Expr, ',')`)
Expand Down Expand Up @@ -222,11 +233,11 @@ Per rule: its candidate lists (every key and what decides it), then the inline c
- Stmt (19 alternatives):
- `!`, `(`, `+`, `++`, `-`, `--`, `...`, `[` and 10 more: one token: committed to expr (#18) (takes a mark: it can fail after `Expr`)
- `;`: one token: committed to empty (#13)
- `@`, `class`, `export`, `function`: one token: committed to decl (#17)
- `async`: two tokens: committed to expr (#18), unless labelled (#12), decl (#17) admit the token (then the frame) (takes a mark: it can fail after `Expr`)
- `await`: two tokens: committed to expr (#18), unless labelled (#12), using (#16) admit the token (then the frame) (takes a mark: it can fail after `Expr`)
- `break`: one token: committed to break_ (#9) (takes a mark: it can fail after `'break'`)
- `case`, `catch`, `default`, `else`, `enum`, `extends`, `finally`, `in` and 1 more: no candidate, the list fails
- `class`, `export`, `function`: one token: committed to decl (#17)
- `const`, `var`: two tokens: committed to variable (#1) (takes a mark: it can fail after `('let'\|'const'\|'var')`)
- `continue`: one token: committed to continue_ (#10) (takes a mark: it can fail after `'continue'`)
- `debugger`: one token: committed to debugger_ (#14) (takes a mark: it can fail after `'debugger'`)
Expand Down Expand Up @@ -355,7 +366,7 @@ Per rule: its candidate lists (every key and what decides it), then the inline c
- <$templateMiddle>, <$templateTail>, punctuation: no candidate, the list fails
- two tokens (pairs): declaration (#0) at `await` only before 'using'; declaration (#0) at `let`, `using` only before '['|'{'|Ident
- two tokens (SECOND): declaration (#0) only before '['|'using'|'{'|Ident
- longest match: a candidate frame (a mark per new best) at `!`, `(`, `+`, `++`, `-`, `--`, `...`, `[` and 2 more, every token of a kind no case names, over declaration (#0), classic (#1), in_ (#2), of (#3)
- longest match: a candidate frame (a mark per new best) at `!`, `(`, `+`, `++`, `-`, `--`, `...`, `@` and 3 more, every token of a kind no case names, over declaration (#0), classic (#1), in_ (#2), of (#3)
- ForHead / declaration: `alt(('let'\|'const'\|'var') ForBinding alt(many((… …)) ';…`: by attempt; takes a mark: branch 0: it can fail after `('let'\|'const'\|'var')`; branch 1: it can fail after `alt('using' \| 'await' 'using')`
- ForHead / declaration: `alt(many((',' ForBinding)) ';' opt(Expr many((… …))) ';…`: by attempt; takes a mark: branch 0: it can fail after `many((',' ForBinding))`; branch 1: it can fail after `'in'`; branch 2: it can fail after `'of'`
- ForHead / declaration: `many((',' ForBinding))`: one token; takes a mark: it can fail after `','`
Expand All @@ -382,7 +393,7 @@ Per rule: its candidate lists (every key and what decides it), then the inline c
### ForAwaitHead

- ForAwaitHead (2 alternatives):
- `!`, `(`, `+`, `++`, `-`, `--`, `...`, `[` and 2 more: one token: committed to of (#1) (takes a mark: it can fail after `Expr`)
- `!`, `(`, `+`, `++`, `-`, `--`, `...`, `@` and 3 more: one token: committed to of (#1) (takes a mark: it can fail after `Expr`)
- `await`: two tokens: committed to of (#1), unless declaration (#0) admits the token (then the frame) (takes a mark: it can fail after `Expr`)
- `break`, `case`, `catch`, `continue`, `debugger`, `default`, `do`, `else` and 14 more: no candidate, the list fails
- `const`, `let`, `var`: two tokens: committed to declaration (#0)
Expand All @@ -400,7 +411,7 @@ Per rule: its candidate lists (every key and what decides it), then the inline c
### SwitchCase

- SwitchCase (3 alternatives):
- `!`, `(`, `+`, `++`, `-`, `--`, `...`, `;` and 3 more: one token: committed to stmt (#2)
- `!`, `(`, `+`, `++`, `-`, `--`, `...`, `;` and 4 more: one token: committed to stmt (#2)
- `case`: one token: committed to case_ (#0) (takes a mark: it can fail after `'case'`)
- `catch`, `else`, `enum`, `extends`, `finally`, `in`, `instanceof`: no candidate, the list fails
- `default`: two tokens: committed to default_ (#1) (takes a mark: it can fail after `'default'`)
Expand All @@ -412,6 +423,7 @@ Per rule: its candidate lists (every key and what decides it), then the inline c
### Decl

- Decl (11 alternatives):
- `@`: two tokens: committed to decorated (#6) (takes a mark: it can fail after `(DecoratorExpr many(DecoratorExpr))`)
- `async`: two tokens: committed to asyncFunction (#2), unless asyncGenerator (#3) admits the token (then the frame) (takes a mark: it can fail after `'async'`)
- `class`: two tokens: committed to class_ (#4) (takes a mark: it can fail after `'class'`)
- `export`: two tokens: committed to exportDeclaration (#5), unless exportDefault (#7), exportAll (#8), exportNamed (#9) admit the token (then the frame) (takes a mark: it can fail after `'export'`)
Expand All @@ -420,8 +432,8 @@ Per rule: its candidate lists (every key and what decides it), then the inline c
- <Ident>, <HexNumber>, <OctalNumber>, <BinaryNumber>, <BigInt>, <Number>, <LegacyNumber>, <String> and 7 more: no candidate, the list fails
- <Decorator>: two tokens: committed to decorated (#6) (takes a mark: it can fail after `(DecoratorExpr many(DecoratorExpr))`)
- two tokens (pairs): function_ (#0) at `function` only before Ident; generator (#1) at `function` only before '*'; exportDefault (#7) at `export` only before 'default'; exportAll (#8) at `export` only before '*'; exportNamed (#9) at `export` only before '{'
- two tokens (SECOND): function_ (#0) only before Ident; generator (#1) only before '*'; asyncFunction (#2) only before 'function'; asyncGenerator (#3) only before 'function'; class_ (#4) only before Ident; decorated (#6) only before '('|'async'|'class'|'export'|'function'|'import'|…1; exportDefault (#7) only before 'default'; exportAll (#8) only before '*'; exportNamed (#9) only before '{'; importDeclaration (#10) only before '*'|'defer'|'source'|'{'|Ident|String
- longest match: a candidate frame (a mark per new best) at the keys above where an `unless` candidate admits the token, over function_ (#0), generator (#1), asyncFunction (#2), asyncGenerator (#3), exportDeclaration (#5), exportDefault (#7) and 2 more
- two tokens (SECOND): function_ (#0) only before Ident; generator (#1) only before '*'; asyncFunction (#2) only before 'function'; asyncGenerator (#3) only before 'function'; class_ (#4) only before Ident; decorated (#6) only before '('|'.'|'@'|'async'|'class'|'export'|…4; exportDefault (#7) only before 'default'; exportAll (#8) only before '*'; exportNamed (#9) only before '{'; importDeclaration (#10) only before '*'|'defer'|'source'|'{'|Ident|String
- longest match: a candidate frame (a mark per new best) at the keys above where an `unless` candidate admits the token, over function_ (#0), generator (#1), asyncFunction (#2), asyncGenerator (#3), exportDeclaration (#5), decorated (#6) and 3 more
- one token, no mark: 13 inline choices, 7 star, 6 opt, 1 sep
- Decl / function_: `sep(Param, ',')`: by attempt
- Decl / generator: `sep(Param, ',')`: by attempt
Expand Down Expand Up @@ -471,7 +483,7 @@ Per rule: its candidate lists (every key and what decides it), then the inline c
### ClassMember

- ClassMember (3 alternatives):
- `*`, `[`: one token: committed to member (#2)
- `*`, `@`, `[`: one token: committed to member (#2)
- `;`: one token: committed to empty (#0)
- `static`: two tokens: committed to member (#2), unless staticBlock (#1) admits the token (then the frame)
- <Ident>, <HexNumber>, <OctalNumber>, <BinaryNumber>, <BigInt>, <Number>, <LegacyNumber>, <String> and 2 more: one token: committed to member (#2)
Expand Down
Loading
Loading