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

Translating a line with multiple bash-style "and"s / "or"s generates hanging indents #86

Open snoopyjc opened 2 years ago

snoopyjc commented 2 years ago

Translating a line with multiple bash-style "and"s / "or"s generates hanging indents. For example:

      ($ec1 = $ar2equivc{$r1})
       || ($ec1 = $ar2equivc{"$r1:stub"})
       || ($ec1 = $r1);

Leaves the indent level set to 1 afterwards.

snoopyjc commented 2 years ago

$delayed_block_closure needs to be incremented, not set to 1, then loop and decrement back to 0 inserting }

snoopyjc commented 2 years ago

Fixed in https://github.com/snoopyjc/pythonizer