MCPcopy Create free account
hub / github.com/OpenAtomFoundation/SmartIDE / lexRvalue

Method lexRvalue

cli/pkg/ssh_config/lexer.go:89–119  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

87}
88
89func (s *sshLexer) lexRvalue() sshLexStateFn {
90 growingString := ""
91 for {
92 next := s.peek()
93 switch next {
94 case '\r':
95 if s.follow("\r\n") {
96 s.emitWithValue(tokenString, growingString)
97 s.skip()
98 return s.lexVoid
99 }
100 case '\n':
101 s.emitWithValue(tokenString, growingString)
102 s.skip()
103 return s.lexVoid
104 case '#':
105 s.emitWithValue(tokenString, growingString)
106 s.skip()
107 return s.lexComment(s.lexVoid)
108 case eof:
109 s.next()
110 }
111 if next == eof {
112 break
113 }
114 growingString += string(next)
115 s.next()
116 }
117 s.emit(tokenEOF)
118 return nil
119}
120
121func (s *sshLexer) read() rune {
122 r := s.peek()

Callers

nothing calls this directly

Calls 7

peekMethod · 0.95
followMethod · 0.95
emitWithValueMethod · 0.95
skipMethod · 0.95
lexCommentMethod · 0.95
nextMethod · 0.95
emitMethod · 0.95

Tested by

no test coverage detected