mirror of
https://github.com/davidhalter/parso.git
synced 2026-10-27 22:53:18 +08:00
The parse shortcut now supports a version argument.
This commit is contained in:
1 parent
b618c99b08
commit
4ffac4727c
1 file changed
+2
-1
+2
-1
@@ -31,5 +31,6 @@ def parse(code=None, **kwargs):
|
|||||||
A utility function to parse Python with the current Python version. Params
|
A utility function to parse Python with the current Python version. Params
|
||||||
are documented in ``Grammar.parse``.
|
are documented in ``Grammar.parse``.
|
||||||
"""
|
"""
|
||||||
grammar = load_grammar()
|
version = kwargs.pop('version', None)
|
||||||
|
grammar = load_grammar(version=version)
|
||||||
return grammar.parse(code, **kwargs)
|
return grammar.parse(code, **kwargs)
|
||||||
Reference in new issue
Block a user