From: Jacob Lifshay Date: Thu, 28 Jul 2022 08:59:44 +0000 (-0700) Subject: try to add some line numbers to ast -- helps with debugging X-Git-Tag: sv_maxu_works-initial~204 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=cff951cb21728bc763d9a7acd1640026afe21073;p=openpower-isa.git try to add some line numbers to ast -- helps with debugging --- diff --git a/src/openpower/decoder/pseudo/parser.py b/src/openpower/decoder/pseudo/parser.py index 76882527..f78ef18a 100644 --- a/src/openpower/decoder/pseudo/parser.py +++ b/src/openpower/decoder/pseudo/parser.py @@ -350,7 +350,7 @@ class PowerParser: def p_funcdef(self, p): "funcdef : DEF NAME parameters COLON suite" - p[0] = ast.FunctionDef(p[2], p[3], p[5], ()) + p[0] = ast.FunctionDef(p[2], p[3], p[5], (), lineno=p.lineno(2)) # reset function parameters after suite is identified self.fnparm_vars = set() @@ -762,9 +762,9 @@ class PowerParser: self.write_regs.add(name) # and add to list to write if name in {'XLEN'}: attr = ast.Name("self", ast.Load()) - p[0] = ast.Attribute(attr, name, ast.Load()) + p[0] = ast.Attribute(attr, name, ast.Load(), lineno=p.lineno(1)) else: - p[0] = ast.Name(id=name, ctx=ast.Load()) + p[0] = ast.Name(id=name, ctx=ast.Load(), lineno=p.lineno(1)) def p_atom_number(self, p): """atom : BINARY