0
0

add pretty printer to stderr.debug()

This commit is contained in:
DrMaxNix 2022-09-09 13:53:27 +02:00
parent 3bce41fda6
commit b91893d06f
2 changed files with 9 additions and 0 deletions

View File

@ -21,6 +21,14 @@ class Juicescript_io {
get stderr(){
return {
debug: (text, additional) => {
// PRETTY PRINT INCOMMING DATA? //
// object
if(typeof text === "object"){
text = "Object" + "\n" + JSON.stringify(text, null, 4);
}
// OUTPUT //
// add defaults
additional ??= {};
additional.line ??= null;

View File

@ -110,6 +110,7 @@ class Juicescript {
Run previously parsed program
*/
run(){
/**/this.io.stderr.debug(this.program_tree);
/**/console.log(this.program_tree);
}
}