Move the utility function parse to the __init__ script.

This commit is contained in:
Dave Halter
2017-05-24 00:08:09 -04:00
parent 25941bbfb8
commit f2c257d7dd
11 changed files with 19 additions and 17 deletions

View File

@@ -20,4 +20,14 @@ PythonNode(simple_stmt, [PythonNode(arith_expr, [...]), <Newline: ''>])
from parso.parser import ParserSyntaxError
from parso.grammar import create_grammar, load_python_grammar
def parse(code=None, **kwargs):
"""
A utility function to parse Python with the current Python version. Params
are documented in ``Grammar.parse``.
"""
grammar = load_python_grammar()
return grammar.parse(code, **kwargs)
__version__ = '0.0.2'