void Resolver::visit(ReturnExpr& expr, int dummy) { // Resolve the return value. if (!expr.value().isNull()) { resolve(expr.value()); } }
void ExprCompiler::visit(ReturnExpr& expr, int dest) { // Compile the return value. if (expr.value().isNull()) { // No value, so implicitly "nothing". write(expr, OP_BUILT_IN, BUILT_IN_NOTHING, dest); } else { compile(expr.value(), dest); } write(expr, OP_RETURN, dest); }