-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Summary
The WHEN clause inside DIVE INTO currently accepts only a single Condition per the PEG.js grammar. It should support AND chaining (a ConditionList) like WHERE does.
Current behaviour
DIVE INTO entity_raiders
WHEN cap_savings_evaporated = 30000000
AND fa_commitments > 300000000 -- ❌ parse error
TRACE raiders_financial_cascade
EMIT acute_financial_cascade
Only the first condition is parsed; AND is not recognised inside WHEN.
Expected behaviour
DIVE INTO entity_raiders
WHEN cap_savings_evaporated = 30000000
AND fa_commitments > 300000000 -- ✅ parsed as ConditionList
TRACE raiders_financial_cascade
EMIT acute_financial_cascade
Grammar reference
In src/parser/grammar.pegjs, WHEN maps to Condition while WHERE maps to ConditionList. Changing WHEN to also accept ConditionList would unify the two.
Workaround
Use a single WHEN condition and document the additional context in a comment:
WHEN cap_savings_evaporated = 30000000 -- $30M hole, $300M+ committed, trade value diminished
Applied this workaround to UC-045, UC-046, and UC-047.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request