lib/antlr4/runtime/parser_atn_simulator.rb in antlr4-runtime-0.2.5 vs lib/antlr4/runtime/parser_atn_simulator.rb in antlr4-runtime-0.2.6

- old
+ new

@@ -113,20 +113,21 @@ # We will get an error no matter what so delay until after # decision better error message. Also, no reachable target # ATN states in SLL implies LL will also get nowhere. # If conflict in states that dip out, choose min since we # will get error no matter what. - input.seek(start_index) - alt = syn_valid_or_sem_invalid_alt_that_finished_decision_entry_rule(previous_d.configs, outer_ctx) - return alt if alt != ATN::INVALID_ALT_NUMBER - exc = NoViableAltException.new exc.recognizer = @parser exc.input = input exc.context = outer_ctx exc.start_token = input.get(start_index) exc.offending_token = input.lt(1) exc.dead_end_configs = previous_d.configs + + input.seek(start_index) + alt = syn_valid_or_sem_invalid_alt_that_finished_decision_entry_rule(previous_d.configs, outer_ctx) + return alt if alt != ATN::INVALID_ALT_NUMBER + raise exc end if d.requires_full_context && @mode != PredictionMode::SLL # IF PREDS, MIGHT RESOLVE TO SINGLE ALT => SLL (or syntax error)