---
generated: true
model: claude-fable-5
generated_at: 2026-07-08T15:43:29Z
source_commit: 196bcf98f30aef1230ca33a5bada98c48c9cb7fb
watched_paths_digest: e140594fcaabe3c5ecc7f5814554826536a7e971ba6f8c81768926570634f2cb
source_doc: docs/generated/design/syntax-reference/grammar.md
source_doc_digest: 1ac39a3aa10e2afc1aff2f29719b13ca1bb170cae4a1be801c5b9af73071a713
warning: "Auto-generated. May drift from source. Do not edit by hand."
---

# Tests for syntax-reference/grammar

## Intent

Tests verify the surface-grammar productions described in
[`docs/generated/design/syntax-reference/grammar.md`](../../../design/syntax-reference/grammar.md):
top-level/module structure, declaration / expression / statement /
type / generic / modifier productions, the precedence ladder (now
including `is` / `as` at level 6), the literal-forms subsection, the
repeated-keyword where-clause shape with its pack / coercion terms,
and the `<` disambiguation fork. Most tests are `pipeline_stage=parse`
and use `//TEST:INTERPRET` so the production shape is observed
end-to-end on the interpreter without a GPU; claims involving
exceptions (`throws` / `do ... catch`), existential `is` / `as`,
pointers, and `Optional` use `//TEST:COMPARE_COMPUTE ... -cpu` because
those features are unreliable or unsupported under INTERPRET. Four
negative tests use `//DIAGNOSTIC_TEST:SIMPLE` to assert parse-stage
rejection with a pinned E-code.

This bundle is intentionally disjoint from
[`syntax-reference/tokens`](../tokens/) (which is lexer-level) and
from `pipeline/02-parse-ast` (which is parser-stage internal
behavior). The angle here is **production-shape**: which strings the
grammar names, and in what shape they parse.

## Functional coverage

