Skip to content

Commit c443c39

Browse files
authored
handle assembly slot access case (#2)
1 parent b1b2e29 commit c443c39

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

solidity_parser/parser.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -848,9 +848,14 @@ def visitAssemblyExpression(self, ctx):
848848
return self.visit(ctx.getChild(0))
849849

850850
def visitAssemblyMember(self, ctx):
851+
if type(ctx.identifier()) == list:
852+
# handle the case, eg. x.slot
853+
name = ctx.identifier()[0].getText()
854+
else:
855+
name = ctx.identifier().getText()
851856
return Node(ctx=ctx,
852857
type='AssemblyMember',
853-
name=ctx.identifier().getText())
858+
name=name)
854859

855860
def visitAssemblyCall(self, ctx):
856861
functionName = ctx.getChild(0).getText()

0 commit comments

Comments
 (0)