RapydScript icon indicating copy to clipboard operation
RapydScript copied to clipboard

Compiler issues

Open savethekiddes opened this issue 2 years ago • 1 comments

array = ["oof", "lol", "test", "jip"]
for item in array:
    console.log(item)

compiles to

(function(){"use strict";function ՐՏ_Iterable(iterable){var tmp;if(iterable.constructor===[].constructor||iterable.constructor==="".constructor||(tmp=Array.prototype.slice.call(iterable)).length){return tmp||iterable}if(Set&&iterable.constructor===Set){return Array.from(iterable)}return Object.keys(iterable)}(function(){var __name__="__main__"var ՐՏitr1,ՐՏidx1;;var array,item;array=["oof","lol","test","jip"];ՐՏitr1=ՐՏ_Iterable(array);for(ՐՏidx1=0;ՐՏidx1<ՐՏitr1.length;ՐՏidx1++){item=ՐՏitr1[ՐՏidx1];console.log(item)}})();})();

Near var__name__="__main__" there's a random var (that has to be removed manually and subsituted with a comma). Any idea on why does this happen? Am I using the compiler wrong? Thanks

savethekiddes avatar Feb 10 '23 11:02 savethekiddes

try using -p / --prettify

mardon86 avatar Jul 15 '23 08:07 mardon86