Move the iter_errors and normalizer methods to grammar.py.

This commit is contained in:
Dave Halter
2017-08-06 15:32:50 +02:00
parent 3e39a04bb1
commit 90edb2d0cf
9 changed files with 47 additions and 40 deletions

View File

@@ -13,7 +13,7 @@ from .failing_examples import FAILING_EXAMPLES, indent, build_nested
def _get_error_list(code, version=None):
grammar = parso.load_grammar(version=version)
tree = grammar.parse(code)
return list(tree._iter_errors(grammar))
return list(grammar.iter_errors(tree))
def assert_comparison(code, error_code, positions):
errors = [(error.start_pos, error.code) for error in _get_error_list(code)]