From 1c392f4e42493da7ef08ef574953d853475c41bf Mon Sep 17 00:00:00 2001 From: Anton Trunov Date: Tue, 13 Jul 2021 12:22:05 +0300 Subject: [PATCH] sexp parser: ignore more malformed input --- alectryon/sexp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alectryon/sexp.py b/alectryon/sexp.py index b8bf3b2c..88b2b565 100644 --- a/alectryon/sexp.py +++ b/alectryon/sexp.py @@ -68,7 +68,7 @@ def parse(tokens): stack.append(top) top = new elif tok is CLOSE: - top = stack.pop() + if stack: top = stack.pop() else: top.append(tok) return top[0]