feat(action-grammar): treat ?/*/+ as special quantifier chars - #2789
Draft
datduyng wants to merge 6 commits into
Draft
feat(action-grammar): treat ?/*/+ as special quantifier chars#2789datduyng wants to merge 6 commits into
datduyng wants to merge 6 commits into
Conversation
- Postfix ?/*/+ are quantifiers only after ")" or ">" - Bare ?/*/+ are parse errors; literals require \? / \* / \+ - <Name>?/*/+ parse as optional/repeat (equiv. to grouped form) - Writer/prettier prefers (<Name>)? over bare <Name>? - Colon stays unescaped (no ambiguity outside $()) - Quotes remain literal match chars (not string syntax) - Corpus + sample.agr + fuzz/generator escapes updated - Tests cover CurtisM proposal cases and match semantics
- Prettier: lock bare <Name>?/*/+ → (<Name>)?/*/+ rewrite (writer + grammar-tools format) - Generator prompts: fix \\? so runtime teaches real escapes (not bare ?) - Sync agentSdkWrapper schema→grammar prompt with quantifier rules - Capture $(x)*/$(x)+: actionable error pointing at ($(x))+ form - Phrase-set wrap inherits parent spacingMode (bare ≡ grouped lowering) - Docs/tests: silent <Song>? pitfall, import *, value ?. / ??, CORRECT-line guards
- Match standalone \? on NFA/DFA by peeling trailing sentence punct - Grammar matcher: expand PhraseSetPart so bare <Polite>? works - Wire grammarStore DFA path with request context for punct peel - Extension schema→grammar prompts teach quantifier specials - scenarioBasedGenerator: escape ?/*/+ in shared verb categories - Expand quantifierSpecialChars NFA/DFA + prompt runtime guards
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
Make
?/*/+true special characters in AGR pattern expressions (CurtisM proposal).)or>\?\*\+<Name>?→(<Name>)?(same meaning, clearer):$())"…"/'…'->?ternary,?.,??still work)Before → After (realistic)
1) Question utterance — trailing
?is punctuationIntent: match the spoken request
what is the time?2) Required song name + real question mark
Intent:
who sings song Hello?(song name required)3) Optional song name + real question mark
Intent: both
who sings song?andwho sings song Hello?Silent pitfall (document + tests lock this):
4) Optional polite prefix (how authors already write grammars)
5) Groups and captures (unchanged shapes)
6) Full realistic start-rule sketch
After prettier /
writeGrammarRules/ LSP format:7) Unchanged on purpose