knrafto / language-bash

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

Fix parsing of multiple heredocs #26

Closed knrafto closed 4 years ago

knrafto commented 4 years ago

Consider

cat <<EOF1 <<EOF2
t1
EOF1
t2
EOF2

Previously, the parser would not consume the newline after EOF1 on line 3, meaning the second heredoc would incorrectly have a leading newline.

This came up in #24