Keep track of token source ranges in the scanner.

Earlier changes made the AST able to keep track of ranges, but some errors
are reported from the point of view of the scanner and so we need to be
able to generate ranges for tokens in order to produce range-aware error
messages here.