mirror of
https://github.com/davidhalter/parso.git
synced 2026-01-08 20:43:41 +08:00
Move the parse function to the grammar.
This commit is contained in:
@@ -114,7 +114,7 @@ def test_param_splitting():
|
||||
def check(src, result):
|
||||
# Python 2 tuple params should be ignored for now.
|
||||
grammar = load_python_grammar('%s.%s' % sys.version_info[:2])
|
||||
m = parse(src, grammar=grammar)
|
||||
m = grammar.parse(src)
|
||||
if py_version >= 30:
|
||||
assert not list(m.iter_funcdefs())
|
||||
else:
|
||||
|
||||
@@ -10,7 +10,6 @@ from textwrap import dedent
|
||||
|
||||
from parso._compatibility import py_version
|
||||
from parso import load_python_grammar
|
||||
from parso.python import parse as _parse
|
||||
from parso import ParserSyntaxError
|
||||
import pytest
|
||||
|
||||
@@ -18,7 +17,7 @@ import pytest
|
||||
def parse(code, version='3.4'):
|
||||
code = dedent(code) + "\n\n"
|
||||
grammar = load_python_grammar(version=version)
|
||||
return _parse(code, grammar=grammar, error_recovery=False)
|
||||
return grammar.parse(code, error_recovery=False)
|
||||
|
||||
|
||||
def test_formfeed():
|
||||
|
||||
Reference in New Issue
Block a user