does not handle lines broken with "\" well
- Dominant language
- Python
- Stars
- 363
- Forks
- 24
- PR merge metrics
- No merged PRs in 30d
Description
I get parse errors on python code with lines broken with a backslash character like:
```python
assert True, \
"This is valid python, right?"
```
It gives output:
```python
Parsing of file failed: valid.py
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/pycycle/utils.py", line 70, in read_project
tree = ast.parse('\n'.join(lines))
File "/usr/lib/python2.7/ast.py", line 37, in parse
return compile(source, filename, mode, PyCF_ONLY_AST)
File "", line 2
^
SyntaxError: invalid syntax
```
#### Expected:
Also python code with backslash ending lines is parsed correctly.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at pycycle/utils.py line 70, in read_project, where the joined source is passed to ast.parse. Reproduce the issue with the provided Python snippet and trace how backslash-continued lines are read; done means that example parses without the reported SyntaxError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100