Emit adds a token of the provided type to the stringLexer's internal list of tokens. The start pointer is advanced to the current position.
(t itemType)
| 116 | // internal list of tokens. The start pointer is advanced to the |
| 117 | // current position. |
| 118 | func (s *stringLexer) Emit(t itemType) { |
| 119 | s.items = append(s.items, item{ |
| 120 | typ: t, |
| 121 | val: s.str[s.start:s.pos], |
| 122 | }) |
| 123 | s.start = s.pos |
| 124 | } |
| 125 | |
| 126 | // Ignore moves the start position pointer to the current |
| 127 | // position without emitting a token; effectively ignoring |