google / pasta

Library to refactor python code through AST manipulation.
Apache License 2.0
341 stars 40 forks source link

foo[:bar] doesn't work if [:bar] is on a new line #55

Closed annarev closed 5 years ago

annarev commented 5 years ago

I am seeing an error when parsing foo[:bar] if [:bar] is on the next line.

The following code:

import pasta
pasta.parse('test(foo\n[:2])')

causes error:

pasta.base.annotate.AnnotationError: Expected '[' but found '\n'
line 1: test(foo