Parse user code to AST using compiler flags. #784

Merged
merged 2 commits into from Sep 12, 2011

Conversation

Projects
None yet
2 participants
@takluyver
Member

takluyver commented Sep 12, 2011

Closes gh-777.

@fperez

View changes

IPython/core/compilerop.py
@@ -77,6 +78,16 @@ class CachingCompiler(codeop.Compile):
# stdlib that call it outside our control go through our codepath
# (otherwise we'd lose our tracebacks).
linecache.checkcache = self.check_cache
+
+ def ast_parse(self, source, filename='<unknown>', symbol='exec'):
+ """Parse code to an AST with the current compiler flags active."""

This comment has been minimized.

@fperez

fperez Sep 12, 2011

Member

Indicate in the docstring that all arguments are the same as those passed to the builtin compile() call.

@fperez

fperez Sep 12, 2011

Member

Indicate in the docstring that all arguments are the same as those passed to the builtin compile() call.

@fperez

This comment has been minimized.

Show comment
Hide comment
@fperez

fperez Sep 12, 2011

Member

Other than my tiny inline comment, this looks perfect. Once that's fixed, go ahead and merge. Thanks!

Member

fperez commented Sep 12, 2011

Other than my tiny inline comment, this looks perfect. Once that's fixed, go ahead and merge. Thanks!

@takluyver takluyver merged commit ca3e756 into ipython:master Sep 12, 2011

@takluyver

This comment has been minimized.

Show comment
Hide comment
@takluyver

takluyver Sep 12, 2011

Member

Rebased and merged. Thanks, Fernando.

Member

takluyver commented Sep 12, 2011

Rebased and merged. Thanks, Fernando.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment