mirror of
https://github.com/davidhalter/parso.git
synced 2026-01-01 00:53:39 +08:00
The parse shortcut now supports a version argument.
This commit is contained in:
@@ -31,5 +31,6 @@ def parse(code=None, **kwargs):
|
||||
A utility function to parse Python with the current Python version. Params
|
||||
are documented in ``Grammar.parse``.
|
||||
"""
|
||||
grammar = load_grammar()
|
||||
version = kwargs.pop('version', None)
|
||||
grammar = load_grammar(version=version)
|
||||
return grammar.parse(code, **kwargs)
|
||||
|
||||
Reference in New Issue
Block a user