Repository navigation
Stop reporting a local as undefined after an abbreviated program option, such as myprog, c(r) for Cache(string) - #390
Merged
Conversation
Contributor
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. Next included review available in 41 minutes. View limit details
|
…on, such as myprog, c(r) for Cache(string) A user program whose syntax has Cache(string) and that c_locals `cache' defines r for `myprog, c(r)`, since Stata takes the leading capitals as the minimum abbreviation. Sight matched only the full name, so it reported `r' as undefined. Program options now match as StataMP 18 does: down to the leading capitals, in full when there are none or all are capitals, and only in lowercase. Co-Authored-By: Claude Opus 5.5 <[email protected]>
jbearak
force-pushed
the
fix/program-option-abbreviations
branch
from
November 5, 2026 21:02
64bd428 to
0b0b5b6
Compare
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.
A user program whose
syntaxhasCache(string)and that runsc_local `cache'definesrin the caller formyprog, c(r), because Stata takes the leading capitals as the minimum abbreviation. Sight matched only the full option name. It then reported`r'as an undefined macro.User-program options now match the way StataMP 18 does:
LOCalacceptsloc,loca,local);cache,CACHE);LOC(r)is rejected).After #387 this is one change in
command_macro_writes. It reuses the case-sensitivematches_optionthat built-ins already use.Proof: probed every rule above on StataMP 18. The new tests in
tests/unit/command-macro-writes.test.tsfail without the fix. An end-to-end test checks that the diagnostic is gone. Typecheck, lint, andbun test ./testspass (9619 tests).Not changed: hover's "Minimum Abbreviation" comes from the parser's
compute_min_abbreviation, which doesn't follow this rule either (it showscfor an all-lowercasecache).Reviewed with sol-loop: 1 round with gpt-6.1-sol. Sol verdict: approved
Created with Claude Opus 5.5 in T3 Code.