Closed
Description
We use Ptr
to access characters and Parser
to access tokens. Unfortunately, they use different method names for lookups, bumping, etc. Lets unify them? The names in Parser
are, in general, better:
at(&self, kind: T) -> bool
-- checks current token. This might use some fancy overloading for lookahead for more than one token/symbol:.at(b"->")
.current(&self) -> T
-- returns current token.nth(&self, n: u32) -> T
-- like current, but forn
tokens ahead.bump(&mut self)
-- bumps current position by one token .