Add syntax-only RoadC check command - #9
Closed
blackboxprogramming wants to merge 2 commits into
Closed
blackboxprogramming wants to merge 2 commits into
blackboxprogramming wants to merge 2 commits into
Conversation
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.
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.
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 --checkpassed.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.