Grammar coverage: niche form gaps (datatype BNF annotations, nominal_datatype, method for-params, unbundle in-target)#9
Merged
Conversation
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
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes the remaining niche form-level gaps from the coverage report. Four small, independent grammar additions, each with tests.
datatype ('s, dead 'p) t/datatype (dverts: 'a, darcs: 'b) gdt_typespecallowsdead 'aand selector-stylename: 'anominal_datatypenominal_datatype pi = …method … for …method m for x :: "'a" = …for_fixesclause on the method commandunbundle (in target)unbundle (in foo) no bar(in target)qualifierTesting
dt_typespecchange was regression-checked against a corpus sample of realdatatypedeclarations: 0 new regressions.ruff check/ruff format/isortclean.Still out of scope
Binder (
binds) annotations inside nominal-datatype constructors, and the broader inner-syntax / proof long tail.🤖 Generated with Claude Code