typos
This commit is contained in:
parent
e6d27c7a7c
commit
2f4f36d60c
|
@ -298,9 +298,9 @@ def merge(a:PredictionContext, b:PredictionContext, rootIsWildcard:bool, mergeCa
|
|||
|
||||
# convert singleton so both are arrays to normalize
|
||||
if isinstance( a, SingletonPredictionContext ):
|
||||
a = ArrayPredictionContext([a.parent], [a.returnState])
|
||||
a = ArrayPredictionContext([a.parentCtx], [a.returnState])
|
||||
if isinstance( b, SingletonPredictionContext):
|
||||
b = ArrayPredictionContext([b.parent], [b.returnState])
|
||||
b = ArrayPredictionContext([b.parentCtx], [b.returnState])
|
||||
return mergeArrays(a, b, rootIsWildcard, mergeCache)
|
||||
|
||||
|
||||
|
|
|
@ -60,8 +60,6 @@ class ATNConfig(object):
|
|||
if semantic is None:
|
||||
semantic = SemanticContext.NONE
|
||||
|
||||
if not isinstance(state, ATNState):
|
||||
pass
|
||||
# The ATN state associated with this configuration#/
|
||||
self.state = state
|
||||
# What alt (or lexer rule) is predicted by this configuration#/
|
||||
|
@ -83,7 +81,6 @@ class ATNConfig(object):
|
|||
self.reachesIntoOuterContext = 0 if config is None else config.reachesIntoOuterContext
|
||||
self.precedenceFilterSuppressed = False if config is None else config.precedenceFilterSuppressed
|
||||
|
||||
|
||||
# An ATN configuration is equal to another if both have
|
||||
# the same state, they predict the same alternative, and
|
||||
# syntactic/semantic contexts are the same.
|
||||
|
|
|
@ -327,7 +327,7 @@ class OR (SemanticContext):
|
|||
for context in self.opnds:
|
||||
evaluated = context.evalPrecedence(parser, outerContext)
|
||||
differs |= evaluated is not context
|
||||
if evaluate is SemanticContext.NONE:
|
||||
if evaluated is SemanticContext.NONE:
|
||||
# The OR context is true if any element is true
|
||||
return SemanticContext.NONE
|
||||
elif evaluated is not None:
|
||||
|
|
Loading…
Reference in New Issue