read returns the next unicode character. It returns eof at the end of the string buffer.
()
| 61 | // read returns the next unicode character. It returns eof at |
| 62 | // the end of the string buffer. |
| 63 | func (s *scanner) read() rune { |
| 64 | if s.pos >= len(s.buf) { |
| 65 | s.width = 0 |
| 66 | return eof |
| 67 | } |
| 68 | r, w := utf8.DecodeRuneInString(s.buf[s.pos:]) |
| 69 | s.width = w |
| 70 | s.pos += s.width |
| 71 | return r |
| 72 | } |
| 73 | |
| 74 | func (s *scanner) unread() { |
| 75 | s.pos -= s.width |
no outgoing calls
no test coverage detected