next returns the next rune in the input.
()
| 94 | |
| 95 | // next returns the next rune in the input. |
| 96 | func (p *Parser) next() rune { |
| 97 | if p.pos >= len(p.input) { |
| 98 | p.width = 0 |
| 99 | return eof |
| 100 | } |
| 101 | r, w := utf8.DecodeRuneInString(p.input[p.pos:]) |
| 102 | p.width = w |
| 103 | p.pos += p.width |
| 104 | return r |
| 105 | } |
| 106 | |
| 107 | // peek returns but does not consume the next rune in the input. |
| 108 | func (p *Parser) peek() rune { |
no outgoing calls
no test coverage detected