Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse import __future__ from x as a future import statement #34

Closed
rewinfrey opened this issue Aug 9, 2018 · 0 comments
Closed

Parse import __future__ from x as a future import statement #34

rewinfrey opened this issue Aug 9, 2018 · 0 comments

Comments

@rewinfrey
Copy link
Member

According to the Python docs, future statements are a special form of import statements.

Currently parsing the following code

from __future__ import print_function

produces

(module [0, 0] - [1, 0]
  (import_from_statement [0, 0] - [0, 37]
    (dotted_name [0, 5] - [0, 15]
      (identifier [0, 5] - [0, 15]))
    (dotted_name [0, 23] - [0, 37]
      (identifier [0, 23] - [0, 37]))))

but ideally this would emit a tree like:

(module [0, 0] - [1, 0]
  (future_import_statement [0, 0] - [0, 37]
    (dotted_name [0, 23] - [0, 37]
      (identifier [0, 23] - [0, 37]))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant