code: func Lex(source []byte, debug bool) <-chan token {
  	ch := make(chan token)
  	l := &lexer{
  		input:  string(source),
  		tokens: ch,
  		state:  lexLine,
  		debug:  debug,
  	}
  	go func() {
  		l.emit(lineStart)
  		for l.state != nil {
  			l.state = l.state(l)
  		}
  		l.emit(eof)
  		close(l.tokens)
  	}()
  
  	return ch
  }
docs: // lex lexes the program by name with the given source. It returns a
  // channel on which the tokens are delivered.