gristlabs / asttokens

Annotate Python AST trees with source text and token information
Apache License 2.0
172 stars 34 forks source link

Wrong tokens for ImportFrom.names #60

Open hydrargyrum opened 4 years ago

hydrargyrum commented 4 years ago

The following sample:

import asttokens

sample = """from foo import bar"""

astt = asttokens.ASTTokens(sample, parse=True)
print(astt.tree.body[0].names[0].first_token)

displays from but it should really display bar

alexmojaki commented 4 years ago

Duplicate of #27