knrafto / language-bash

Parse and pretty-print Bash shell scripts
BSD 3-Clause "New" or "Revised" License
35 stars 9 forks source link

Pretty-printed while command indents too much #20

Closed PkmX closed 6 years ago

PkmX commented 7 years ago
> let Right e = parse "<stdin>" "while true; do :; done;" in putStrLn $ prettyText e
while true; do
                :;
            done;

For reference, the output from bash's declare -f is:

$ f() { while true; do :; done }
$ declare -f f
f () 
{ 
    while true; do
        :;
    done
}

It seems like doDone l binds too tightly that the whole block is now beside the while p; text.

knrafto commented 6 years ago

Thanks for reporting! :)