FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix(action-grammar): support optional rule references by rioyu123 · Pull Request #2941 · microsoft/TypeAgent · GitHub

fix(action-grammar): support optional rule references - #2941

Open
Rio Yu (rioyu123) wants to merge 1 commit into
microsoft:mainfrom
rioyu123:codex/fix-optional-rule-reference
Open

fix(action-grammar): support optional rule references#2941
Rio Yu (rioyu123) wants to merge 1 commit into
microsoft:mainfrom
rioyu123:codex/fix-optional-rule-reference

Conversation

Copy link
Copy Markdown

Summary

  • parse an adjacent ? after a named rule reference as an optional suffix
  • preserve required references and literal question marks when ? is separated or escaped
  • carry optionality through local, imported, and built-in phrase-set references
  • keep formatter round-trips, source metadata, spacing modes, and grammar docs in sync

Why

<Owner>? was previously compiled as a required <Owner> followed by a literal ? token. That made the optional reference fail to match even though the equivalent inline group worked. The same suffix form is already used by grammars such as <TimeSpec>? and <PanelRef>?.

The suffix is intentionally adjacency-only, matching $(...)? and (...)?, so <Rule> ? remains a required reference followed by literal punctuation.

Validation

  • action grammar build
  • 76 action grammar test suites: 16,188 passed, 2 skipped
  • parser/writer round-trip, NFA/DFA, AST evaluation, and completion regressions
  • Prettier and git diff --check
  • repository policy checks: 9,532 passed
  • code-lint ratchet: no new violations

Fixes #2461

Rio Yu (rioyu123) force-pushed the codex/fix-optional-rule-reference branch from d8720ee to 3ed2154 Compare August 27, 2026 12:59
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

actionGrammar: optional rule-reference <Rule>? silently fails to match (inline optional group works)

1 participant


Back | FazBrowse Home | New Git URL