From d0ec4317d3eff58f2e21f49b84f8f1ca97d066e6 Mon Sep 17 00:00:00 2001 From: Thomas Pelletier <pelletier.thomas@gmail.com> Date: Mon, 27 Feb 2017 14:18:12 -0800 Subject: [PATCH] Fix compatibility with latest go-buffruneio (#131) --- lexer.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lexer.go b/lexer.go index 4ba134c3..104f3b1f 100644 --- a/lexer.go +++ b/lexer.go @@ -36,7 +36,7 @@ type tomlLexer struct { // Basic read operations on input func (l *tomlLexer) read() rune { - r, err := l.input.ReadRune() + r, _, err := l.input.ReadRune() if err != nil { panic(err) } @@ -89,7 +89,7 @@ func (l *tomlLexer) emit(t tokenType) { } func (l *tomlLexer) peek() rune { - r, err := l.input.ReadRune() + r, _, err := l.input.ReadRune() if err != nil { panic(err) } @@ -99,7 +99,7 @@ func (l *tomlLexer) peek() rune { func (l *tomlLexer) follow(next string) bool { for _, expectedRune := range next { - r, err := l.input.ReadRune() + r, _, err := l.input.ReadRune() defer l.input.UnreadRune() if err != nil { panic(err) @@ -219,7 +219,7 @@ func (l *tomlLexer) lexRvalue() tomlLexStateFn { break } - possibleDate := string(l.input.Peek(35)) + possibleDate := string(l.input.PeekRunes(35)) dateMatch := dateRegexp.FindString(possibleDate) if dateMatch != "" { l.fastForward(len(dateMatch))