Open pveyes opened 5 years ago
I think the solution depends on the goal itself. If the transpiler goal is to create an optimized javascript code, it is better to create a shorter identifier to reduce the parsing time (?). For another case, why don't make all of the javascript keyword a reserved keyword? Adding something to the identifier is more counter-intuitive for me and it will be a special case that people might have to remember if they wants to interact with the generated code.
Currently we can use any reserved word/token (such as
var
,if
, etc) as identifier in naskah which won't be valid JS. The simplest thing we can do is add underscore before printing the identifier if it's a reserved word in JSSo that:
should be compiled to