/// Get the requested element, or None if there are not that many lexemes.
/// This returns a borrow which can be cloned, because dealing with taking things
/// out of the Cursor is too complex in combination with rollbacks.
Get the requested element, or None if there are not that many lexemes.
This returns a borrow which can be cloned, because dealing with taking things
out of the Cursor is too complex in combination with rollbacks.
Get the requested element or None if there are not that many lexemes . This returns a borrow which can be cloned because dealing with taking things out of the Cursor is too complex in combination with rollbacks .
pub fn take(&mut self) -> Result<&Lexeme, End> {
        //TODO @mark: trace logging lines
        if self.index >= self.lexemes.len() {
            dbg_log!("parser at {:?} taking token END", self.index);
            return Err(End);
        }
        dbg_log!("parser at {:?} taking token {:?}", self.index, &self.lexemes[self.index]);
        let lexeme = &self.lexemes[self.index];
        self.index.increment();
        Ok(lexeme)
    }
pub fn take ( & mut self ) -> Result < & Lexeme , End > { //TODO @mark: trace logging lines if self . index >= self . lexemes . len ( ) { dbg_log ! ( " " self index ) ; return Err ( End ) ; } dbg_log ! ( " " self index self lexemes [ self index ] ) ; let lexeme = & self . lexemes [ self . index ] ; self . index . increment ( ) ; Ok ( lexeme ) }
Get the requested element, or None if there are not that many lexemes.
Get the requested element or None if there are not that many lexemes .
&mut self