Skip to content

Commit a896169

Browse files
committed
Compile match/case empty record
1 parent 83311c4 commit a896169

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

scrapscript.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4454,6 +4454,8 @@ def record_each(obj: Object) -> Object:
44544454
name={type="Var", name=name},
44554455
value={type="Var", name="__arg"}},
44564456
body=body}) ++ ");"
4457+
| {type="MatchCase", pattern={type="Record", data={}}, body=body} ->
4458+
"if (__arg === {}) { return " ++ (compile body) ++ "; }"
44574459
)
44584460
44594461
. join = sep ->

0 commit comments

Comments
 (0)