Parse user code to AST using compiler flags. #784

Merged
merged 2 commits into from Sep 12, 2011

Projects

None yet

2 participants

@takluyver
Member

Closes gh-777.

@fperez fperez commented on an outdated diff Sep 12, 2011
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."""
@fperez
fperez Sep 12, 2011 IPython member

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

@fperez
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
Member

Rebased and merged. Thanks, Fernando.

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