1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-15 00:15:32 +02:00

Vendor: Updated dependencies

* Updated go.mod
 * Updated go.sum
 * Updated vendor packages

Signed-off-by: Glenn Vriesman <glenn.vriesman@gmail.com>
This commit is contained in:
Glenn Vriesman
2019-11-10 13:16:17 +01:00
committed by Jesse Duffield
parent 22c0d79e2d
commit 3f7e107d09
599 changed files with 40423 additions and 12085 deletions

View File

@ -1,22 +1,22 @@
package ssh_config
import (
"io"
buffruneio "github.com/pelletier/go-buffruneio"
"bytes"
)
// Define state functions
type sshLexStateFn func() sshLexStateFn
type sshLexer struct {
input *buffruneio.Reader // Textual source
buffer []rune // Runes composing the current token
inputIdx int
input []rune // Textual source
buffer []rune // Runes composing the current token
tokens chan token
line uint32
col uint16
endbufferLine uint32
endbufferCol uint16
line int
col int
endbufferLine int
endbufferCol int
}
func (s *sshLexer) lexComment(previousState sshLexStateFn) sshLexStateFn {
@ -114,16 +114,14 @@ func (s *sshLexer) lexRvalue() sshLexStateFn {
}
func (s *sshLexer) read() rune {
r, _, err := s.input.ReadRune()
if err != nil {
panic(err)
}
r := s.peek()
if r == '\n' {
s.endbufferLine++
s.endbufferCol = 1
} else {
s.endbufferCol++
}
s.inputIdx++
return r
}
@ -197,21 +195,22 @@ func (s *sshLexer) emitWithValue(t tokenType, value string) {
}
func (s *sshLexer) peek() rune {
r, _, err := s.input.ReadRune()
if err != nil {
panic(err)
if s.inputIdx >= len(s.input) {
return eof
}
s.input.UnreadRune()
r := s.input[s.inputIdx]
return r
}
func (s *sshLexer) follow(next string) bool {
inputIdx := s.inputIdx
for _, expectedRune := range next {
r, _, err := s.input.ReadRune()
defer s.input.UnreadRune()
if err != nil {
panic(err)
if inputIdx >= len(s.input) {
return false
}
r := s.input[inputIdx]
inputIdx++
if expectedRune != r {
return false
}
@ -226,10 +225,10 @@ func (s *sshLexer) run() {
close(s.tokens)
}
func lexSSH(input io.Reader) chan token {
bufferedInput := buffruneio.NewReader(input)
func lexSSH(input []byte) chan token {
runes := bytes.Runes(input)
l := &sshLexer{
input: bufferedInput,
input: runes,
tokens: make(chan token),
line: 1,
col: 1,