fn parse_terminated_block(
      &mut self,
      token: &Token,
      children: &mut Vec<NodeId>,
      is_terminator: impl Fn(&TokenKind) -> bool,
   ) -> Result<(), Error> {
      while !is_terminator(&self.lexer.peek_token()?.kind) {
         if self.lexer.peek_token()?.kind == TokenKind::Eof {
            return Err(self.error(token, ErrorKind::MissingEnd));
         }
         children.push(self.parse_item()?);
      }
      Ok(())
   }
/// Parses a terminated block. Typically blocks are terminated with `end`.
Parses a terminated block. Typically blocks are terminated with `end`.
Parses a terminated block . Typically blocks are terminated with ` end ` .
fn parse_terminated_block(
      &mut self,
      token: &Token,
      children: &mut Vec<NodeId>,
      is_terminator: impl Fn(&TokenKind) -> bool,
   ) -> Result<(), Error> {
      while !is_terminator(&self.lexer.peek_token()?.kind) {
         if self.lexer.peek_token()?.kind == TokenKind::Eof {
            return Err(self.error(token, ErrorKind::MissingEnd));
         }
         children.push(self.parse_item()?);
      }
      Ok(())
   }
fn parse_terminated_block ( & mut self , token : & Token , children : & mut Vec < NodeId > , is_terminator : impl Fn ( & TokenKind ) -> bool , ) -> Result < ( ) , Error > { while ! is_terminator ( & self . lexer . peek_token ( ) ? . kind ) { if self . lexer . peek_token ( ) ? . kind == TokenKind :: Eof { return Err ( self . error ( token , ErrorKind :: MissingEnd ) ) ; } children . push ( self . parse_item ( ) ? ) ; } Ok ( ( ) ) }
Parses a terminated block.
Parses a terminated block .
&mut self
token
&Token
children
&mut Vec<NodeId>
is_terminator
impl Fn(&TokenKind) -> bool