| Claim                                                                                                                        | Intent     | Anchor                                                                                                          | Tests                                                                                          |
| ------------------------------------------------------------------------------------------------------------------------------ | ---------- | ----------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
| `Attribute` parses as `'[' AttributeName ('(' ArgList? ')')? ']'` and attaches to the following decl.                       | functional | [#attributes-and-decorations](../../../design/syntax-reference/grammar.md#attributes-and-decorations)           | [`attribute-bracket-form.slang`](attribute-bracket-form.slang)                                 |
| A token that cannot begin a `Decl` triggers a parse-stage diagnostic.                                                        | negative   | [#declarations](../../../design/syntax-reference/grammar.md#declarations)                                       | [`decl-unexpected-token-rejected.slang`](decl-unexpected-token-rejected.slang)                 |
| `<` in a body context where the preceding expression does not resolve to a generic parses as the comparison operator.        | functional | [#disambiguation](../../../design/syntax-reference/grammar.md#disambiguation)                                   | [`less-than-in-body-parses-as-comparison.slang`](less-than-in-body-parses-as-comparison.slang) |
| `<` is treated as a generic-argument list when followed by `>` and a "generic-follower" token like `(`.                      | functional | [#disambiguation](../../../design/syntax-reference/grammar.md#disambiguation)                                   | [`generic-call-followed-by-paren.slang`](generic-call-followed-by-paren.slang)                 |
| A parenthesized expression atom requires a matching `)`; a missing close-paren is rejected.                                  | negative   | [#expressions](../../../design/syntax-reference/grammar.md#expressions)                                         | [`expr-missing-close-paren-rejected.slang`](expr-missing-close-paren-rejected.slang)           |
| `as` is an infix operator at relational level 6 whose right operand is parsed as a Type (AsTypeExpr).                        | functional | [#expressions](../../../design/syntax-reference/grammar.md#expressions)                                         | [`expr-as-type-operator.slang`](expr-as-type-operator.slang)                                   |
| Assignment `=` (level 14) is right-associative; `a = b = 5` parses as `a = (b = 5)`.                                         | functional | [#expressions](../../../design/syntax-reference/grammar.md#expressions)                                         | [`expr-assign-right-associative.slang`](expr-assign-right-associative.slang)                   |
| `is` is an infix operator at relational level 6 whose right operand is a Type, binding tighter than `==` (level 7).          | functional | [#expressions](../../../design/syntax-reference/grammar.md#expressions)                                         | [`expr-is-type-relational.slang`](expr-is-type-relational.slang)                               |
| Precedence: `&&` (level 11) binds tighter than `\|\|` (level 12).                                                            | functional | [#expressions](../../../design/syntax-reference/grammar.md#expressions)                                         | [`expr-logical-and-tighter-than-or.slang`](expr-logical-and-tighter-than-or.slang)             |
| Precedence: `*` (level 3) binds tighter than `+` (level 4).                                                                  | functional | [#expressions](../../../design/syntax-reference/grammar.md#expressions)                                         | [`expr-mul-binds-tighter-than-add.slang`](expr-mul-binds-tighter-than-add.slang)               |
| Precedence: unary `-` (level 2) binds tighter than `*` (level 3).                                                            | functional | [#expressions](../../../design/syntax-reference/grammar.md#expressions)                                         | [`expr-unary-minus-tighter-than-mul.slang`](expr-unary-minus-tighter-than-mul.slang)           |
| Ternary `?:` (level 13) is right-associative; `c1 ? a : c2 ? b : c` parses as `c1 ? a : (c2 ? b : c)`.                       | functional | [#expressions](../../../design/syntax-reference/grammar.md#expressions)                                         | [`expr-ternary-right-associative.slang`](expr-ternary-right-associative.slang)                 |
| `AtomExpr` accepts a parenthesized expression `'(' Expr ')'` and the parens override precedence.                             | functional | [#expressions](../../../design/syntax-reference/grammar.md#expressions)                                         | [`expr-paren-atom.slang`](expr-paren-atom.slang)                                               |
| `KeywordExpr` accepts `'sizeof' '(' Type ')'`.                                                                               | functional | [#expressions](../../../design/syntax-reference/grammar.md#expressions)                                         | [`expr-sizeof-keyword.slang`](expr-sizeof-keyword.slang)                                       |
| `PostfixSuffix` accepts `'.' IDENT` member access, binding tighter than arithmetic.                                          | functional | [#expressions](../../../design/syntax-reference/grammar.md#expressions)                                         | [`expr-postfix-member-access.slang`](expr-postfix-member-access.slang)                         |
| `AccessorName` is limited to `'get' \| 'set' \| 'ref'`; any other accessor name is diagnosed.                                | negative   | [#function-style-declarations](../../../design/syntax-reference/grammar.md#function-style-declarations)         | [`decl-property-accessor-name-rejected.slang`](decl-property-accessor-name-rejected.slang)     |
| `FuncDecl` accepts a `('throws' Type)?` clause between the parameter list and the `->` result type.                          | functional | [#function-style-declarations](../../../design/syntax-reference/grammar.md#function-style-declarations)         | [`decl-func-throws-clause.slang`](decl-func-throws-clause.slang)                               |
| `FuncDecl` in `func` form takes its result type via `('->' Type)?` after the parameter list.                                 | functional | [#function-style-declarations](../../../design/syntax-reference/grammar.md#function-style-declarations)         | [`decl-func-arrow-return.slang`](decl-func-arrow-return.slang)                                 |
| `Param` accepts the modern name-first form `IDENT ':' Type ('=' Expr)?` with a default-value clause.                         | functional | [#function-style-declarations](../../../design/syntax-reference/grammar.md#function-style-declarations)         | [`decl-func-modern-param-default.slang`](decl-func-modern-param-default.slang)                 |
| `Param` parses with an optional `'=' Expr` default-value clause.                                                             | functional | [#function-style-declarations](../../../design/syntax-reference/grammar.md#function-style-declarations)         | [`decl-func-with-default-param.slang`](decl-func-with-default-param.slang)                     |
| `SubscriptDecl` accepts inline generic params and a `WhereClause` between the `'->' Type` and the accessor block.            | functional | [#function-style-declarations](../../../design/syntax-reference/grammar.md#function-style-declarations)         | [`decl-subscript-generic-where.slang`](decl-subscript-generic-where.slang)                     |
| A conformance `WhereTerm` may list several supertypes after one colon: `Type ':' Type (',' Type)*`.                          | functional | [#generics-and-where-clauses](../../../design/syntax-reference/grammar.md#generics-and-where-clauses)           | [`where-clause-conformance-type-list.slang`](where-clause-conformance-type-list.slang)         |
| `GenericParam` accepts the type-parameter form `IDENT ':' TypeList`.                                                         | functional | [#generics-and-where-clauses](../../../design/syntax-reference/grammar.md#generics-and-where-clauses)           | [`generic-type-param-with-constraint.slang`](generic-type-param-with-constraint.slang)         |
| `WhereClause ::= ('where' WhereTerm)+` — each `where` keyword introduces exactly one term; several constraints repeat the keyword. | functional | [#generics-and-where-clauses](../../../design/syntax-reference/grammar.md#generics-and-where-clauses)     | [`where-clause-repeated-keyword.slang`](where-clause-repeated-keyword.slang)                   |
| `WhereClause` parses as `('where' WhereTerm)+` with the conformance form `Type ':' Type` as a single term.                   | functional | [#generics-and-where-clauses](../../../design/syntax-reference/grammar.md#generics-and-where-clauses)           | [`where-clause-conformance.slang`](where-clause-conformance.slang)                             |
| `WhereTerm` accepts the non-empty pack constraint `'nonempty' '(' Expr ')'` on a variadic `each` parameter.                  | functional | [#generics-and-where-clauses](../../../design/syntax-reference/grammar.md#generics-and-where-clauses)           | [`where-clause-nonempty-pack.slang`](where-clause-nonempty-pack.slang)                         |
| `WhereTerm` accepts the oriented pack-count constraint `'countof' '(' Expr ')' '==' Expr`.                                   | functional | [#generics-and-where-clauses](../../../design/syntax-reference/grammar.md#generics-and-where-clauses)           | [`where-clause-countof-pack.slang`](where-clause-countof-pack.slang)                           |
| `WhereTerm` accepts the type-coercion constraint `Type '(' Type ')' 'implicit'?` (toType '(' fromType ')').                  | functional | [#generics-and-where-clauses](../../../design/syntax-reference/grammar.md#generics-and-where-clauses)           | [`where-clause-type-coercion.slang`](where-clause-type-coercion.slang)                         |
| `CHAR_LIT` is a `Literal` that lowers to an `IntegerLiteralExpr` rather than a dedicated character node.                     | functional | [#literal-forms-vs-token-kinds](../../../design/syntax-reference/grammar.md#literal-forms-vs-token-kinds)       | [`expr-char-literal-integer-value.slang`](expr-char-literal-integer-value.slang)               |
| `none` is recognized as a `Literal` atom (NoneLiteralExpr) usable to initialize an Optional value.                           | functional | [#literal-forms-vs-token-kinds](../../../design/syntax-reference/grammar.md#literal-forms-vs-token-kinds)       | [`expr-literal-none-optional.slang`](expr-literal-none-optional.slang)                         |
| `nullptr` is recognized as a `Literal` atom (NullPtrLiteralExpr) usable to initialize and compare a pointer.                 | functional | [#literal-forms-vs-token-kinds](../../../design/syntax-reference/grammar.md#literal-forms-vs-token-kinds)       | [`expr-literal-nullptr.slang`](expr-literal-nullptr.slang)                                     |
| `true` and `false` are recognized as `Literal` atoms (BoolLiteralExpr) despite lexing as identifiers.                        | functional | [#literal-forms-vs-token-kinds](../../../design/syntax-reference/grammar.md#literal-forms-vs-token-kinds)       | [`expr-literal-bool.slang`](expr-literal-bool.slang)                                           |
| `ModifierKeyword` includes `inout`, which attaches to a `Param`.                                                             | functional | [#modifiers](../../../design/syntax-reference/grammar.md#modifiers)                                             | [`modifier-inout-param.slang`](modifier-inout-param.slang)                                     |
| `ModifierList` accepts multiple `ModifierKeyword` tokens (`static`, `const`) in sequence before a `VarDecl`.                 | functional | [#modifiers](../../../design/syntax-reference/grammar.md#modifiers)                                             | [`modifier-static-const.slang`](modifier-static-const.slang)                                   |
| `BreakStmt` and `ContinueStmt` parse as bare keyword forms (no label) terminating with `;`.                                  | functional | [#statements](../../../design/syntax-reference/grammar.md#statements)                                           | [`stmt-break-continue.slang`](stmt-break-continue.slang)                                       |
| `ContinueStmt` parses as `'continue' ';'` with no optional label, unlike `BreakStmt`; a labeled continue is rejected.        | negative   | [#statements](../../../design/syntax-reference/grammar.md#statements)                                           | [`stmt-continue-label-rejected.slang`](stmt-continue-label-rejected.slang)                     |
| `DoCatchStmt` accepts an omitted catch parameter: `'do' Stmt 'catch' Stmt` with no `'(' Param ')'`.                          | boundary   | [#statements](../../../design/syntax-reference/grammar.md#statements)                                           | [`stmt-do-catch-no-param.slang`](stmt-do-catch-no-param.slang)                                 |
| `DoCatchStmt` parses as `'do' Stmt 'catch' '(' Param ')' Stmt` with an explicit catch parameter.                             | functional | [#statements](../../../design/syntax-reference/grammar.md#statements)                                           | [`stmt-do-catch-with-param.slang`](stmt-do-catch-with-param.slang)                             |
| `DoCatchStmt`'s handler is a general `Stmt`, not only a `Block`; a single expression statement is accepted.                  | boundary   | [#statements](../../../design/syntax-reference/grammar.md#statements)                                           | [`stmt-do-catch-nonblock-handler.slang`](stmt-do-catch-nonblock-handler.slang)                 |
| `DoWhileStmt` parses as `'do' Stmt 'while' '(' Expr ')' ';'`.                                                                | functional | [#statements](../../../design/syntax-reference/grammar.md#statements)                                           | [`stmt-do-while.slang`](stmt-do-while.slang)                                                   |
| `ForStmt` parses with `DeclStmt` init, `Expr` condition, and `Expr` increment.                                               | functional | [#statements](../../../design/syntax-reference/grammar.md#statements)                                           | [`stmt-for-loop.slang`](stmt-for-loop.slang)                                                   |
| `IfStmt` parses as `'if' '(' Expr ')' Stmt ('else' Stmt)?`.                                                                  | functional | [#statements](../../../design/syntax-reference/grammar.md#statements)                                           | [`stmt-if-else.slang`](stmt-if-else.slang)                                                     |
| `ReturnStmt` parses as `'return' Expr? ';'` and yields the expression value.                                                 | functional | [#statements](../../../design/syntax-reference/grammar.md#statements)                                           | [`stmt-return-expr.slang`](stmt-return-expr.slang)                                             |
| `SwitchStmt` parses with `SwitchCase` arms — `'case' Expr ':'` and `'default' ':'`.                                          | functional | [#statements](../../../design/syntax-reference/grammar.md#statements)                                           | [`stmt-switch-case-default.slang`](stmt-switch-case-default.slang)                             |
| `ThrowStmt` parses as `'throw' Expr` without consuming a trailing `';'`.                                                     | boundary   | [#statements](../../../design/syntax-reference/grammar.md#statements)                                           | [`stmt-throw-no-semicolon.slang`](stmt-throw-no-semicolon.slang)                               |
| `WhileStmt` parses as `'while' '(' Expr ')' Stmt`.                                                                           | functional | [#statements](../../../design/syntax-reference/grammar.md#statements)                                           | [`stmt-while-loop.slang`](stmt-while-loop.slang)                                               |
| `ModuleHeader` accepts `'module' ';'` with the name omitted, falling back to the current module name.                        | boundary   | [#top-level-structure](../../../design/syntax-reference/grammar.md#top-level-structure)                         | [`module-header-optional-name.slang`](module-header-optional-name.slang)                       |
| `ModuleName` accepts a `STRING_LIT` alternative in a `module` header.                                                        | functional | [#top-level-structure](../../../design/syntax-reference/grammar.md#top-level-structure)                         | [`module-name-string-literal.slang`](module-name-string-literal.slang)                         |
| `NamespaceDecl` accepts a nested chain `IDENT (('.' \| '::') IDENT)*` before the brace body.                                 | functional | [#top-level-structure](../../../design/syntax-reference/grammar.md#top-level-structure)                         | [`decl-namespace-nested-chain.slang`](decl-namespace-nested-chain.slang)                       |
| `NamespaceDecl` parses as `'namespace' IDENT '{' TopDecl* '}'` and qualifies names via `::`.                                 | functional | [#top-level-structure](../../../design/syntax-reference/grammar.md#top-level-structure)                         | [`decl-namespace.slang`](decl-namespace.slang)                                                 |
| `UsingDecl` parses as `'using' 'namespace'? Expr ';'`, with the optional `namespace` keyword accepted.                       | functional | [#top-level-structure](../../../design/syntax-reference/grammar.md#top-level-structure)                         | [`decl-using-namespace.slang`](decl-using-namespace.slang)                                     |
| `AssocTypeDecl` accepts a trailing `WhereClause` before `';'`, equivalent to the `':' TypeList` bound.                       | functional | [#type-defining-declarations](../../../design/syntax-reference/grammar.md#type-defining-declarations)           | [`decl-assoctype-where-clause.slang`](decl-assoctype-where-clause.slang)                       |
| `EnumDecl` parses `'enum' IDENT '{' EnumCase (',' EnumCase)* ','? '}'` with an optional trailing comma.                      | functional | [#type-defining-declarations](../../../design/syntax-reference/grammar.md#type-defining-declarations)           | [`decl-enum-with-cases.slang`](decl-enum-with-cases.slang)                                     |
| `ExtensionDecl` parses as `'extension' Type '{' StructMember* '}'` and adds methods to an existing type.                     | functional | [#type-defining-declarations](../../../design/syntax-reference/grammar.md#type-defining-declarations)           | [`decl-extension.slang`](decl-extension.slang)                                                 |
| `InterfaceConstraintDecl` parses as `'__constraint' Type '==' Type ';'` inside an interface body (equality constraint).      | functional | [#type-defining-declarations](../../../design/syntax-reference/grammar.md#type-defining-declarations)           | [`decl-interface-constraint-equality.slang`](decl-interface-constraint-equality.slang)         |
| `InterfaceConstraintDecl` parses as `'__constraint' Type ':' Type ';'` inside an interface body (subtype constraint).        | functional | [#type-defining-declarations](../../../design/syntax-reference/grammar.md#type-defining-declarations)           | [`decl-interface-constraint-subtype.slang`](decl-interface-constraint-subtype.slang)           |
| `InterfaceDecl` parses as `'interface' IDENT '{' InterfaceMember* '}'` and accepts a FuncDecl member.                        | functional | [#type-defining-declarations](../../../design/syntax-reference/grammar.md#type-defining-declarations)           | [`decl-interface-method.slang`](decl-interface-method.slang)                                   |
| `StructDecl` parses as `'struct' IDENT '{' '}'` with an empty member list.                                                   | functional | [#type-defining-declarations](../../../design/syntax-reference/grammar.md#type-defining-declarations)           | [`decl-struct-empty.slang`](decl-struct-empty.slang)                                           |
| `StructMember` accepts `VarDecl` members produced by `Type IDENT` C-style declarators.                                       | functional | [#type-defining-declarations](../../../design/syntax-reference/grammar.md#type-defining-declarations)           | [`decl-struct-with-fields.slang`](decl-struct-with-fields.slang)                               |
| `TypeAliasDecl` parses as `'typealias' IDENT '=' Type ';'`.                                                                  | functional | [#type-defining-declarations](../../../design/syntax-reference/grammar.md#type-defining-declarations)           | [`decl-typealias.slang`](decl-typealias.slang)                                                 |
| `TypedefDecl` parses as `'typedef' Type Declarator ';'` (C-style order: type before the alias declarator).                   | functional | [#type-defining-declarations](../../../design/syntax-reference/grammar.md#type-defining-declarations)           | [`decl-typedef.slang`](decl-typedef.slang)                                                     |
| `CoreType` accepts the array form `Type '[' Expr ']'`.                                                                       | functional | [#types](../../../design/syntax-reference/grammar.md#types)                                                     | [`type-array-suffix.slang`](type-array-suffix.slang)                                           |
| `CoreType` accepts the function-type spelling `'functype' '(' Type (',' Type)* ')' '->' Type`.                               | functional | [#types](../../../design/syntax-reference/grammar.md#types)                                                     | [`type-functype-keyword.slang`](type-functype-keyword.slang)                                   |
| `CoreType` accepts the pointer suffix `Type '*'` (pointer-to-T via parsePostfixTypeSuffix).                                  | functional | [#types](../../../design/syntax-reference/grammar.md#types)                                                     | [`type-pointer-suffix.slang`](type-pointer-suffix.slang)                                       |
| `Declarator` folds a prefix `'*'` onto a `typedef` alias type, so `typedef int* IntPtr;` parses.                             | functional | [#variable-binding-declarations](../../../design/syntax-reference/grammar.md#variable-binding-declarations)     | [`decl-typedef-pointer-prefix.slang`](decl-typedef-pointer-prefix.slang)                       |
| `Declarator` folds a trailing `ArraySuffix` onto a `typedef` alias type, so `typedef int Pair[2];` parses.                   | functional | [#variable-binding-declarations](../../../design/syntax-reference/grammar.md#variable-binding-declarations)     | [`decl-typedef-array-suffix.slang`](decl-typedef-array-suffix.slang)                           |
| `LetDecl` parses as `'let' IDENT (':' Type)? '=' Expr ';'` with a mandatory initializer.                                     | functional | [#variable-binding-declarations](../../../design/syntax-reference/grammar.md#variable-binding-declarations)     | [`decl-let.slang`](decl-let.slang)                                                             |
| `VarDecl` accepts the C-style form `Type VarDeclarator (',' VarDeclarator)* ';'` with an `Initializer`.                      | functional | [#variable-binding-declarations](../../../design/syntax-reference/grammar.md#variable-binding-declarations)     | [`decl-var-cstyle-with-init.slang`](decl-var-cstyle-with-init.slang)                           |
| `VarDeclarator` accepts an `ArraySuffix` of the form `'[' Expr ']'`.                                                         | functional | [#variable-binding-declarations](../../../design/syntax-reference/grammar.md#variable-binding-declarations)     | [`decl-var-array-suffix.slang`](decl-var-array-suffix.slang)                                   |

## Untested claims

| Claim                                                                                                                                                              | Reason                | Anchor                                                                                                    | Why untested                                                                                                                                                                       |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------- | ------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `InternalDecl` registers compiler-internal declaration keywords (`__associatedfunc`, `type_param`, `__generic_value_param`, `semantic`, `__ignored_block`, `__transparent_block`) in the same dispatch table. | internal-source-fact  | [#declarations](../../../design/syntax-reference/grammar.md#declarations)                                 | These forms have no documented user-level semantics or example; the doc lists them only as dispatch-table entries.                                                                 |
| `KeywordExpr` includes `'__apply' '(' Expr ')'` (apply-for-backward, experimental).                                                                                | internal-source-fact  | [#expressions](../../../design/syntax-reference/grammar.md#expressions)                                   | An experimental autodiff-internal form; the doc gives no complete example or observable behavior to anchor an expectation to.                                                      |
| `FuncExtensionDecl` parses as `'__func_extension' GenericParams? KeywordExprHead '(' ParamList? ')' ...`, gated behind `-experimental-feature`.                    | (unclassified)        | [#function-style-declarations](../../../design/syntax-reference/grammar.md#function-style-declarations)   | The doc names the production and the gate flag but gives no complete valid declaration; a runnable expectation cannot be built without guessing. See the doc-gap row.              |
| Modern `Param` allows an omitted `':' Type` (`ModifierList? IDENT (':' Type)? ('=' Expr)?`).                                                                       | (unclassified)        | [#function-style-declarations](../../../design/syntax-reference/grammar.md#function-style-declarations)   | The parse grammar admits an untyped named parameter but the doc does not say whether checked code accepts it, so a test cannot pick an expectation. See the doc-gap row.           |
| A leading `optional` modifier is accepted on every `WhereTerm` except `__hasDiffTypeInfo`.                                                                         | (unclassified)        | [#generics-and-where-clauses](../../../design/syntax-reference/grammar.md#generics-and-where-clauses)     | Parse acceptance is documented, but no checked-code example of a valid optional-constrained generic exists in the doc; a compiling test would require guessing semantics.          |
| `WhereTerm` accepts `'__hasDiffTypeInfo' '(' Type ')'` (differentiable-type-info constraint).                                                                      | internal-source-fact  | [#generics-and-where-clauses](../../../design/syntax-reference/grammar.md#generics-and-where-clauses)     | Described as a compiler-internal differentiability constraint with no user-level example.                                                                                          |
| The reversed spelling `N == countof(Pack)` is recognized only to emit a targeted diagnostic.                                                                       | (unclassified)        | [#generics-and-where-clauses](../../../design/syntax-reference/grammar.md#generics-and-where-clauses)     | A `DIAGNOSTIC_TEST` must pin the E-code, but the doc does not name the diagnostic's code or message. See the doc-gap row.                                                          |
| `ImportPath` accepts a `STRING_LIT` alternative (and dotted identifiers) in `import` / `__include`.                                                                | needs-multi-file-test | [#top-level-structure](../../../design/syntax-reference/grammar.md#top-level-structure)                   | Observing an import requires a companion module file; this bundle is single-file. A multi-file test importing via `import "name"` would verify it.                                |

## Doc gaps observed

| Anchor                                                                                                    | Kind                  | Gap                                                                                                                                                                                                                                                                                                                                                       | Suggested addition                                                                                                                       |
| ------------------------------------------------------------------------------------------------------------ | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------- |
| [#top-level-structure](../../../design/syntax-reference/grammar.md#top-level-structure)                  | drift-from-source     | The `ModuleName ::= IDENT ('.' IDENT)* \| STRING_LIT` production claims a `module` header accepts a dotted identifier chain, but `module a.b.c;` is rejected at parse time with E20001 (`unexpected '.', expected ';'`). A single identifier and the `STRING_LIT` form both parse; the dotted form is only accepted where a module/file *reference* is expected (e.g. `__include dir.name;`), not as the declared module name.                                                                                            | Split `ModuleName` into a declared-name production (`IDENT \| STRING_LIT`) for `module` headers and a dotted module-reference production for `__include`/`implementing`.                                                                 |
| [#declarations](../../../design/syntax-reference/grammar.md#declarations)                                 | missing-example       | `FuncExtensionDecl` is documented as `'__func_extension' ... gated behind -experimental-feature` with `KeywordExprHead` forms like `fwd_diff(foo)`, but no complete valid declaration is shown, so a test cannot be anchored without guessing the surrounding requirements.                                                                              | Add a minimal compiling `__func_extension` example, including the exact CLI flag spelling it requires.                                   |
| [#disambiguation](../../../design/syntax-reference/grammar.md#disambiguation)                             | undocumented-behavior | The `### `<` disambiguation` section lists the "generic-followers" punctuation set (`::`, `.`, `(`, `)`, `[`, `]`, `:`, `,`, `?`, `;`, `==`, `!=`, `>`, `>>`) but does not give a positive example for each follower individually. A claim-per-follower expansion would need either an enumerative example or a follower-specific sub-anchor in the doc. | Add one worked example per follower token, or an explicit note that the set is exercised uniformly.                                      |
| [#expressions](../../../design/syntax-reference/grammar.md#expressions)                                   | undocumented-behavior | The doc lists `LambdaExpr ::= '(' ParamList? ')' '=>' Expr` and the single-parameter form `IDENT '=>' Expr`, but lambda direct-invocation fails under INTERPRET, which precludes the simplest positive test. A separate IFunc-constrained idiom would be needed and is better anchored to the lambda feature doc, not this grammar bundle.               |                                                                                                                                          |
| [#expressions](../../../design/syntax-reference/grammar.md#expressions)                                   | undocumented-behavior | The `## Expressions` section lists `AtomExpr ::= ... \| '(' Expr (',' Expr)+ ')' -- tuple` but in practice this surface is parsed as comma-operator expressions, not a tuple literal. The actual user-facing tuple construction uses `makeTuple(...)` or an explicit `Tuple<...>` type.                                                                  | The doc should either narrow the production (e.g. "only after a tuple-typed binding context") or remove the standalone tuple-atom form. |
| [#function-style-declarations](../../../design/syntax-reference/grammar.md#function-style-declarations)   | ambiguous-claim       | The modern `Param` production marks `':' Type` optional, but the doc does not say whether an untyped named parameter survives checking or which diagnostic rejects it, so a test cannot anchor an expectation to it.                                                                                                                                      | State whether `func f(x) {...}` is checked-valid; if not, name the rejecting diagnostic code.                                            |
| [#generics-and-where-clauses](../../../design/syntax-reference/grammar.md#generics-and-where-clauses)     | missing-example       | The note says the reversed `N == countof(Pack)` spelling "is recognized only to emit a targeted diagnostic" but does not name the diagnostic code or message, so a `DIAGNOSTIC_TEST` cannot pin it.                                                                                                                                                       | Name the diagnostic ID (E-code) and message text for the reversed-countof case.                                                          |
| [#generics-and-where-clauses](../../../design/syntax-reference/grammar.md#generics-and-where-clauses)     | missing-example       | A leading `optional` modifier is said to be accepted on every `WhereTerm` except `__hasDiffTypeInfo`, but no compiling example of an optional-constrained generic is given, and what makes such code valid at check time is not described.                                                                                                                | Add a minimal compiling example of `where optional T : IFoo` and note what check-time consumers accept it.                               |
| [#modifiers](../../../design/syntax-reference/grammar.md#modifiers)                                       | undocumented-behavior | The `## Modifiers` section lists ~50 modifier keywords as one alternative in `ModifierKeyword` without per-modifier syntactic notes; only the production "a modifier list precedes a decl" is a grammar claim. Individual modifier semantics belong to `ast-reference/modifiers.md` or the semantic-check bundle.                                         |                                                                                                                                          |
| [#statements](../../../design/syntax-reference/grammar.md#statements)                                     | missing-surface       | `BreakStmt ::= 'break' IDENT? ';'` admits an optional label, but no production in the doc defines how a label is declared on a loop or statement, so the labeled form cannot be exercised from this grammar alone.                                                                                                                                        | Add the labeled-statement production (or a note naming where loop labels are declared) next to `BreakStmt`.                              |

