fn generate_and(&mut self, ast: &Ast, node: NodeId) -> Result<ExpressionResult, Error> {
      let (left, right) = ast.node_pair(node);
      self.push_scope();
      self.generate_node(ast, left, Expression::Used)?;
      let jump_past_right = self.chunk.emit(Opcode::Nop);
      self.chunk.emit(Opcode::Discard);
      self.generate_node(ast, right, Expression::Used)?;
      self.chunk.patch(
         jump_past_right,
         Opcode::jump_forward_if_falsy(jump_past_right, self.chunk.len())
            .map_err(|_| ast.error(node, ErrorKind::OperatorRhsTooLarge))?,
      );
      self.pop_scope();
      Ok(ExpressionResult::Present)
   }
/// Generates code for an `and` infix operator.
Generates code for an `and` infix operator.
Generates code for an ` and ` infix operator .
fn generate_and(&mut self, ast: &Ast, node: NodeId) -> Result<ExpressionResult, Error> {
      let (left, right) = ast.node_pair(node);
      self.push_scope();
      self.generate_node(ast, left, Expression::Used)?;
      let jump_past_right = self.chunk.emit(Opcode::Nop);
      self.chunk.emit(Opcode::Discard);
      self.generate_node(ast, right, Expression::Used)?;
      self.chunk.patch(
         jump_past_right,
         Opcode::jump_forward_if_falsy(jump_past_right, self.chunk.len())
            .map_err(|_| ast.error(node, ErrorKind::OperatorRhsTooLarge))?,
      );
      self.pop_scope();
      Ok(ExpressionResult::Present)
   }
fn generate_and ( & mut self , ast : & Ast , node : NodeId ) -> Result < ExpressionResult , Error > { let ( left , right ) = ast . node_pair ( node ) ; self . push_scope ( ) ; self . generate_node ( ast , left , Expression :: Used ) ? ; let jump_past_right = self . chunk . emit ( Opcode :: Nop ) ; self . chunk . emit ( Opcode :: Discard ) ; self . generate_node ( ast , right , Expression :: Used ) ? ; self . chunk . patch ( jump_past_right , Opcode :: jump_forward_if_falsy ( jump_past_right , self . chunk . len ( ) ) . map_err ( | _ | ast . error ( node , ErrorKind :: OperatorRhsTooLarge ) ) ? , ) ; self . pop_scope ( ) ; Ok ( ExpressionResult :: Present ) }
Generates code for an `and` infix operator.
Generates code for an ` and ` infix operator .
&mut self
ast
&Ast
node
NodeId