/// Something went wrong while trying to read a gcode command. Fast forward
/// until we see the start of a new command or the end of the block.
Something went wrong while trying to read a gcode command. Fast forward
until we see the start of a new command or the end of the block.
Something went wrong while trying to read a gcode command . Fast forward until we see the start of a new command or the end of the block .
fn fast_forward_to_safe_point(
        &mut self,
        mut comments: impl FnMut(Comment<'input>),
    ) {
        let mut overall_span = Span::placeholder();
        while let Some(kind) = self.next_kind() {
            if kind == TokenKind::Newline {
                break;
            }
            let (tok, span) = self.lexer.next().expect("We aren't at the EOF");
            overall_span = overall_span.merge(span);
            if let Token::Comment(body) = tok {
                comments(Comment::new(body, span));
            }
        }
        #[cfg(test)]
        println!("Overall span: {:?}", overall_span);
        self.callbacks.mangled_input(
            overall_span
                .text_from_source(self.src)
                .expect("Always within bounds"),
            overall_span,
        );
    }
fn fast_forward_to_safe_point ( & mut self , mut comments : impl FnMut ( Comment < ' input > ) , ) { let mut overall_span = Span :: placeholder ( ) ; while let Some ( kind ) = self . next_kind ( ) { if kind == TokenKind :: Newline { break ; } let ( tok , span ) = self . lexer . next ( ) . expect ( " " ) ; overall_span = overall_span . merge ( span ) ; if let Token :: Comment ( body ) = tok { comments ( Comment :: new ( body , span ) ) ; } } # [ cfg ( test ) ] println ! ( " " overall_span ) ; self . callbacks . mangled_input ( overall_span . text_from_source ( self . src ) . expect ( " " ) , overall_span , ) ; }
Something went wrong while trying to read a gcode command.
Something went wrong while trying to read a gcode command .
&mut self
comments
impl FnMut(Comment<'input>)