/// Expects the given token, consuming it if it is the next token in the stream and returning an error if it is not.
Expects the given token, consuming it if it is the next token in the stream and returning an error if it is not.
Expects the given token consuming it if it is the next token in the stream and returning an error if it is not .
fn expect(&mut self, tok: Token) -> Result<()> {
        let got = match self.lexer.next() {
            Some(got) => got?,
            None => return Err(eparse!(self, "expected `{}`", tok)),    
        };
        if got != tok {
            Err(eparse!(self, "expected `{}`, got `{}`", tok, got))
        } else {
            Ok(())
        }
    }
fn expect ( & mut self , tok : Token ) -> Result < ( ) > { let got = match self . lexer . next ( ) { Some ( got ) => got ? , None => return Err ( eparse ! ( self " " tok ) ) , } ; if got != tok { Err ( eparse ! ( self " " tok got ) ) } else { Ok ( ( ) ) } }
Expects the given token, consuming it if it is the next token in the stream and returning an error if it is not.
Expects the given token consuming it if it is the next token in the stream and returning an error if it is not .
&mut self
tok
Token