Skip to content

Commit 85f14cb

Browse files
committed
Compile match/case string literals
1 parent 8471aa2 commit 85f14cb

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
@@ -4449,7 +4449,9 @@ def record_each(obj: Object) -> Object:
44494449
cases
44504450
. compile_case =
44514451
| {type="MatchCase", pattern={type="Int", value=value}, body=body} ->
4452-
"if (__arg == " ++ ($$int_as_str value) ++ ") { return " ++ (compile body) ++ "; }"
4452+
"if (__arg === " ++ ($$int_as_str value) ++ ") { return " ++ (compile body) ++ "; }"
4453+
| {type="MatchCase", pattern={type="String", value=value}, body=body} ->
4454+
"if (__arg === " ++ ($$str_as_str value) ++ ") { return " ++ (compile body) ++ "; }"
44534455
)
44544456
44554457
. join = sep ->

0 commit comments

Comments
 (0)