You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(dsl): tighten compile-time error reporting and call-site precision
Apply four fixes from PR #85 review feedback:
1. arc.ex `decompose_args/4`: raise CompileError when a positional expression
is followed by a `do ... end` block. Previously `input :p, bind({1, x}) do
... end` silently dropped the bind expression and used the block body as
the inscription, hiding user mistakes.
2. termination.ex: reject multiple `termination` blocks at macro-expansion
time. The previous flow accumulated criteria and `pull_one` returned the
stalest entry (List.last on a prepend-accumulated list), silently dropping
later declarations. Builder's `pull_one` is simplified to `List.first/1`
now that uniqueness is enforced upstream.
3. builder.ex: when `Validators.run/1` returns an identifiable error
(`UniqueNameViolationError`, `MissingColourSetError`), point the raised
CompileError at the offending declaration's source location instead of
the `defmodule` line. Each accumulating macro (`colset`, `var`, `val`,
`place`, `function`, `transition`) now also stores `{name, file, line}`
metadata so Builder can resolve scope+name back to a callsite. Falls
back to the `defmodule` callsite for unmappable error types.
4. Add `error.file` and `error.line` assertions across existing
duplicate-detection tests (place, transition, guard, action,
on_markings, multiple termination, arc options-before-do, validator
errors) to lock the call-site precision into the test contract.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
0 commit comments