Cleanup advancing in the buffer.
Add buffer invariant for the lexer.
Handle end of file.