We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
for the code as following
code = '''cat << EOF abc def EOF''' ret = bashlex.parse(code) print(ret[0].dump())
we got:
CommandNode(pos=(0, 9), parts=[ WordNode(pos=(0, 3), word='cat'), RedirectNode(heredoc= HeredocNode(pos=(10, 21), value='abc\ndef\nEOF'), output= WordNode(pos=(6, 9), word='EOF'), pos=(4, 21), type='<<'), ])
that's fine so far.
but for the code:
code = '''function foo () { cat << EOF abc def EOF }''' ret = bashlex.parse(code) print(ret[0].dump())
FunctionNode(pos=(0, 40), parts=[ ReservedwordNode(pos=(0, 8), word='function'), WordNode(pos=(9, 12), word='foo'), ReservedwordNode(pos=(12, 13), word='('), ReservedwordNode(pos=(13, 14), word=')'), CompoundNode(list=[ ReservedwordNode(pos=(15, 16), word='{'), ListNode(pos=(17, 39), parts=[ CommandNode(pos=(17, 26), parts=[ WordNode(pos=(17, 20), word='cat'), RedirectNode(heredoc= HeredocNode(pos=(31, 38), value='def\nEOF'), output= WordNode(pos=(23, 26), word='EOF'), pos=(21, 26), type='<<'), ]), OperatorNode(op='\n', pos=(26, 27)), CommandNode(pos=(27, 30), parts=[ WordNode(pos=(27, 30), word='abc'), ]), OperatorNode(op='\n', pos=(30, 39)), ]), ReservedwordNode(pos=(39, 40), word='}'), ], pos=(15, 40)), ])
in this case, abc no longer a part of the heredoc, but came out as a standalone CommandNode.
abc
The text was updated successfully, but these errors were encountered:
No branches or pull requests
for the code as following
we got:
that's fine so far.
but for the code:
we got:
in this case,
abc
no longer a part of the heredoc, but came out as a standalone CommandNode.The text was updated successfully, but these errors were encountered: