From: Dmitry Selyutin Date: Sun, 14 Jan 2024 18:05:05 +0000 (+0300) Subject: oppc: decouple attribute name X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=040269828a64789d213b0852f56ee802320195e4;p=openpower-isa.git oppc: decouple attribute name --- diff --git a/src/openpower/oppc/pc_ast.py b/src/openpower/oppc/pc_ast.py index 2626b358..b3ec17b9 100644 --- a/src/openpower/oppc/pc_ast.py +++ b/src/openpower/oppc/pc_ast.py @@ -193,7 +193,10 @@ class Symbol(Token): class Attribute(Dataclass): - name: Symbol + class Name(Symbol): + pass + + name: Name subject: Node = Node() diff --git a/src/openpower/oppc/pc_parser.py b/src/openpower/oppc/pc_parser.py index 8f385d6d..a7a0ffbe 100644 --- a/src/openpower/oppc/pc_parser.py +++ b/src/openpower/oppc/pc_parser.py @@ -549,7 +549,7 @@ class Parser: """ trailer_attr : PERIOD NAME """ - p[0] = pc_ast.Attribute(name=p[2]) + p[0] = pc_ast.Attribute(name=pc_ast.Attribute.Name(p[2])) # subscript: '.' '.' '.' | test | [test] ':' [test] def p_subscript(self, p):