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

Cannot parse line continuations in let assignment #42

Open
sarvi opened this issue Jun 6, 2019 · 1 comment
Open

Cannot parse line continuations in let assignment #42

sarvi opened this issue Jun 6, 2019 · 1 comment

Comments

@sarvi
Copy link

sarvi commented Jun 6, 2019

The following bash code throws a parsing error
let

X=1

ParsingError: unexpected token '\n' (position 3)

@samlikins
Copy link

Unable to reproduce this issue.

In a Python interactive session with bashlex version 0.18:

Python 3.10.6 (main, Mar 10 2023, 10:55:28) [GCC 11.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import bashlex
>>> bashlex.parse('let')
[CommandNode(parts=[WordNode(parts=[] pos=(0, 3) word='let')] pos=(0, 3))]
>>> bashlex.parse('let\n\n\nX=1')
[CommandNode(parts=[WordNode(parts=[] pos=(0, 3) word='let')] pos=(0, 3)), CommandNode(parts=[AssignmentNode(parts=[] pos=(6, 9) word='X=1')] pos=(6, 9))]
>>> bashlex.parse('let \
... \
... \
... X=1')
[CommandNode(parts=[WordNode(parts=[] pos=(0, 3) word='let'), WordNode(parts=[] pos=(4, 7) word='X=1')] pos=(0, 7))]

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

2 participants