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

heredoc parsing broken, if line starts with '<' #97

Open
Root-Core opened this issue Sep 13, 2024 · 0 comments
Open

heredoc parsing broken, if line starts with '<' #97

Root-Core opened this issue Sep 13, 2024 · 0 comments

Comments

@Root-Core
Copy link

Root-Core commented Sep 13, 2024

While parsing this part of a huge script (winetricks), I encountered an issue.

https://github.com/Winetricks/winetricks/blob/72b934e1e10c041ec6986f5f2fb4f143d8f6b941/src/winetricks#L16847-L16852

cat > "${W_TMP}"/config.xml <<__EOF__
<Configuration Product="ProPlus">
<Display Level="none" CompletionNotice="no" SuppressModal="yes" AcceptEula="yes" />
<PIDKEY Value="${W_KEY}" />
</Configuration>
__EOF__

Results in

bashlex.errors.ParsingError: unexpected token '\n' (position 872)

I worked around it by just replacing the < char for the moment.

text = text.replace('\n<', '\n#<')

This issue seems to be related to #36 - my first guess is that the parser is not interpreting the string as text, but is trying to parse it as bash or something like that.

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