(str string)
| 58 | } |
| 59 | |
| 60 | func (s *scanner) init(str string) { |
| 61 | s.in = str |
| 62 | s.pos = 0 |
| 63 | // Preallocate some buffer space for identifiers etc. |
| 64 | s.bytesPrealloc = make([]byte, len(str)) |
| 65 | } |
| 66 | |
| 67 | // cleanup is used to avoid holding on to memory unnecessarily (for the cases |
| 68 | // where we reuse a scanner). |