✨ add pretty printer to stderr.debug()
This commit is contained in:
parent
3bce41fda6
commit
b91893d06f
@ -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;
|
||||
|
@ -110,6 +110,7 @@ class Juicescript {
|
||||
Run previously parsed program
|
||||
*/
|
||||
run(){
|
||||
/**/this.io.stderr.debug(this.program_tree);
|
||||
/**/console.log(this.program_tree);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user