run runs the state machine for the lexer.
()
| 290 | |
| 291 | // run runs the state machine for the lexer. |
| 292 | func (l *lexer) run() { |
| 293 | go func() { |
| 294 | for l.state = lexText; l.state != nil; { |
| 295 | l.state = l.state(l) |
| 296 | } |
| 297 | close(l.items) |
| 298 | }() |
| 299 | } |
| 300 | |
| 301 | // state functions |
| 302 | func lexText(l *lexer) stateFn { |
no outgoing calls