Move the error node checking to a rule.

This commit is contained in:
Dave Halter
2017-08-19 12:43:47 +02:00
parent 5ff33c3736
commit 820e94e03a
4 changed files with 40 additions and 15 deletions

View File

@@ -21,6 +21,7 @@ def _get_error_list(code, version=None):
tree = grammar.parse(code)
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)]
assert [(pos, error_code) for pos in positions] == errors