diff options
author | Christopher Speller <crspeller@gmail.com> | 2017-06-21 19:06:17 -0700 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2017-06-21 19:06:17 -0700 |
commit | 42f28ab8e374137fe3f5d25424489d879d4724f8 (patch) | |
tree | 20353f2446b506d32e6d353b72a57bf48f070389 /vendor/github.com/pelletier/go-toml/lexer.go | |
parent | 6b39c308d882a0aeac533f8ab1d90b48a2ae4b5a (diff) | |
download | chat-42f28ab8e374137fe3f5d25424489d879d4724f8.tar.gz chat-42f28ab8e374137fe3f5d25424489d879d4724f8.tar.bz2 chat-42f28ab8e374137fe3f5d25424489d879d4724f8.zip |
Updating server dependancies (#6712)
Diffstat (limited to 'vendor/github.com/pelletier/go-toml/lexer.go')
-rw-r--r-- | vendor/github.com/pelletier/go-toml/lexer.go | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/vendor/github.com/pelletier/go-toml/lexer.go b/vendor/github.com/pelletier/go-toml/lexer.go index 104f3b1f4..db3ab4e54 100644 --- a/vendor/github.com/pelletier/go-toml/lexer.go +++ b/vendor/github.com/pelletier/go-toml/lexer.go @@ -6,6 +6,7 @@ package toml import ( + "bytes" "errors" "fmt" "io" @@ -24,7 +25,7 @@ type tomlLexStateFn func() tomlLexStateFn // Define lexer type tomlLexer struct { input *buffruneio.Reader // Textual source - buffer []rune // Runes composing the current token + buffer bytes.Buffer // Runes composing the current token tokens chan token depth int line int @@ -53,13 +54,13 @@ func (l *tomlLexer) next() rune { r := l.read() if r != eof { - l.buffer = append(l.buffer, r) + l.buffer.WriteRune(r) } return r } func (l *tomlLexer) ignore() { - l.buffer = make([]rune, 0) + l.buffer.Reset() l.line = l.endbufferLine l.col = l.endbufferCol } @@ -85,7 +86,7 @@ func (l *tomlLexer) emitWithValue(t tokenType, value string) { } func (l *tomlLexer) emit(t tokenType) { - l.emitWithValue(t, string(l.buffer)) + l.emitWithValue(t, l.buffer.String()) } func (l *tomlLexer) peek() rune { @@ -536,7 +537,7 @@ func (l *tomlLexer) lexInsideTableArrayKey() tomlLexStateFn { for r := l.peek(); r != eof; r = l.peek() { switch r { case ']': - if len(l.buffer) > 0 { + if l.buffer.Len() > 0 { l.emit(tokenKeyGroupArray) } l.next() @@ -559,7 +560,7 @@ func (l *tomlLexer) lexInsideTableKey() tomlLexStateFn { for r := l.peek(); r != eof; r = l.peek() { switch r { case ']': - if len(l.buffer) > 0 { + if l.buffer.Len() > 0 { l.emit(tokenKeyGroup) } l.next() |