Skip to content

Commit

Permalink
Equivalent of antlr#3537
Browse files Browse the repository at this point in the history
  • Loading branch information
parrt committed Mar 26, 2022
1 parent 3cccfdb commit ad21ee9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion runtime/Go/antlr/error_strategy.go
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,11 @@ func (b *BailErrorStrategy) Recover(recognizer Parser, e RecognitionException) {
context := recognizer.GetParserRuleContext()
for context != nil {
context.SetException(e)
context = context.GetParent().(ParserRuleContext)
if parent, ok := context.GetParent().(ParserRuleContext); ok {
context = parent
} else {
context = nil
}
}
panic(NewParseCancellationException()) // TODO we don't emit e properly
}
Expand Down

0 comments on commit ad21ee9

Please sign in to comment.