GrammaTech/sel

`asts.ASTLanguage.Python`: invalid resulting indentation for class' docstring

Closed this issue · 1 comments

Have "test.py" python file:

class TestIndent:
    """\\ 
    """

Parse it:

import asts

with open("test.py") as f:
    text = f.read()

ast = asts.AST.from_string(text, language=asts.ASTLanguage.Python)
with open("test.parsed.py", "w") as f:
    f.write(ast.source_text)

The resulting "test.parsed.py" will have invalid indentation:

class TestIndent:
"""\\ 
    """

Moving to the internal issue tracker; thanks for the report!