From 3f63a110cf9fc3a058c5093a9cf0e7118d89c8aa Mon Sep 17 00:00:00 2001 From: Jose Rodriguez Date: Tue, 26 Nov 2024 23:12:45 +0100 Subject: [PATCH] feat: show a better error message upon crash --- src/arch/z80/peephole/evaluator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/arch/z80/peephole/evaluator.py b/src/arch/z80/peephole/evaluator.py index 29156458..82c57632 100644 --- a/src/arch/z80/peephole/evaluator.py +++ b/src/arch/z80/peephole/evaluator.py @@ -195,7 +195,7 @@ def __init__(self, expression): expression[2] = Evaluator(expression[2]) else: # It's a list assert len(expression) % 2 # Must be odd length - assert all(x == FN.OP_COMMA for i, x in enumerate(expression) if i % 2) + assert all(x == FN.OP_COMMA for i, x in enumerate(expression) if i % 2), f"Invalid expression {expression}" self.expression = [Evaluator(x) if not i % 2 else x for i, x in enumerate(expression)] @staticmethod