Skip to content

Commit 0a8b976

Browse files
committed
Compile match/case string literals
1 parent 986a450 commit 0a8b976

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

scrapscript.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4444,7 +4444,9 @@ def record_each(obj: Object) -> Object:
44444444
cases
44454445
. compile_case =
44464446
| {type="MatchCase", pattern={type="Int", value=value}, body=body} ->
4447-
"if (__arg == " ++ ($$int_as_str value) ++ ") { return " ++ (compile body) ++ "; }"
4447+
"if (__arg === " ++ ($$int_as_str value) ++ ") { return " ++ (compile body) ++ "; }"
4448+
| {type="MatchCase", pattern={type="String", value=value}, body=body} ->
4449+
"if (__arg === " ++ ($$str_as_str value) ++ ") { return " ++ (compile body) ++ "; }"
44484450
)
44494451
44504452
. join = sep ->

0 commit comments

Comments
 (0)