softpano / pythonizer

Translator (or more correctly transcriber) from Perl to Python
http://www.softpanorama.org/Scripting/Pythonorama/Python_for_perl_programmers/Pythonizer/index.shtml
Other
39 stars 17 forks source link

If {q} used as a hash key - pythonizer thinks it's a q/.../ string #89

Open snoopyjc opened 2 years ago

snoopyjc commented 2 years ago

If {q} used as a hash key - pythonizer thinks it's a q/.../ string. For example:

$interfaces{q} = $exp2q{$1};

causes incorrect code generation.

snoopyjc commented 2 years ago

It's actually worse than this - if any keyword is used as a bare key it generates bad code

snoopyjc commented 2 years ago

Implemented in https://github.com/snoopyjc/pythonizer v0.920