pub fn buffer_with_pcs(&self) -> impl Iterator<Item = (&str, Option<ProgramCounter>)> {
        let mut offset = 0;
        let mut buffer_pcs = self.buffer_pcs.iter().peekable();
        std::iter::from_fn(move || match buffer_pcs.peek() {
            Some(range) if offset < range.start => {
                let text = &self.buffer[offset..range.start];
                offset = range.start;
                Some((text, None))
            }

            Some(range) => {
                assert!(offset == range.start);
                let text = &self.buffer[range.start..range.end];
                let await_pc = range.await_pc;
                offset = range.end;
                buffer_pcs.next();
                Some((text, Some(await_pc)))
            }

            None if offset < self.buffer.len() => {
                let text = &self.buffer[offset..];
                offset = self.buffer.len();
                Some((text, None))
            }

            None => None,
        })
    }
/// Returns an iterator over the text emitted at a given point along with
/// the program counter responsible (if available).
Returns an iterator over the text emitted at a given point along with
the program counter responsible (if available).
Returns an iterator over the text emitted at a given point along with the program counter responsible ( if available ) .
pub fn buffer_with_pcs(&self) -> impl Iterator<Item = (&str, Option<ProgramCounter>)> {
        let mut offset = 0;
        let mut buffer_pcs = self.buffer_pcs.iter().peekable();
        std::iter::from_fn(move || match buffer_pcs.peek() {
            Some(range) if offset < range.start => {
                let text = &self.buffer[offset..range.start];
                offset = range.start;
                Some((text, None))
            }
            Some(range) => {
                assert!(offset == range.start);
                let text = &self.buffer[range.start..range.end];
                let await_pc = range.await_pc;
                offset = range.end;
                buffer_pcs.next();
                Some((text, Some(await_pc)))
            }
            None if offset < self.buffer.len() => {
                let text = &self.buffer[offset..];
                offset = self.buffer.len();
                Some((text, None))
            }
            None => None,
        })
    }
pub fn buffer_with_pcs ( & self ) -> impl Iterator < Item = ( & str , Option < ProgramCounter > ) > { let mut offset = 0 ; let mut buffer_pcs = self . buffer_pcs . iter ( ) . peekable ( ) ; std :: iter :: from_fn ( move | | match buffer_pcs . peek ( ) { Some ( range ) if offset < range . start => { let text = & self . buffer [ offset .. range . start ] ; offset = range . start ; Some ( ( text , None ) ) } Some ( range ) => { assert ! ( offset range start ) ; let text = & self . buffer [ range . start .. range . end ] ; let await_pc = range . await_pc ; offset = range . end ; buffer_pcs . next ( ) ; Some ( ( text , Some ( await_pc ) ) ) } None if offset < self . buffer . len ( ) => { let text = & self . buffer [ offset .. ] ; offset = self . buffer . len ( ) ; Some ( ( text , None ) ) } None => None , } ) }
Returns an iterator over the text emitted at a given point along with
the program counter responsible (if available).
Returns an iterator over the text emitted at a given point along with the program counter responsible ( if available ) .
&self
&self