LibCST icon indicating copy to clipboard operation
LibCST copied to clipboard

Native parser crash: Mix of spaces and tabs

Open tushar-deepsource opened this issue 3 years ago • 0 comments

The parser seems to crash on even the most trivial mixing of tabs and spaces:

def foo(x):
	 with x:
		 pass

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

The error:

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

tushar-deepsource avatar Dec 02 '22 05:12 tushar-deepsource