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
## Summary
Codex review followups for the DSL PR (#69332aa). Four small,
independent fixes:
- **`initial_markings/0` accessor** — the `initial_marking/2` macro
accumulated into `@cf_initial_markings`, but `Builder` never read it.
Now exposed as a zero-arity helper returning
`[%ColouredFlow.Enactment.Marking{}]` (Runner seed data; intentionally
separate from `cpnet/0`'s static definition).
- **Hygiene checks** — `guard`/`action`/`on_markings` previously
silently overwrote when called twice in the same scope. Now raise
`CompileError` pointing at the second declaration.
- **Caller line/file in errors** — `guard`, `action`, `on_markings`,
`transition`, `termination`, `function`, `input`, `output`, `place`,
`initial_marking` all capture `__CALLER__.{file,line}` and thread it
through their `__set_*__!` / `__open_*__!` / `__push_arc__` helpers, so
`CompileError`s point at the offending line, not the `defmodule` line.
- **Shared type decomposer** — `DSL.Function` no longer maintains its
own `decompose_type/1`; reuses `Notation.Colset.__decompose_type__/1`
(newly exposed under the `__name__/N` "internal but reusable"
convention). `Builder.resolve_descr/2` stays — it does the user-name →
primitive descr lookup, which is orthogonal to AST decomposition.
Plus minor cleanups along the way: replace `ArgumentError` raises in
macro bodies with `CompileError`+file/line, fix the `~MS[1, 2, 3]` typo
in `spec.md` and `place.ex` docs (the sigil is space-separated), drop a
dead `if scope.markings || true do` in termination close.
## Test plan
- [x] new tests for `initial_markings/0` (empty, single, multi-place
accumulation)
- [x] new tests for duplicate `guard` / `action` / `on_markings`
(compile via `Code.compile_string` and assert `error.line` matches the
second declaration)
- [x] existing function tests still pass after the shared-decomposer
refactor
- [x] `mix format --check-formatted`
- [x] `mix compile --warnings-as-errors`
- [x] `mix credo --strict` (0 issues)
- [x] `mix dialyzer` (baseline `Total errors: 6, Skipped: 6` unchanged)
- [x] `MIX_ENV=test mix test` (63 doctests, 410 tests, 0 failures)
0 commit comments