powered by
Performs one constant folding pass. Carefully examine the results after running this function!
opt_constant_folding(texts, fold_floats = FALSE, in_fun_call = FALSE)
A list of character vectors with the code to optimize.
A logical indicating if floating-point results should be folded (will reduce precision).
A logical indicating whether it should propagate in function calls. Note: this could change the semantics of the program.
# NOT RUN { code <- paste( "i <- 320 * 200 * 32", "x <- i * 20 + 100", sep = "\n" ) cat(opt_constant_folding(list(code))$codes[[1]]) # }
Run the code above in your browser using DataLab