Fix compatibility with latest go-buffruneio (#131)
This commit is contained in:
@@ -36,7 +36,7 @@ type tomlLexer struct {
|
|||||||
// Basic read operations on input
|
// Basic read operations on input
|
||||||
|
|
||||||
func (l *tomlLexer) read() rune {
|
func (l *tomlLexer) read() rune {
|
||||||
r, err := l.input.ReadRune()
|
r, _, err := l.input.ReadRune()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
@@ -89,7 +89,7 @@ func (l *tomlLexer) emit(t tokenType) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (l *tomlLexer) peek() rune {
|
func (l *tomlLexer) peek() rune {
|
||||||
r, err := l.input.ReadRune()
|
r, _, err := l.input.ReadRune()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
@@ -99,7 +99,7 @@ func (l *tomlLexer) peek() rune {
|
|||||||
|
|
||||||
func (l *tomlLexer) follow(next string) bool {
|
func (l *tomlLexer) follow(next string) bool {
|
||||||
for _, expectedRune := range next {
|
for _, expectedRune := range next {
|
||||||
r, err := l.input.ReadRune()
|
r, _, err := l.input.ReadRune()
|
||||||
defer l.input.UnreadRune()
|
defer l.input.UnreadRune()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
@@ -219,7 +219,7 @@ func (l *tomlLexer) lexRvalue() tomlLexStateFn {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
possibleDate := string(l.input.Peek(35))
|
possibleDate := string(l.input.PeekRunes(35))
|
||||||
dateMatch := dateRegexp.FindString(possibleDate)
|
dateMatch := dateRegexp.FindString(possibleDate)
|
||||||
if dateMatch != "" {
|
if dateMatch != "" {
|
||||||
l.fastForward(len(dateMatch))
|
l.fastForward(len(dateMatch))
|
||||||
|
|||||||
Reference in New Issue
Block a user