Skip to content

Reject duplicate capture names in Ir.seq#197

Merged
hhugo merged 1 commit into
masterfrom
fix-dup
Apr 15, 2026
Merged

Reject duplicate capture names in Ir.seq#197
hhugo merged 1 commit into
masterfrom
fix-dup

Conversation

@hhugo
Copy link
Copy Markdown
Collaborator

@hhugo hhugo commented Apr 15, 2026

The same as binding name appearing in multiple positions of a sequence (e.g., (pat1 as x, ..., pat2 as x)) produces incorrect DFA output — each binding gets independent tag cells, but the runtime has no way to resolve which one to report.

Change Ir.seq to return (t, string) result and reject duplicate capture names across operands, matching the existing validation pattern used by alt, capture, star, plus, and rep.

The same `as` binding name appearing in multiple positions of a sequence
(e.g., `(pat1 as x, ..., pat2 as x)`) produces incorrect DFA output —
each binding gets independent tag cells, but the runtime has no way to
resolve which one to report.

Change `Ir.seq` to return `(t, string) result` and reject duplicate
capture names across operands, matching the existing validation pattern
used by `alt`, `capture`, `star`, `plus`, and `rep`.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@hhugo hhugo merged commit 48f8cae into master Apr 15, 2026
7 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant