Skip to content

fix bare <Rule>? grammars to (<Rule>)? + quantifier RFC - #2775

Merged
datduyng merged 5 commits into
mainfrom
domnguyen/agr-optional-group-fix
Jul 31, 2026
Merged

fix bare <Rule>? grammars to (<Rule>)? + quantifier RFC#2775
datduyng merged 5 commits into
mainfrom
domnguyen/agr-optional-group-fix

Conversation

@datduyng

@datduyng datduyng commented Jul 31, 2026

Copy link
Copy Markdown
Contributor
  • Rewrite all bare <Name>? sites in shipping/test .agr files to the supported (<Name>)? form so optional rule refs actually match.

On main, ? after a rule ref is a literal token. Quantifiers only apply after ). Authors wrote <Polite>? meaning optional; those patterns never matched.

On main, postfix ? after a rule reference is a literal token, not a
quantifier. Quantifiers only apply after ")". Authors across email,
weather, video, code, and calendar test grammars wrote <Polite>? /
<TimeSpec>? intending optional — those patterns never matched.

Rewrite all bare <Name>? sites to the supported (<Name>)? form.

Also add a one-pager RFC comparing:
- Design A: keep group-gated quantifiers (this fix)
- Design B: reserved postfix ?/*/+ (direction explored in #2765)
typeagent-bot Bot and others added 3 commits July 31, 2026 17:27
Design doc stays in Obsidian only; this PR is grammar-only.
Only (<Polite>)? needs grouping — authors mean optional polite prefix.

Leave other >? alone:
- ... <PanelRef>?) is the outer group's )? quantifier, not bare optional
- trailing/mid-rule ? may be intentional literal or separate debate
- calendar/display bare refs left untouched
@datduyng
datduyng marked this pull request as ready for review July 31, 2026 18:54
@curtisman

Copy link
Copy Markdown
Member

The description mention an RFC, which is not in this PR, right?

@datduyng
datduyng added this pull request to the merge queue Jul 31, 2026
Merged via the queue into main with commit b3a378f Jul 31, 2026
27 checks passed
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.

2 participants