const parser = new engine({
// some options :
parser: {
extractDoc: true,
php7: true,
},
ast: {
withPositions: true,
},
});
// Load a static file (Note: this file should exist on your computer)
const phpcode = fs.readFileSync("./1.php", {
encoding: "utf-8"
});
let ast=parser.parseCode(phpcode);
now:
How to turn ast into PHP code?
const parser = new engine({
// some options :
parser: {
extractDoc: true,
php7: true,
},
ast: {
withPositions: true,
},
});
// Load a static file (Note: this file should exist on your computer)
const phpcode = fs.readFileSync("./1.php", {
encoding: "utf-8"
});
let ast=parser.parseCode(phpcode);
now:
How to turn ast into PHP code?