diff options
Diffstat (limited to 'interpreter.py')
-rwxr-xr-x | interpreter.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/interpreter.py b/interpreter.py index a67286f..61ea28d 100755 --- a/interpreter.py +++ b/interpreter.py @@ -634,12 +634,19 @@ class Interpreter(): if node is None: return if not isinstance(node, nodes.CodeBlock): - raise InvalidCode('Line %d: Tried to execute a non-codeblock. Possibly a bug in the parser.' % node.lineno()) + e = InvalidCode('Tried to execute a non-codeblock. Possibly a bug in the parser.') + e.lineno = node.lineno() + raise e statements = node.get_statements() i = 0 while i < len(statements): cur = statements[i] - self.evaluate_statement(cur) + try: + self.evaluate_statement(cur) + except Exception as e: + e.lineno = cur.lineno() + e.file = os.path.join(self.subdir, 'meson.build') + raise e i += 1 # In THE FUTURE jump over blocks and stuff. def get_variable(self, varname): |