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:
parrt 2016-11-19 14:51:12 -08:00
parent f0177c96f8
commit c0b5a40bcf
1 changed files with 2 additions and 2 deletions

View File

@ -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)]