speckl/compiler/__tests__
Scott Scoble 4d95a2b975 fix(speckl): dispatch 'state as <Name>' to parseStateBlockMultiline (cycle 63)
End-to-end compile of FederatedMeetup.speckdl with the new
'state as StateSnapshot' header (cycle 63) surfaced that the
parser's main loop and parseMemberBlock dispatcher were both
missing 'state as ' as a recognized block-starter prefix. The
state-block parser (parseStateBlockMultiline) already extracts
the 'as' clause correctly (cycle 59), but the call site never
reached it: the block fell through the 'state:' / 'state {'
checks and was parsed as a regular member line, producing no
StateNode at all.

Fix: add 'state as ' to the blockStarters list in the main
parse loop, and add a parallel dispatch in parseMemberBlock
that routes 'state as ' headers to parseStateBlockMultiline.
The dispatcher change is symmetric with the existing 'state:'
and 'state {' forms.

Tests: 1 new parser test confirms the dispatch works for
'state as StateSnapshot { ... }'. All 55 tests pass (54
baseline + 1 new). tsc build clean.

End-to-end verified: running generateProtobuf against the
federated-meetup speck with 'state as StateSnapshot' now
emits 'message StateSnapshot { ... }' (correct), where
pre-fix the StateNode was lost entirely.
2026-06-28 22:29:28 -07:00
..
parser.test.ts fix(speckl): dispatch 'state as <Name>' to parseStateBlockMultiline (cycle 63) 2026-06-28 22:29:28 -07:00
tigerbeetle.speck speckl: TypeScript state machine generator + Forgejo issue workflow spec 2026-05-03 12:23:33 -07:00