From 621203d3239adf80fea769eda93f727cc6f4ac5a Mon Sep 17 00:00:00 2001 From: SoniEx2 Date: Sun, 23 Feb 2020 19:53:25 -0300 Subject: Fix infinite matches on empty patterns --- abdl/_vm.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'abdl/_vm.py') diff --git a/abdl/_vm.py b/abdl/_vm.py index 1de2e15..f8b8c80 100644 --- a/abdl/_vm.py +++ b/abdl/_vm.py @@ -289,7 +289,8 @@ def match_helper(ops, defs, tree): res[h.name] = (h.key, h.value) yield res assert len(path) == 1 or isinstance(frame.current_op, End) - frame.prev() + if not frame.prev(): + return in_key = True else: if in_key: -- cgit 1.4.1