work
This commit is contained in:
@@ -35,8 +35,8 @@ impl<'a> Cursor<'a> {
|
||||
})
|
||||
}
|
||||
|
||||
pub fn next_if(&mut self, token: Token) -> bool {
|
||||
if self.peek().is_some_and(|t| *t == token) {
|
||||
pub fn next_if(&mut self, token: &Token) -> bool {
|
||||
if self.peek().is_some_and(|t| t == token) {
|
||||
self.next();
|
||||
true
|
||||
} else {
|
||||
@@ -54,6 +54,7 @@ impl<'a> Cursor<'a> {
|
||||
|
||||
pub fn expect_peek(&self) -> Result<&Token, CompilerMsg> {
|
||||
self.peek().ok_or_else(CompilerMsg::unexpected_eof)
|
||||
// Ok(self.peek().unwrap())
|
||||
}
|
||||
|
||||
pub fn expect(&mut self, token: Token) -> Result<Token, CompilerMsg> {
|
||||
|
||||
Reference in New Issue
Block a user