tree-sitter-bash
tree-sitter-bash copied to clipboard
Parse error for here document inside an if with variable
Parse fails for the entire document when you have a here document inside an if, that contains a variable as the first expression.
MWE:
if true; then
a_string='some stuff to cat'
cat <<XXX
${a_string}
XXX
fi
The issue does not occur if:
- not inside an
if - there is anything except newlines before
${a_string}, including whitespace
Origin: https://github.com/mads-hartmann/bash-language-server/issues/136
Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.88. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!
Links: app homepage, dashboard and code for this bot.
Also fails with for :
for a in b c d; do
read NAME <<EOF
${a}
EOF
done
Also fails within function definitions.
It also fails everywhere.
This seems to have been fixed in the newer version of the grammar