-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
something like this
//# // define console_debug macro
//#function console_debug(line){
//# if ($GRECO_DEBUG) {
//# // write actually writes to js/ts code
//# write("console.debug('"+line+"')");
//# }
//#}
function do_stuff(){
//#console_debug('doing stuff');
console.log("do stuff");
}all files are evaluated in the same context so you can define and redifine functions and variables
The code above will expand to the following if $GRECO_DEBUG = true; (running in debug mode)
function do_stuff(){
console.debug('doing stuff');
console.log("do stuff");
}comments are removed, lines are preserved so line numbers still make sense
a rust util will extract all code prepended by //# and replace all others with write(line)
the whole file is then evaluated with a new write method/buffer and the output is actually used/stored/cached etc
Metadata
Metadata
Assignees
Labels
No labels