constant-folding
Realiza la transformación de plegado de constantes sobre un input dejando la salida el output con los cambios aplicados.
Installation
$ npm install @alu0101225296/constant-folding
Usage as executable:
$ cf input.js output.js
Usage from code:
const constantFolding = require('constant-folding');
//call the function
The documentation of the function.
Examples
// input.js
var f = 3+null;
var e = 4 | 3;
var d = 3+"c";
var b = 9 +1;
var a = 2+3*5+b;
$ cf input.js output.js
// output.js
var f = 3;
var e = 7;
var d = '3c';
var b = 10;
var a = 17 + b;
Author
alu0101225296 Pablo Bande Sánchez - Girón