diff --git a/jlexer/lexer.go b/jlexer/lexer.go index fc0af92..2911e8a 100644 --- a/jlexer/lexer.go +++ b/jlexer/lexer.go @@ -1026,6 +1026,14 @@ func (r *Lexer) AddError(e error) { } } +func (r *Lexer) AddMultipleError(e error) { + r.addNonfatalError(&LexerError{ + Offset: r.start, + Data: string(r.Data[r.start:r.pos]), + Reason: e.Error(), + }) +} + func (r *Lexer) addNonfatalError(err *LexerError) { if r.UseMultipleErrors { // We don't want to add errors with the same offset.