MCPcopy
hub / github.com/cortesi/modd / acceptQuotedString

Method acceptQuotedString

conf/lex.go:301–317  ·  view source on GitHub ↗

acceptQuotedString accepts a quoted string

(quote rune)

Source from the content-addressed store, hash-verified

299
300// acceptQuotedString accepts a quoted string
301func (l *lexer) acceptQuotedString(quote rune) error {
302Loop:
303 for {
304 switch l.next() {
305 case '\\':
306 if r := l.next(); r != eof {
307 break
308 }
309 fallthrough
310 case eof:
311 return fmt.Errorf("unterminated quoted string")
312 case quote:
313 break Loop
314 }
315 }
316 return nil
317}
318
319func any(r rune, s string) bool {
320 return strings.IndexRune(s, r) >= 0

Callers 3

lexPatternsFunction · 0.80
lexVariablesFunction · 0.80
lexCommandFunction · 0.80

Calls 1

nextMethod · 0.95

Tested by

no test coverage detected