diff --git a/tab.py b/tab.py index 886587b..a77470f 100644 --- a/tab.py +++ b/tab.py @@ -364,9 +364,9 @@ class StackTabber2(Tabber): def _is_close_token(self, t): return t.string in self.close_tokens.get(t.name, set()) def _handle_close_token(self, y, tokens, start, end, i, t): - if not self.stack: - raise Exception, "unmatched %r, line %d" % (t.string, y) while True: + if not self.stack: + raise Exception, "unmatched %r, line %d" % (t.string, y) marker = self.stack[-1] if marker.name in ('control', 'continue'): self.stack.pop()