Simplify grammar rule variable reference syntax from $(varName) to bare identifiers#1939
Merged
curtisman merged 2 commits intomicrosoft:mainfrom Feb 21, 2026
Merged
Simplify grammar rule variable reference syntax from $(varName) to bare identifiers#1939curtisman merged 2 commits intomicrosoft:mainfrom
curtisman merged 2 commits intomicrosoft:mainfrom
Conversation
…ifiers Replace the \$(varName) wrapper syntax for variable references in action body value positions with plain bare identifiers. Pattern capture groups still use \$(name:Type), but references to those variables in the action body now use just the identifier name directly. Updates parser, writer, all .agr schema files, examples, and tests accordingly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
steveluc
added a commit
that referenced
this pull request
Feb 21, 2026
) and fix package.json sort order - grammarGenerator.ts: Update system prompt examples and RuleRHS comments to use bare variable identifiers in action body value positions (e.g., "trackName" not "$(trackName)", "[artist]" not "[$(artist)]") to match the syntax change from PR #1939 - schemaToGrammarGenerator.ts: Update TimeSpec example from "-> $(t)" to "-> t" - packages/agents/code/package.json: Fix sort order per npm-package-sort-metadata policy - packages/commandExecutor/package.json: Fix sort order per npm-package-sort-metadata policy All 17 grammar test suites pass (352 tests). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
$(varName)syntax in action body value positions with bare identifier syntax (varName). Rule expression still use$(name:Type), but references to those variables in the action body no longer require the$()wrapper.grammarRuleParser.tsnow parses bare identifiers as variable references in value positions (instead of$(...)tokens), andgrammarRuleWriter.tsserializes them without the wrapper..agrfiles: All schema files (calendarSchema.agr,desktopSchema.agr,playerSchema.agr,listSchema.agr,browserSchema.agr, etc.) and examples updated to use the new syntax.abc123→1abc).🤖 Generated with Claude Code