| 1 | package ssh_configscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/ |
| 2 | |
| 3 | import ( |
| 4 | "bytesscip-go gomod github.com/golang/go/src go1.18 bytes/" |
| 5 | ) |
| 6 | |
| 7 | // Define state functions |
| 8 | type sshLexStateFnscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexStateFn# func() sshLexStateFnscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexStateFn# |
| 9 | |
| 10 | type sshLexerscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer# struct { |
| 11 | inputIdxscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#inputIdx. int |
| 12 | inputscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#input. []rune // Textual source |
| 13 | |
| 14 | bufferscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#buffer. []rune // Runes composing the current token |
| 15 | tokensscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#tokens. chan tokenscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/token# |
| 16 | linescip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#line. int |
| 17 | colscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#col. int |
| 18 | endbufferLinescip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#endbufferLine. int |
| 19 | endbufferColscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#endbufferCol. int |
| 20 | } |
| 21 | |
| 22 | func (s *sshLexerscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#) lexCommentscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#lexComment().(previousState sshLexStateFnscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexStateFn#) sshLexStateFnscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexStateFn# { |
| 23 | return func() sshLexStateFnscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexStateFn# { |
| 24 | growingString := "" |
| 25 | for next := s.peekscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#peek().(); next != '\n' && next != eofscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/eof.; next = s.peekscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#peek().() { |
| 26 | if next == '\r' && s.followscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#follow().("\r\n") { |
| 27 | break |
| 28 | } |
| 29 | growingString += string(next) |
| 30 | s.nextscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#next().() |
| 31 | } |
| 32 | s.emitWithValuescip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#emitWithValue().(tokenCommentscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/tokenComment., growingString) |
| 33 | s.skipscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#skip().() |
| 34 | return previousState |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | // lex the space after an equals sign in a function |
| 39 | func (s *sshLexerscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#) lexRspacescip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#lexRspace().() sshLexStateFnscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexStateFn# { |
| 40 | for { |
| 41 | next := s.peekscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#peek().() |
| 42 | if !isSpacescip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/isSpace().(next) { |
| 43 | break |
| 44 | } |
| 45 | s.skipscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#skip().() |
| 46 | } |
| 47 | return s.lexRvaluescip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#lexRvalue(). |
| 48 | } |
| 49 | |
| 50 | func (s *sshLexerscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#) lexEqualsscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#lexEquals().() sshLexStateFnscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexStateFn# { |
| 51 | for { |
| 52 | next := s.peekscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#peek().() |
| 53 | if next == '=' { |
| 54 | s.emitscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#emit().(tokenEqualsscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/tokenEquals.) |
| 55 | s.skipscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#skip().() |
| 56 | return s.lexRspacescip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#lexRspace(). |
| 57 | } |
| 58 | // TODO error handling here; newline eof etc. |
| 59 | if !isSpacescip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/isSpace().(next) { |
| 60 | break |
| 61 | } |
| 62 | s.skipscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#skip().() |
| 63 | } |
| 64 | return s.lexRvaluescip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#lexRvalue(). |
| 65 | } |
| 66 | |
| 67 | func (s *sshLexerscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#) lexKeyscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#lexKey().() sshLexStateFnscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexStateFn# { |
| 68 | growingString := "" |
| 69 | |
| 70 | for r := s.peekscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#peek().(); isKeyCharscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/isKeyChar().(r); r = s.peekscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#peek().() { |
| 71 | // simplified a lot here |
| 72 | if isSpacescip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/isSpace().(r) || r == '=' { |
| 73 | s.emitWithValuescip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#emitWithValue().(tokenKeyscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/tokenKey., growingString) |
| 74 | s.skipscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#skip().() |
| 75 | return s.lexEqualsscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#lexEquals(). |
| 76 | } |
| 77 | growingString += string(r) |
| 78 | s.nextscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#next().() |
| 79 | } |
| 80 | s.emitWithValuescip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#emitWithValue().(tokenKeyscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/tokenKey., growingString) |
| 81 | return s.lexEqualsscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#lexEquals(). |
| 82 | } |
| 83 | |
| 84 | func (s *sshLexerscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#) lexRvaluescip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#lexRvalue().() sshLexStateFnscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexStateFn# { |
| 85 | growingString := "" |
| 86 | for { |
| 87 | next := s.peekscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#peek().() |
| 88 | switch next { |
| 89 | case '\r': |
| 90 | if s.followscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#follow().("\r\n") { |
| 91 | s.emitWithValuescip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#emitWithValue().(tokenStringscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/tokenString., growingString) |
| 92 | s.skipscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#skip().() |
| 93 | return s.lexVoidscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#lexVoid(). |
| 94 | } |
| 95 | case '\n': |
| 96 | s.emitWithValuescip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#emitWithValue().(tokenStringscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/tokenString., growingString) |
| 97 | s.skipscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#skip().() |
| 98 | return s.lexVoidscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#lexVoid(). |
| 99 | case '#': |
| 100 | s.emitWithValuescip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#emitWithValue().(tokenStringscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/tokenString., growingString) |
| 101 | s.skipscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#skip().() |
| 102 | return s.lexCommentscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#lexComment().(s.lexVoidscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#lexVoid().) |
| 103 | case eofscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/eof.: |
| 104 | s.nextscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#next().() |
| 105 | } |
| 106 | if next == eofscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/eof. { |
| 107 | break |
| 108 | } |
| 109 | growingString += string(next) |
| 110 | s.nextscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#next().() |
| 111 | } |
| 112 | s.emitscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#emit().(tokenEOFscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/tokenEOF.) |
| 113 | return nil |
| 114 | } |
| 115 | |
| 116 | func (s *sshLexerscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#) readscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#read().() rune { |
| 117 | r := s.peekscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#peek().() |
| 118 | if r == '\n' { |
| 119 | s.endbufferLinescip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#endbufferLine.++ |
| 120 | s.endbufferColscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#endbufferCol. = 1 |
| 121 | } else { |
| 122 | s.endbufferColscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#endbufferCol.++ |
| 123 | } |
| 124 | s.inputIdxscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#inputIdx.++ |
| 125 | return r |
| 126 | } |
| 127 | |
| 128 | func (s *sshLexerscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#) nextscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#next().() rune { |
| 129 | r := s.readscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#read().() |
| 130 | |
| 131 | if r != eofscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/eof. { |
| 132 | s.bufferscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#buffer. = append(s.bufferscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#buffer., r) |
| 133 | } |
| 134 | return r |
| 135 | } |
| 136 | |
| 137 | func (s *sshLexerscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#) lexVoidscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#lexVoid().() sshLexStateFnscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexStateFn# { |
| 138 | for { |
| 139 | next := s.peekscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#peek().() |
| 140 | switch next { |
| 141 | case '#': |
| 142 | s.skipscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#skip().() |
| 143 | return s.lexCommentscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#lexComment().(s.lexVoidscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#lexVoid().) |
| 144 | case '\r': |
| 145 | fallthrough |
| 146 | case '\n': |
| 147 | s.emitscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#emit().(tokenEmptyLinescip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/tokenEmptyLine.) |
| 148 | s.skipscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#skip().() |
| 149 | continue |
| 150 | } |
| 151 | |
| 152 | if isSpacescip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/isSpace().(next) { |
| 153 | s.skipscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#skip().() |
| 154 | } |
| 155 | |
| 156 | if isKeyStartCharscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/isKeyStartChar().(next) { |
| 157 | return s.lexKeyscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#lexKey(). |
| 158 | } |
| 159 | |
| 160 | // removed IsKeyStartChar and lexKey. probably will need to readd |
| 161 | |
| 162 | if next == eofscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/eof. { |
| 163 | s.nextscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#next().() |
| 164 | break |
| 165 | } |
| 166 | } |
| 167 | |
| 168 | s.emitscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#emit().(tokenEOFscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/tokenEOF.) |
| 169 | return nil |
| 170 | } |
| 171 | |
| 172 | func (s *sshLexerscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#) ignorescip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#ignore().() { |
| 173 | s.bufferscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#buffer. = make([]rune, 0) |
| 174 | s.linescip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#line. = s.endbufferLinescip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#endbufferLine. |
| 175 | s.colscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#col. = s.endbufferColscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#endbufferCol. |
| 176 | } |
| 177 | |
| 178 | func (s *sshLexerscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#) skipscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#skip().() { |
| 179 | s.nextscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#next().() |
| 180 | s.ignorescip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#ignore().() |
| 181 | } |
| 182 | |
| 183 | func (s *sshLexerscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#) emitscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#emit().(t tokenTypescip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/tokenType#) { |
| 184 | s.emitWithValuescip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#emitWithValue().(t, string(s.bufferscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#buffer.)) |
| 185 | } |
| 186 | |
| 187 | func (s *sshLexerscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#) emitWithValuescip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#emitWithValue().(t tokenTypescip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/tokenType#, value string) { |
| 188 | tok := tokenscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/token#{ |
| 189 | Positionscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/token#Position.: Positionscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/Position#{s.linescip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#line., s.colscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#col.}, |
| 190 | typscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/token#typ.: t, |
| 191 | valscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/token#val.: value, |
| 192 | } |
| 193 | s.tokensscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#tokens. <- tok |
| 194 | s.ignorescip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#ignore().() |
| 195 | } |
| 196 | |
| 197 | func (s *sshLexerscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#) peekscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#peek().() rune { |
| 198 | if s.inputIdxscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#inputIdx. >= len(s.inputscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#input.) { |
| 199 | return eofscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/eof. |
| 200 | } |
| 201 | |
| 202 | r := s.inputscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#input.[s.inputIdxscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#inputIdx.] |
| 203 | return r |
| 204 | } |
| 205 | |
| 206 | func (s *sshLexerscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#) followscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#follow().(next string) bool { |
| 207 | inputIdx := s.inputIdxscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#inputIdx. |
| 208 | for _, expectedRune := range next { |
| 209 | if inputIdx >= len(s.inputscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#input.) { |
| 210 | return false |
| 211 | } |
| 212 | r := s.inputscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#input.[inputIdx] |
| 213 | inputIdx++ |
| 214 | if expectedRune != r { |
| 215 | return false |
| 216 | } |
| 217 | } |
| 218 | return true |
| 219 | } |
| 220 | |
| 221 | func (s *sshLexerscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#) runscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#run().() { |
| 222 | for state := s.lexVoidscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#lexVoid().; state != nil; { |
| 223 | state = state() |
| 224 | } |
| 225 | close(s.tokensscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#tokens.) |
| 226 | } |
| 227 | |
| 228 | func lexSSHscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/lexSSH().(input []byte) chan tokenscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/token# { |
| 229 | runes := bytesscip-go gomod github.com/golang/go/src go1.18 bytes/.Runesscip-go gomod github.com/golang/go/src go1.18 bytes/Runes().(input) |
| 230 | l := &sshLexerscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#{ |
| 231 | inputscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#input.: runes, |
| 232 | tokensscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#tokens.: make(chan tokenscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/token#), |
| 233 | linescip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#line.: 1, |
| 234 | colscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#col.: 1, |
| 235 | endbufferLinescip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#endbufferLine.: 1, |
| 236 | endbufferColscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#endbufferCol.: 1, |
| 237 | } |
| 238 | go l.runscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#run().() |
| 239 | return l.tokensscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/sshLexer#tokens. |
| 240 | } |