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

single quoted heredoc token cannot find end #99

Open
WillForan opened this issue Dec 29, 2024 · 0 comments
Open

single quoted heredoc token cannot find end #99

WillForan opened this issue Dec 29, 2024 · 0 comments

Comments

@WillForan
Copy link

WillForan commented Dec 29, 2024

HREDOCs with surrounding single quote are ended with the token sans quotes

cat << 'EOF'
$literal `values` "without" 'interpolation'
EOF

but bashlex expects an end token with the quotes

here-document at line 0 delimited by end-of-file (wanted "'EOF'") (position 16)

when trying

bashlex.parse(": <<'EOF'\nx\nEOF")

ending with the included quotes 'EOF' works for bashlex but not bash

bashlex.parse(": <<'EOF'\nx\n'EOF'")

[CommandNode(parts=[WordNode(parts=[] pos=(0, 1) word=':'), RedirectNode(heredoc=HeredocNode(pos=(10, 17) value="x\n'EOF'") input=None output=WordNode(parts=[] pos=(4, 9) word="'EOF'") pos=(2, 17) type='<<')] pos=(0, 9))]

bash -c "cat <<'EOF'
x
'EOF'"

bash: line 3: warning: here-document at line 1 delimited by end-of-file (wanted `EOF')

@WillForan WillForan changed the title single quoted heredoc single quoted heredoc token cannot find end Dec 29, 2024
WillForan added a commit to WillForan/bashlex that referenced this issue Dec 29, 2024
WillForan added a commit to WillForan/bashlex that referenced this issue Dec 30, 2024
WillForan added a commit to WillForan/bashlex that referenced this issue Jan 19, 2025
WillForan added a commit to WillForan/bashlex that referenced this issue Jan 19, 2025
WillForan added a commit to WillForan/bashlex that referenced this issue Jan 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant