AST.pm: Reduce the number of calls to value()