Skip to content

Add syntax-only RoadC check command - #9

Closed
blackboxprogramming wants to merge 2 commits into
mainfrom
codex/syntax-check-20260921
Closed

blackboxprogramming wants to merge 2 commits into
mainfrom
codex/syntax-check-20260921

Conversation

@blackboxprogramming

@blackboxprogramming blackboxprogramming commented Sep 21, 2026 •

Copy link
Copy Markdown
Owner

Superseded by merged PR #8: #8

The merged checker supports single-file checking plus batch and JSON output. Its integration includes adapted documentation from this PR and coverage for nested/export unfinished statements, current record syntax, and non-execution of record defaults. 274 local tests passed. This branch is retained for history; closing avoids merging competing CLI implementations.


Original proposal:

RoadC has run and AST-dump commands but no concise command for validating source without executing it.

Adds python3 roadc.py check <file.road>. It parses UTF-8 source, prints Syntax OK and exits 0 on successful parsing, or reports file/syntax/encoding errors on stderr and exits 1. Tests use a program with output and division by zero to demonstrate that checking never executes statements. New documentation lives in docs/CHECK.md to avoid the active record-types PR's QUICKSTART edits.

Validation: python3 -m pytest tests -q — 59 passed, 1 existing skip. Four new cases failed before implementation. This validates syntax only, not runtime feature support or program correctness. git diff --check passed.

Prepared as part of Alexa's non-design repository continuation. Draft for review; no merge or release requested.

Hosted CI at publication: no workflow run was returned for this commit. Hosted verification is unverified; local verification above passed.

Guard unfinished statement parsers in check mode, including nested blocks and exports. Preserve run/parse behavior and the single-file CLI.

Verified four unittest regression methods and all five existing CLI test functions locally. Full pytest unavailable in this environment. Document overlap with PR #8 before integration.
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