mirror of
https://github.com/davidhalter/parso.git
synced 2026-04-14 03:39:49 +08:00
Refactor a bit for Python 2.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from contextlib import contextmanager
|
||||
|
||||
from parso.normalizer import Normalizer, NormalizerConfig, Issue
|
||||
@@ -656,3 +657,6 @@ class ErrorFinder(Normalizer):
|
||||
|
||||
class ErrorFinderConfig(NormalizerConfig):
|
||||
normalizer_class = ErrorFinder
|
||||
|
||||
def __init__(self, grammar):
|
||||
self.grammar = grammar
|
||||
|
||||
@@ -99,8 +99,8 @@ class PythonMixin(object):
|
||||
return result
|
||||
return None
|
||||
|
||||
def _iter_errors(self):
|
||||
config = normalizer.ErrorFinderConfig()
|
||||
def _iter_errors(self, grammar):
|
||||
config = normalizer.ErrorFinderConfig(grammar)
|
||||
return self._get_normalizer_issues(config)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user