Skip to content

Stop reporting constant' as undefined after syntax [, noCONStant], which defines it, not noconstant' - #385

Merged
jbearak merged 2 commits into
mainfrom
syntax-no-options
Nov 5, 2026
Merged

jbearak merged 2 commits into
mainfrom
syntax-no-options

Conversation

@jbearak

@jbearak jbearak commented Nov 5, 2026 •

Copy link
Copy Markdown
Owner

After syntax [, noCONStant nolog], every `constant' and `log' was reported as undefined. In Stata, an option without an argument whose name starts with a lowercase no defines the local named by the rest of the name, so these define constant and log. `noconstant' and `nolog' stay empty. Sight registered noconstant and nolog.

Sight now names the local as Stata does (StataMP 18 on voyager):

syntax option Local
noCONStant, nolog, noTE constant, log, te
NODetail, NOISily (uppercase NO) nodetail, noisily
notable(string), nolog(integer 3) (with an argument) notable, nolog

The parser now records whether an option has an argument (hasArgument), because argumentType is set only for the types it recognizes, and noX(str) would otherwise lose its no. sight parse --json is unchanged; the signature serializer lists its fields explicitly.

Corpus: sight check over Stata 18's 3,780 base ados

main (53c3d76) this PR
Total 40,221 36,630
UNDEFINED_MACRO 23,733 20,584
OUT_OF_SCOPE_SYMBOL 6,788 6,346
  • Removed (3,674): mostly `constant' (783), `offset' (685), `header' (190), `log' (151), `legend' and `table'.
  • Added (83): 48 are at locations that already had a warning and now get a different one. The other 35 are uses of `noX' after a syntax that declares noX, which Stata leaves empty. They're bugs in StataCorp's code, if harmless ones. varirf_table.ado uses `nocri' at line 24 but tests `cri' correctly at line 46. xtnbreg.ado passes `log' `nolog'.

Proof: StataMP 18 on voyager sets constant/log/te and leaves noconstant/nolog/note empty; it sets nodetail, noisily, notable and nolog for 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 with no. 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.

@coderabbitai

coderabbitai Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

Next included review available in 15 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available. Your 60 included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Team
  • Run ID: d4b03fcb-b927-45c9-a883-acda92eac2fa
Commits

Reviewing files that changed from the base of the PR and between 53c3d76 and 190b17f.

Files selected for processing: 6

  • docs/configuration.md
  • src/analyzer/index.ts
  • src/parser/index.ts
  • src/types/index.ts
  • tests/property/syntax-command-analyzer.prop.test.ts
  • tests/unit/syntax-no-options.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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
jbearak merged commit 0456d2f into main Nov 5, 2026
16 checks passed
@jbearak
jbearak deleted the syntax-no-options branch November 5, 2026 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant