Parse user code to AST using compiler flags. #784

merged 2 commits into from Sep 12, 2011

2 participants

IPython member

Closes gh-777.

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

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

IPython member

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
IPython member

Rebased and merged. Thanks, Fernando.

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