fn parse_break_like(&mut self, token: Token, kind: NodeKind) -> Result<NodeId, Error> {
      let next_token = self.lexer.peek_token()?;
      let result = if next_token.location.line > token.location.line
         || matches!(next_token.kind, TokenKind::End)
      {
         NodeId::EMPTY
      } else {
         self.parse_expression(0)?
      };
      Ok(self.ast.build_node(kind, result).with_location(token.location).done())
   }
/// Parses a "break-like" expression. This includes `break` and `return`.
///
/// A break-like expression is a token followed followed by an optional value on the same line as
/// that token.
Parses a "break-like" expression. This includes `break` and `return`.
A break-like expression is a token followed followed by an optional value on the same line as
that token.
Parses a " break - like " expression . This includes ` break ` and ` return ` . A break - like expression is a token followed followed by an optional value on the same line as that token .
fn parse_break_like(&mut self, token: Token, kind: NodeKind) -> Result<NodeId, Error> {
      let next_token = self.lexer.peek_token()?;
      let result = if next_token.location.line > token.location.line
         || matches!(next_token.kind, TokenKind::End)
      {
         NodeId::EMPTY
      } else {
         self.parse_expression(0)?
      };
      Ok(self.ast.build_node(kind, result).with_location(token.location).done())
   }
fn parse_break_like ( & mut self , token : Token , kind : NodeKind ) -> Result < NodeId , Error > { let next_token = self . lexer . peek_token ( ) ? ; let result = if next_token . location . line > token . location . line || matches ! ( next_token kind TokenKind End ) { NodeId :: EMPTY } else { self . parse_expression ( 0 ) ? } ; Ok ( self . ast . build_node ( kind , result ) . with_location ( token . location ) . done ( ) ) }
Parses a "break-like" expression.
Parses a " break - like " expression .
&mut self
token
Token
kind
NodeKind