Skip to content

Conversation

@zharinov
Copy link
Member

Summary

  • Add MultiElementScalarCapture diagnostic for sequences like {(a) (b)}* @items
  • Reject patterns where multi-element sequence is captured without internal captures
  • Previously compiled but silently captured only last element (e.g., only (b) nodes)

Why

{(identifier) (number)}* @items was semantically broken - it compiled to Node[] but only pushed number nodes, discarding identifier. This silent data loss should be a compile error.

Notes

  • Added parse_cst() helper for parser tests that only validate syntax, not semantics
  • Alternations with inconsistent arity (e.g., [(a) {(b) (c)}]*) also rejected

@zharinov zharinov enabled auto-merge (squash) January 15, 2026 17:00
@zharinov zharinov merged commit 99440c8 into master Jan 15, 2026
3 checks passed
@zharinov zharinov deleted the fix/multi-element-scalar-capture branch January 15, 2026 17:01
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.

2 participants