acceptQuotedString accepts a quoted string
(quote rune)
| 299 | |
| 300 | // acceptQuotedString accepts a quoted string |
| 301 | func (l *lexer) acceptQuotedString(quote rune) error { |
| 302 | Loop: |
| 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 | |
| 319 | func any(r rune, s string) bool { |
| 320 | return strings.IndexRune(s, r) >= 0 |
no test coverage detected