init initializes a scanner with a new buffer.
(buf string)
| 51 | |
| 52 | // init initializes a scanner with a new buffer. |
| 53 | func (s *scanner) init(buf string) { |
| 54 | s.buf = buf |
| 55 | s.pos = 0 |
| 56 | s.start = 0 |
| 57 | s.width = 0 |
| 58 | s.accept = nil |
| 59 | } |
| 60 | |
| 61 | // read returns the next unicode character. It returns eof at |
| 62 | // the end of the string buffer. |