Skip to content

Grammar coverage: niche form gaps (datatype BNF annotations, nominal_datatype, method for-params, unbundle in-target)#9

Merged
christiankissig merged 4 commits into
masterfrom
niche-form-gaps
Jun 3, 2026
Merged

Grammar coverage: niche form gaps (datatype BNF annotations, nominal_datatype, method for-params, unbundle in-target)#9
christiankissig merged 4 commits into
masterfrom
niche-form-gaps

Conversation

@christiankissig

Copy link
Copy Markdown
Owner

Summary

Closes the remaining niche form-level gaps from the coverage report. Four small, independent grammar additions, each with tests.

Fix Was failing Now
datatype BNF type-arg annotations datatype ('s, dead 'p) t / datatype (dverts: 'a, darcs: 'b) g new dt_typespec allows dead 'a and selector-style name: 'a
nominal_datatype nominal_datatype pi = … accepted through the datatype rule (binder annotations still out of scope)
method … for … method m for x :: "'a" = … optional for_fixes clause on the method command
unbundle (in target) unbundle (in foo) no bar optional (in target) qualifier

Testing

  • Full unit suite: 147 passed (135 → +12 across the last two PRs; 6 new here), no regressions.
  • The datatype dt_typespec change was regression-checked against a corpus sample of real datatype declarations: 0 new regressions.
  • ruff check / ruff format / isort clean.

Still out of scope

Binder (binds) annotations inside nominal-datatype constructors, and the broader inner-syntax / proof long tail.

🤖 Generated with Claude Code

christiankissig and others added 4 commits June 2, 2026 21:45
datatype type arguments could be plain or sort-annotated type variables,
but not the BNF annotations `dead 'a` (dead variable) or selector-style
`name: 'a` (set-function name), e.g.
`datatype ('s, dead 'p) t` / `datatype (dverts: 'a, darcs: 'b) graph`.
Introduce a datatype-specific `dt_typespec` that allows these.

Regression-checked against a corpus sample of real datatype declarations:
0 new regressions. Full unit suite green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
`nominal_datatype` (Nominal2 entries) has the same outer shape as
`datatype`, so accept it through the same rule. Binder annotations in
constructors remain out of scope, but plain nominal datatypes now parse.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The `method` definition command can bind parameters, e.g.
`method m for x :: "'a" and y = ...`. Allow an optional `for_fixes`
clause between the method name and `=`.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
`unbundle` could only take a list of bundle names; the optional
`(in target)` qualifier (e.g. `unbundle (in foo) no bar`) was rejected.
Allow it before the bundle list.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@christiankissig christiankissig merged commit c986488 into master Jun 3, 2026
6 checks passed
@christiankissig christiankissig deleted the niche-form-gaps branch June 3, 2026 07:57
christiankissig added a commit that referenced this pull request Jul 7, 2026
Grammar coverage: niche form gaps (datatype BNF annotations, nominal_datatype, method for-params, unbundle in-target)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant