Repository navigation
Stop reporting constant' as undefined after syntax [, noCONStant], which defines it, not noconstant' - #385
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 15 minutes. View limit details
|
In Stata an option without an argument that starts with a lowercase no defines the rest of its name: noCONStant, nolog and noTE define constant, log and te. Sight registered noconstant, nolog and note, so every use of `constant' or `log' after such a syntax was reported as undefined (StataMP 18 checked). An uppercase NO stays in the name (NODetail defines nodetail), and an option with an argument keeps its whole name (notable(string) defines notable). The parser now records whether an option has an argument, since argumentType covers only the types it recognizes.
The property generates random option names, so a name starting with no (about one run in several) expected the old local.
jbearak
force-pushed
the
syntax-no-options
branch
from
November 5, 2026 15:52
4ea2dfe to
190b17f
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.
After
syntax [, noCONStant nolog], every`constant'and`log'was reported as undefined. In Stata, an option without an argument whose name starts with a lowercasenodefines the local named by the rest of the name, so these defineconstantandlog.`noconstant'and`nolog'stay empty. Sight registerednoconstantandnolog.Sight now names the local as Stata does (StataMP 18 on voyager):
syntaxoptionnoCONStant,nolog,noTEconstant,log,teNODetail,NOISily(uppercaseNO)nodetail,noisilynotable(string),nolog(integer 3)(with an argument)notable,nologThe parser now records whether an option has an argument (
hasArgument), becauseargumentTypeis set only for the types it recognizes, andnoX(str)would otherwise lose itsno.sight parse --jsonis unchanged; the signature serializer lists its fields explicitly.Corpus:
sight checkover Stata 18's 3,780 base ados`constant'(783),`offset'(685),`header'(190),`log'(151),`legend'and`table'.`noX'after asyntaxthat declaresnoX, which Stata leaves empty. They're bugs in StataCorp's code, if harmless ones.varirf_table.adouses`nocri'at line 24 but tests`cri'correctly at line 46.xtnbreg.adopasses`log' `nolog'.Proof: StataMP 18 on voyager sets
constant/log/teand leavesnoconstant/nolog/noteempty; it setsnodetail,noisily,notableandnologfor the uppercase and with-argument forms. 3 of the 5 new tests fail on main (the 2 that pass are guards). The syntax-option property test now expects the stripped local for a generated name that starts withno. All four gates pass. The corpus result is above.Reviewed with sol-loop: 1 round with gpt-6.1-sol. Sol verdict: approved
Created with Claude Opus 5.5 in T3 Code (Claude Code harness), reviewed by gpt-6.1-sol in Codex.