Repository navigation
Read prog def and the other abbreviations Stata accepts for program define as program definitions - #402
Merged
Conversation
…ogram define as program definitions
… and the indentation rule too
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 8 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.
Stata's base ados define programs as
prog def roctab, rclass(51 times) orprog define(5 times). Sight recognized a definition only when the command was spelledprogramin full. So those programs weren't parsed: their bodies were read at top level, eachendwas reported as "Unexpectedend", and theirifblocks drew false "Missing closing brace" errors. This was the cause of most of the "Unexpectedend" diagnostics left after #398.Checked in StataMP 18:
pr define,pro de,progandprogr defidefine programs.p defineis "command p is unrecognized", andprogram d p6isn't a definition, sodefineabbreviates tode.PROGRAM_COMMAND_NAMES(pr…program) is now shared by the lexer's open-definition tracking, the parser's dispatch, and its error recovery. The parser already handledde…define.prog drop xand the other subcommands stay commands.prog def nameandpr drop name.prog def name. Inlanguage-configuration.json, the lone-{alternative was written\|, a literal pipe, so it never matched; that's fixed too.Proof: on the 3,780 base ados vs main, 83 diagnostics are removed: 57 "Unexpected
end", 25 false "Missing closing brace for if statement" and 1OUT_OF_SCOPE_SYMBOL. 28 are added, allOUT_OF_SCOPE_SYMBOLin_stcurv.ado, whereatlistis used in programs that never define it; that's an existing rule now reaching code scoped to its program. Each new test fails before its change. Typecheck, lint, andbun test ./testspass.Not covered: 4 "Unexpected
end" remain, fromprogram `cmdname'(a program named by a macro) indtaverify_11x.ado. That needs separate handling of macro program names.Reviewed with sol-loop: 1 round with gpt-6.1-sol. Sol verdict: approved
Created with Claude Opus 5.5 in T3 Code.