Closed Mercerenies closed 2 years ago
Consider how much name translation should take place.
if => _if
) Remember, underscore-escaping, at the moment, also takes place on primitive names.foo-bar => foo_bar
or colorful? => is_colorful
)7b1d4972229a39371d4123e9e526721ec2613d0c closes this issue.
We do the usual escaping on symbols but no keyword escaping, to allow access to underlying GDScript primitives.
Provide a
literally
directive.literally
takes a literal symbol and outputs that symbol literally in the output code, bypassing any of the usual variable scope rules.This can be used in two ways.
These translations will take place regardless of whether there's a variable/function with the name
foo
in scope. Further, no macros or symbol macros with namefoo
will get expanded in either case;literally
always bypasses macro calls.This will primarily be used for testing purposes, but I don't think we should put it in
sys/
because I feel that users may find it useful in macro expansion in some rare cases, and the behavior is pretty well-defined and simple.