Unable to parse heredoc inside a block properly
Config:
<main>
PYTHON <<MYPYTHON
def a():
x = y
return
MYPYTHON
</main>
With python version of config parser I am getting parse error
But with perl version:
$VAR1 = {
'main' => {
'PYTHON' => 'def a():
x = y
return'
}
};
Can you please check?
The issue here is that closing MYPYTHON anchor is indented. I've modified the lexer to allow that (see commit 8a9f5b34bb1bd07e44fa94fb0b9b76181d37bb58).
But now I am curious how would you include MYPYTHON content into the heredoc block? There should be some sort of escaping, right?
Hmm, is it a good idea to allow whitespaces around the anchor? At least with bash, this is not allowed.
This is working with current version of code.
It does, but I feel like this may break things elsewhere. May be we should better make this behavior configurable.
I agree. It would be great of we have some option to enable PERL heredoc and keep default as BASH here doc.
Hey, @sydneyli! Do you think this has been fixed lately?
The behavior in the original issue fixed, but extra whitespaces after the closing heredoc anchor seems to still break things. Edit: It might be good to change the title of this issue to reflect the above?