Skip to content

Commit 7ba29ba

Browse files
committed
wip
1 parent 5b98e3b commit 7ba29ba

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
@@ -1281,9 +1281,11 @@ def eval_exp(env: Env, exp: Object) -> Object:
12811281
elif isinstance(callee.func, MatchFunction):
12821282
arg = eval_exp(env, exp.arg)
12831283
for case in callee.func.cases:
1284-
m = match(arg, case.pattern, env, case.guard)
1284+
m = match(arg, case.pattern)
12851285
if m is None:
12861286
continue
1287+
if case.guard is not None and eval_exp({**env, **m}, case.guard) != Symbol("true"):
1288+
continue
12871289
return eval_exp({**callee.env, **m}, case.body)
12881290
raise MatchError("no matching cases")
12891291
else:

0 commit comments

Comments
 (0)