hrw4u: remove the bare operator statement that never compiled - #13705
Open
masaori335 wants to merge 1 commit into
Open
masaori335 wants to merge 1 commit into
masaori335 wants to merge 1 commit into
Conversation
The grammar's `op=IDENT SEMICOLON` alternative parsed, but the compiler rejected everything it matched: the emit path was gated on a statement function having no argument validator, and every entry in STATEMENT_FUNCTION_MAP declares one -- `no-op` included, via arg_count(0). Known operators got a "requires an argument" error that is wrong for the zero-arity ones; any other identifier got "Unknown operator or invalid standalone use". The call form is the only spelling the docs, the u4wrh reverse conversion, and the test corpus produce.
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No unresolved blocking issues were identified.
Pull request overview
Removes the unusable bare-operator statement syntax and aligns grammar, visitors, symbol handling, and tests with call-form operators.
Changes:
- Removes
IDENT;from the grammar and obsolete handling. - Updates visitors and symbol resolution.
- Adds syntax-error and zero-argument call coverage.
File summaries
| File | Description |
|---|---|
tools/hrw4u/tests/test_ops.py |
Adds syntax and call-form tests. |
tools/hrw4u/tests/test_ast_visitor.py |
Updates tests to use call syntax. |
tools/hrw4u/src/visitor.py |
Removes obsolete compilation handling. |
tools/hrw4u/src/symbols.py |
Removes unused lookup handling. |
tools/hrw4u/src/kg_visitor.py |
Removes bare-operator graph handling. |
tools/hrw4u/src/ast_visitor.py |
Removes bare-operator AST handling. |
tools/hrw4u/grammar/hrw4u.g4 |
Removes bare-operator statements. |
Review details
- Files reviewed: 7/7 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Fix #13701
The grammar's
op=IDENT SEMICOLONalternative parsed, but the compiler rejected everything it matched: the emit path was gated on a statement function having no argument validator, and every entry in STATEMENT_FUNCTION_MAP declares one --no-opincluded, via arg_count(0). Known operators got a "requires an argument" error that is wrong for the zero-arity ones; any other identifier got "Unknown operator or invalid standalone use". The call form is the only spelling the docs, the u4wrh reverse conversion, and the test corpus produce.