Skip to content

Commit 8d0907f

Browse files
committed
Compile match/case empty record
1 parent 97871bd commit 8d0907f

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
@@ -4459,6 +4459,8 @@ def record_each(obj: Object) -> Object:
44594459
name={type="Var", name=name},
44604460
value={type="Var", name="__arg"}},
44614461
body=body}) ++ ");"
4462+
| {type="MatchCase", pattern={type="Record", data={}}, body=body} ->
4463+
"if (__arg === {}) { return " ++ (compile body) ++ "; }"
44624464
)
44634465
44644466
. join = sep ->

0 commit comments

Comments
 (0)