316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
|
# File 'lib/antlr4/atn/SemanticContext.rb', line 316
def evalPrecedence(parser, outerContext)
differs = false
operands = Array.new
operands = self.opnds.map {|context|
evaluated = context.evalPrecedence(parser, outerContext)
if evaluated.equal? context then
differs = false
else
differs = true
end
return SemanticContext.NONE if evaluate.equal? SemanticContext.NONE
if not evaluated.nil? then
evaluated
end
}.compact
return self unless differs
if operands.empty?
return nil
end
result = nil
operands.each {|o|
if result.nil?
result = o
else
result = result.orContext(o)
end
}
return result
end
|