Skip to content

Commit 03d49aa

Browse files
committed
adding support for tag in Throw/Catch
1 parent 20b8f59 commit 03d49aa

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

mathics/builtin/control.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,11 @@ def apply3(self, expr, form, f, evaluation):
767767
except WLThrowInterrupt as e:
768768
# TODO: check that form match tag.
769769
# otherwise, re-raise the exception
770-
return Expression(f, e.value)
770+
match = Expression("MatchQ", e.tag, form).evaluate(evaluation)
771+
if match.is_true():
772+
return Expression(f, e.value)
773+
else:
774+
raise e
771775
return ret
772776

773777

0 commit comments

Comments
 (0)