func (s *Scanner) Scan() bool {
	if s.err != nil {
		return false
	}
	if len(s.macroBuf) > 0 {
		tok := s.macroBuf[len(s.macroBuf)-1]
		s.macroBuf = s.macroBuf[:len(s.macroBuf)-1]
		s.setTok(tok.Type, tok.Val)
		return s.err == nil
	}
	s.tbuf.Reset()
	var eof bool
	state := s.whitespace
	for state != nil {
		r, err := s.read()
		switch err {
		case nil:
			eof = false
		case io.EOF:
			if eof {
				s.err = err
				s.setTok(EOF, nil)
				return true
			}
			r = '\n'
			eof = true
		default:
			s.err = err
			return false
		}
		state = state(r)
	}
	return true
}
Scan reads the next token from the underlying io.Reader. If a token
was successfully read, it returns true. It is designed to be used
in a loop, similarly to bufio.Scanner's API.
package scanner
import (
	"bufio"
	"bytes"
	"io"
	"strconv"
	"unicode"
)
type MacroMap map[string]func(string) ([]Token, error)
type Scanner struct {
	r               io.RuneReader
	rbuf            []rune
	line, col, pcol int
	tok         Token
	tline, tcol int
	err         error
	tbuf  bytes.Buffer
	quote rune
	macro string
	macroMap MacroMap
	macroBuf []Token
}
func New(r io.Reader, macros MacroMap) *Scanner {
	var rr io.RuneReader
	switch r := r.(type) {
	case io.RuneReader:
		rr = r
	default:
		rr = bufio.NewReader(r)
	}
	return &Scanner{
		r:    rr,
		line: 1,
		macroMap: macros,
	}
}