There won't be tokens, because Espruino automatically converts them back to readable text before output - also the function you uploaded doesn't actually contain any reserved words :)
You'll notice all the whitespace is gone - that happened inside Espruino rather than being anything the IDE did.
Also if you really want to dive around in the internals:
>trace(test)
#30[r1,l1] Function {
#29[r1,l2] Name String [1 blocks] "\xFFcod" #38[r1,l0] FlatString [3 blocks] "\xA7(\xACi=0;i<10;i\x98){print(i);}"
#22[r1,l2] Name String [1 blocks] "\xFFlin"= int 3
}
So the function code is now "\xA7(\xACi=0;i<10;i\x98){print(i);}" - so you can see for/var/++ have been replaced by character codes>127.
Just as a quick test:
E.setFlags({pretokenise:0});
function test() {
var t = getTime();
for(var i=0;i<10;i++) {
for(var j=0;j<500;j++) { /* This is a big comment in my code */ };
}
print(getTime()-t,process.memory().usage);
}
test();
E.setFlags({pretokenise:1});
function test() {
var t = getTime();
for(var i=0;i<10;i++) {
for(var j=0;j<500;j++) { /* This is a big comment in my code */ };
}
print(getTime()-t,process.memory().usage);
}
test();
// gives
0.79599380493 51 // off
0.70184040069 47 // on
So in something like that you're about 10% faster and you saved a few variables too
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
There won't be tokens, because Espruino automatically converts them back to readable text before output - also the function you uploaded doesn't actually contain any reserved words :)
Try:
This prints:
You'll notice all the whitespace is gone - that happened inside Espruino rather than being anything the IDE did.
Also if you really want to dive around in the internals:
So the function code is now
"\xA7(\xACi=0;i<10;i\x98){print(i);}"
- so you can seefor/var/++
have been replaced by character codes>127.Just as a quick test:
So in something like that you're about 10% faster and you saved a few variables too