Skip to content

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

@Root-Core

Description

@Root-Core

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions