readTokenAsLabelName copies a label name from p.buf into p.currentToken. The first byte considered is the byte already read (now in p.currentByte). The first byte not part of a label name is still copied into p.currentByte, but not into p.currentToken.
()
| 627 | // The first byte not part of a label name is still copied into p.currentByte, |
| 628 | // but not into p.currentToken. |
| 629 | func (p *TextParser) readTokenAsLabelName() { |
| 630 | p.currentToken.Reset() |
| 631 | if !isValidLabelNameStart(p.currentByte) { |
| 632 | return |
| 633 | } |
| 634 | for { |
| 635 | p.currentToken.WriteByte(p.currentByte) |
| 636 | p.currentByte, p.err = p.buf.ReadByte() |
| 637 | if p.err != nil || !isValidLabelNameContinuation(p.currentByte) { |
| 638 | return |
| 639 | } |
| 640 | } |
| 641 | } |
| 642 | |
| 643 | // readTokenAsLabelValue copies a label value from p.buf into p.currentToken. |
| 644 | // In contrast to the other 'readTokenAs...' functions, which start with the |
no test coverage detected