Repository navigation
Read syntax [, saveAs(string)] as defining saveAs', not saveas' - #392
Merged
Merged
Conversation
Stata lowercases only a syntax option's leading capitals: saveAs(string) and MyOption define `saveAs' and `myOption' (StataMP 18). Sight lowercased the whole name, so it reported `saveAs' as undefined and accepted `saveas'. A program's local()-style options now match the exact local too, so `c_local `myLocal'' after MyLocal(string) creates a macro, while `c_local `Cache'' after Cache(string) does not. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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 24 minutes. View limit details
|
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.
syntax [, saveAs(string)]defines the localsaveAs, but Sight lowercased the whole option name tosaveas. So`saveAs'was reported as an undefined macro, and`saveas'was accepted. In StataMP 18,syntaxlowercases only an option's leading capitals:saveAsandMyOptiondefinesaveAsandmyOption, and Stata rejectsmyoption(x)formyOption(string).syntax_option_local_namenow takes the local fromsyntax_option_spelling(#391). Recording a program'slocal()-style options also matches that exact local. So afterMyLocal(string),c_local `myLocal'creates a macro at the call. AfterCache(string),c_local `Cache'does not, because that local iscacheandCacheis undefined in Stata.Several property tests paired
syntax, Cache(name)withc_local `Cache'and expectedcache. They nowc_localthe local Stata actually defines.Proof: the local names were probed on StataMP 18. Two new regression tests (
saveAsintests/unit/analyzer.test.ts,MyLocalintests/unit/command-macro-writes.test.ts) fail without the fix. Typecheck, lint, andbun test ./testspass (9670 tests).Reviewed with sol-loop: 1 round with gpt-6.1-sol. Sol verdict: approved
Created with Claude Opus 5.5 in T3 Code.