feat(cli): torb manifest, ir, natives, parse, tokens, ast and highlight use std/cli #551
Loading…
Reference in a new issue
No description provided.
Delete branch "loop/550-cli-std-cli-step3"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
torb manifest,ir,natives,parse,tokens,astandhighlightparse their command line withstd/clithroughtorbCommand()(step 3 of #124, the same pattern as #502 / #521). Closes nothing:Refs #124, implements #550.compiler/src/cli/declaration.trb: seven morecommandblocks,declaredCommands()lists them, and small readers (manifestOptionsFrom,irOptionsFrom,nativesDirectoryFrom,parsePathsFrom,singleFileFrom,highlightSourceFrom) turn the parsedInputinto whatmain.trbcalls as before (runManifest,printIr,writeNativesHeader,checkSyntax,printTokens,printTree,runHighlight).compiler/src/main.trb: the seven hand-written arms and their flag handling are gone;match parsed.pathgets one case per command.refuseUnknownFlagstays (still used byrepl,debug,upgrade,new,init).compiler/src/cli/usage.trb: the sevenCommandUsageblocks are removed;torb --helplists the commands throughdeclaredUsageLines(), flags are intorb <command> --help.error: torb ir: unknown flag '--frobnicate', seetorb ir --help``),tokens/astwithout or with more than one file,nativeswithout--header,parsewithout a path,highlightwith neither file nor--stdin.torb natives --header a brefusesbinstead of silently ignoring it.tests/command-line/arguments.expectedchanges only on the lines of the seven commands (three message lines, five new wrong lines intools/command-line.sh);tests/test-report/arguments.expectedis untouched.docs/standard-library/cli.md,skills/regenerated (second commit).Does not touch the seed (no syntax, native, driver flag or looked-up name), so the two-commit seed rule does not apply.
Test
torb format --checkon the four touched.trbfiles: clean.torb check compiler/src/main.trb compiler/tests/cli-declaration.test.trb: 299 files, no problems.torb test compiler/tests/cli-declaration.test.trb(installed nightly toolchain, VM): 38 passed, 0 failed (new groups per command: argument lists, parsed values,--help, wrong lines).torb docs skill docs skills --check: up to date.tools/check-commits.sh origin/main HEAD: clean.tools/command-line.shand tier A run in forge CI.Refs #124
Refs #550
torb manifest,ir,natives,parse,tokens,astandhighlightuse std/cli ab29da35d9torb manifest,ir,natives,parse,tokens,astandhighlightuse std/cli$Review of
4b4f8bd- approved.\n\n- Tests: ok. cli-declaration.test.trb adds groups per command (defaults, parsed values, wrong lines, --help). CI green on this head (gates, tier A/B, bootstrap linux-x64, pdisc, commit messages); tools/command-line.sh expectations updated for the 3 changed messages and 5 new wrong lines.\n- Correctness: ok. Defaults preserved (manifest/ir -> ".", natives -> "../runtime", ownership pass unless --no-ownership); wrong lines exit 2 naming command and argument; the removed hand-written arms have matching cases inmatch parsed.path. Thenatives --header a brefusal is the one behavior change and is stated in the PR body.\n- Scope: ok. Step 3 of #124 / #550, same pattern as #502/#521; no seed change.\n- Security/secrets, data: ok, nothing touched.\n- Docs: ok. CLI.md, std/cli doc and regenerated skill copy updated.\n- Architecture/placement/release: n/a, no boundary change, no post-merge steps.\n\nNon-blocking: none.ir,manifest,parse,tokens,ast,highlightandnativesparse withstd/cli(step 3 of #124) #550ir,manifest,parse,tokens,ast,highlightandnativesparse withstd/cli(step 3 of #124) #550ir,manifest,parse,tokens,ast,highlightandnativesparse withstd/cli(step 3 of #124) #550