Skip to content

hrw4u: remove the bare operator statement that never compiled - #13705

Open
masaori335 wants to merge 1 commit into
apache:masterfrom
masaori335:asf-master-hrw4u-grammar-statement
Open

masaori335 wants to merge 1 commit into
apache:masterfrom
masaori335:asf-master-hrw4u-grammar-statement

Conversation

@masaori335

Copy link
Copy Markdown
Contributor

Fix #13701

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.

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.
@masaori335 masaori335 added this to the 11.0.0 milestone Sep 18, 2026
@masaori335 masaori335 self-assigned this Sep 18, 2026
Copilot AI lite review requested due to automatic review settings September 18, 2026 01:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

hrw4u: grammar accepts bare operator statements (no-op;) that can never compile

2 participants