groostav
12/20/2017, 10:38 AMoverride fun exitLiteral(ctx: BabelParser.LiteralContext) = instructions.build {
val value = ctx.value
append {
stack.push(value)
}
}
runs twice as fast as
override fun exitLiteral(ctx: BabelParser.LiteralContext) = instructions.build {
append {
stack.push(ctx.value)
}
}
because the latter has a closure that references a LiteralContext, resulting in a huge amount of superfluous ANTLR runtime data hanging around after compilation. I wonder if I can write some kind of automated test to catch this....