• Robert Griesemer's avatar
    scanner: fix Position returned by Scan, Pos · eaae95fa
    Robert Griesemer authored
    The implementation of the position computation
    was surprisingly broken. Implemented fixes and
    added extra test cases.
    
    There is a slight interface change: Calling
    Pos() returns the current position; but if
    called before Scan() that position may not
    be the position of the next token returned
    by Scan() (depending on the scan settings
    and the source text) - this in contrast to
    the original comment.
    
    However, after calling Scan(), the Scanner's
    Position field reports the position of the
    scanned token, as before.
    
    Fixes #1327.
    
    R=rsc
    CC=golang-dev
    https://golang.org/cl/3972047
    eaae95fa
Name
Last commit
Last update
..
cmd Loading commit data...
lib9 Loading commit data...
libbio Loading commit data...
libmach Loading commit data...
pkg Loading commit data...
Make.ccmd Loading commit data...
Make.clib Loading commit data...
Make.cmd Loading commit data...
Make.common Loading commit data...
Make.inc Loading commit data...
Make.pkg Loading commit data...
all.bash Loading commit data...
clean.bash Loading commit data...
env.bash Loading commit data...
make.bash Loading commit data...
quietgcc.bash Loading commit data...
run.bash Loading commit data...
sudo.bash Loading commit data...
version.bash Loading commit data...