(str string)
| 44 | } |
| 45 | |
| 46 | func (s *scanner) init(str string) { |
| 47 | s.in = str |
| 48 | s.pos = 0 |
| 49 | // Preallocate some buffer space for identifiers etc. |
| 50 | s.bytesPrealloc = make([]byte, len(str)) |
| 51 | } |
| 52 | |
| 53 | // cleanup is used to avoid holding on to memory unnecessarily (for the cases |
| 54 | // where we reuse a scanner). |