State of a parser.
A parser works with:
- an array of tokens to explore (typically the characters that compose a string).
- an offset in that array that represents how far we've parsed already.
- the position of the last parsed token.
TODO: before writing documentation, we need to keep track of a token's START and END position. It makes things far easier to explain. With chars, a token's start position is always the previous token's end position. With more complex tokens, this might not hold - think of space-separated ints: "1 2". You cannot guess the start position of '2' just from '1': this doesn't tell you how many spaces there are before the next token starts.
- Companion:
- object
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any