consumeOptionalSeparator consumes an optional semicolon or comma. It is used in unmarshalMessage to provide backward compatibility.
()
| 521 | // consumeOptionalSeparator consumes an optional semicolon or comma. |
| 522 | // It is used in unmarshalMessage to provide backward compatibility. |
| 523 | func (p *textParser) consumeOptionalSeparator() error { |
| 524 | tok := p.next() |
| 525 | if tok.err != nil { |
| 526 | return tok.err |
| 527 | } |
| 528 | if tok.value != ";" && tok.value != "," { |
| 529 | p.back() |
| 530 | } |
| 531 | return nil |
| 532 | } |
| 533 | |
| 534 | func (p *textParser) errorf(format string, a ...interface{}) *ParseError { |
| 535 | pe := &ParseError{fmt.Sprintf(format, a...), p.cur.line, p.cur.offset} |
no test coverage detected