Repository navigation
Report a program's args from inside quietly { } in sight parse --json - #379
Merged
Merged
Conversation
…rse --json
`program.args` read only top-level `args` statements, so
`quietly { args a b }` gave `[]`. It now uses the same rule as the
signature: the top-level `args`, or the program's only `args` when it is
inside brace or `frame` blocks. Several with any nested keep the
top-level ones. Both rules share one helper.
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 10 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.
sight parse --jsongave"args": []for a program whoseargsis inside a brace block, which is common in real code:program p quietly { args first second } endStata 18 defines
firstandsecondhere, and the analyzer already did (since #376). Onlyprogram.argsin the JSON missed them, because it read top-levelargsstatements only.Now
program.argsfollows the same rule #378 gave thesyntaxsignature. It takes the top-levelargsstatements, or, when the program has exactly oneargsand it is inside brace blocks (quietly {,capture {, nested) or aframe name {block, that one. With several and any of them nested (one perif/elsebranch, say), it keeps the top-level ones, as before. The two rules share one helper insrc/utils/node-body.ts.sight parse --jsonchangeIn
statements[]of kindprogram,args(a list of{"name", "range"}) is filled for a program whose onlyargsis inside brace orframeblocks. The example above givesfirstandsecondwith the ranges of their names, where it gave[]before. Programs with top-levelargs, or with severalargsand any nested, are unchanged. Nothing else in the output changes. The golden fixturebrace-blocks.dogains aquiet_argsprogram that shows it.Not changed
The editor has no
args-based program metadata.ProgramSymbol.parametersis declared but never set or read, and hover shows only thesyntaxsignature, so only the JSON changes.Proof: StataMP 18 on voyager defines the
argslocals inquietly {, nestedcapture noisily { quietly { } }, andframe default {.sight checkgives no undefined macro for them. The newparse-graph-json.test.tscase fails on main. All four gates pass.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.