Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse error for here document inside an if with variable #61

Closed
skovhus opened this issue Sep 23, 2019 · 5 comments
Closed

Parse error for here document inside an if with variable #61

skovhus opened this issue Sep 23, 2019 · 5 comments
Labels

Comments

@skovhus
Copy link
Contributor

skovhus commented Sep 23, 2019

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: bash-lsp/bash-language-server#136

@issue-label-bot
Copy link

Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.88. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

@deedf
Copy link

deedf commented May 19, 2020

Also fails with for :

for a in b c d; do
     read NAME <<EOF
${a}
EOF
done

@deedf
Copy link

deedf commented May 20, 2020

Also fails within function definitions.

@brandonkal
Copy link

It also fails everywhere.

@skovhus
Copy link
Contributor Author

skovhus commented Nov 25, 2022

This seems to have been fixed in the newer version of the grammar

@skovhus skovhus closed this as completed Nov 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants