• Roger Peppe's avatar
    fmt: make ScanState.Token more general. · 3a95587e
    Roger Peppe authored
    When writing custom scanners, I found that
    Token itself was rarely useful, as I did not always
    want to stop at white space. This change makes
    it possible to stop at any class of characters
    while reusing the buffer within State.
    (also fix a bug in Token)
    
    R=r, r2
    CC=golang-dev
    https://golang.org/cl/4243055
    3a95587e
scan_test.go 23.3 KB