work
This commit is contained in:
@@ -54,6 +54,10 @@ impl<'a> Cursor<'a> {
|
||||
self.next().ok_or_else(CompilerMsg::unexpected_eof)
|
||||
}
|
||||
|
||||
pub fn expect_peek(&self) -> Result<&Token, CompilerMsg> {
|
||||
self.peek().ok_or_else(CompilerMsg::unexpected_eof)
|
||||
}
|
||||
|
||||
pub fn expect(&mut self, token: Token) -> Result<Token, CompilerMsg> {
|
||||
let next = self.expect_next()?;
|
||||
if next == token {
|
||||
|
||||
Reference in New Issue
Block a user