forked from jasder/antlr
Python3 target filterPrecedencePredicates should take collection:set not list as hint. Manual implementation of https://github.com/antlr/antlr4/pull/1247/files
This commit is contained in:
parent
f0177c96f8
commit
c0b5a40bcf
|
@ -36,9 +36,9 @@
|
||||||
# <p>I have scoped the {@link AND}, {@link OR}, and {@link Predicate} subclasses of
|
# <p>I have scoped the {@link AND}, {@link OR}, and {@link Predicate} subclasses of
|
||||||
# {@link SemanticContext} within the scope of this outer class.</p>
|
# {@link SemanticContext} within the scope of this outer class.</p>
|
||||||
#
|
#
|
||||||
from io import StringIO
|
|
||||||
from antlr4.Recognizer import Recognizer
|
from antlr4.Recognizer import Recognizer
|
||||||
from antlr4.RuleContext import RuleContext
|
from antlr4.RuleContext import RuleContext
|
||||||
|
from io import StringIO
|
||||||
|
|
||||||
|
|
||||||
class SemanticContext(object):
|
class SemanticContext(object):
|
||||||
|
@ -115,7 +115,7 @@ def orContext(a:SemanticContext, b:SemanticContext):
|
||||||
else:
|
else:
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def filterPrecedencePredicates(collection:list):
|
def filterPrecedencePredicates(collection:set):
|
||||||
return [context for context in collection if isinstance(context, PrecedencePredicate)]
|
return [context for context in collection if isinstance(context, PrecedencePredicate)]
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue