Instagram / Instagram/LibCST

Native parser crash: Mix of spaces and tabs

Open
#829 0 comments 0 reactions 0 assignees View on GitHub
bug parsing
Dominant language
Python
Stars
1.9k
Forks
229
PR merge metrics
No merged PRs in 30d

Description

The parser seems to crash on even the most trivial mixing of tabs and spaces:
```python
def foo(x):
with x:
pass
```

The indentation is: 1 tab and 1 space, followed by 2 tabs and 1 space

The error:

```pycon
>>> import libcst
>>> libcst.parse_module('''\
... def foo(x):
... with x:
... pass
... ''')
Traceback (most recent call last):
File "", line 1, in
File "/Users/tusharsadhwani/code/marvin-python/venv3/lib/python3.10/site-packages/libcst/_parser/entrypoints.py", line 109, in parse_module
result = _parse(
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.