1
0
Fork 0

valueContext values are set from children

This commit is contained in:
Kevin Matz 2019-07-30 10:39:55 -04:00
parent e6b05cf3a2
commit 049286266f
1 changed files with 8 additions and 2 deletions

View File

@ -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):