fix(compiler): translate 5 SpeckDL expression patterns to JavaScript
- notIn -> !map.has(key): 't.id notIn transfers.keys' -> '!transfers.has(t.id)'
- old(expr) -> drop wrapper: specification construct, no JS equivalent
- union -> Set spread: 'pending union {t.id}' -> 'new Set([...pending, t.id])'
- \ -> Set difference via filter: 'pending \ {id}' -> 'new Set([...pending].filter(x => x !== id))'
- Trailing == at end-of-string -> ===, then clean up empty RHS comparisons
All 41 tests passing. TigerBeetle: 0 notIn, 0 old(, 0 union, 0 \, 0 ==)
This commit is contained in:
parent
9de0a5ca0f
commit
e92f430fb3
5 changed files with 80 additions and 7 deletions
6
compiler/dist/parser.d.ts
vendored
6
compiler/dist/parser.d.ts
vendored
|
|
@ -133,6 +133,12 @@ export type ActionStatement = {
|
|||
} | {
|
||||
type: 'require';
|
||||
expr: string;
|
||||
} | {
|
||||
type: 'precondition';
|
||||
expr: string;
|
||||
} | {
|
||||
type: 'postcondition';
|
||||
expr: string;
|
||||
} | {
|
||||
type: 'emit';
|
||||
event: string;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue