MCPcopy Index your code
hub / github.com/expr-lang/expr / scanString

Method scanString

parser/lexer/lexer.go:254–269  ·  view source on GitHub ↗
(quote rune)

Source from the content-addressed store, hash-verified

252}
253
254func (l *Lexer) scanString(quote rune) (n int) {
255 ch := l.next() // read character after quote
256 for ch != quote {
257 if ch == '\n' || ch == eof {
258 l.error("literal not terminated")
259 return
260 }
261 if ch == '\\' {
262 ch = l.scanEscape(quote)
263 } else {
264 ch = l.next()
265 }
266 n++
267 }
268 return
269}
270
271func (l *Lexer) scanRawString(quote rune) (n int) {
272 var escapedQuotes int

Callers 1

rootFunction · 0.80

Calls 3

nextMethod · 0.95
errorMethod · 0.95
scanEscapeMethod · 0.95

Tested by

no test coverage detected