valueContext values are set from children
This commit is contained in:
parent
e6b05cf3a2
commit
049286266f
|
@ -67,8 +67,14 @@ class ArmCtlListener(ArmControlListener):
|
|||
ctx.value = int(ctx.getText())
|
||||
except ValueError:
|
||||
ctx.value = float(ctx.getText())
|
||||
if isinstance(ctx.parentCtx, ArmControlParser.CoordsContext):
|
||||
ctx.parentCtx.values.insert(ctx.parentCtx.index, ctx.value)
|
||||
if isinstance(ctx.parentCtx, ArmControlParser.ValueContext):
|
||||
ctx.parentCtx.value = ctx.value
|
||||
|
||||
# Exit a parse tree produced by ArmControlParser#hexidecimal.
|
||||
def exitHexidecimal(self, ctx: ArmControlParser.HexidecimalContext):
|
||||
ctx.value = int(ctx.getText(), 16)
|
||||
if isinstance(ctx.parentCtx, ArmControlParser.ValueContext):
|
||||
ctx.parentCtx.value = ctx.value
|
||||
|
||||
# Exit a parse tree produced by ArmControlParser#seperator.
|
||||
def exitSeperator(self, ctx: ArmControlParser.SeperatorContext):
|
||||
|
|
Loading…
Reference in New Issue