fn generate_function_expression(
      &mut self,
      ast: &Ast,
      node: NodeId,
   ) -> Result<ExpressionResult, Error> {
      let (_, parameters) = ast.node_pair(node);
      if ast.node_pair(parameters).0 != NodeId::EMPTY {
         return Err(ast.error(
            ast.node_pair(parameters).0,
            ErrorKind::FunctionKindOutsideImpl,
         ));
      }
      let function = self.generate_function(
         ast,
         node,
         GenerateFunctionOptions {
            name: Rc::from("<anonymous>"),
            call_conv: FunctionCallConv::Bare,
         },
      )?;
      self.chunk.emit((Opcode::CreateClosure, function.id));
      Ok(ExpressionResult::Present)
   }
/// Generates code for a function expression.
Generates code for a function expression.
Generates code for a function expression .
fn generate_function_expression(
      &mut self,
      ast: &Ast,
      node: NodeId,
   ) -> Result<ExpressionResult, Error> {
      let (_, parameters) = ast.node_pair(node);
      if ast.node_pair(parameters).0 != NodeId::EMPTY {
         return Err(ast.error(
            ast.node_pair(parameters).0,
            ErrorKind::FunctionKindOutsideImpl,
         ));
      }
      let function = self.generate_function(
         ast,
         node,
         GenerateFunctionOptions {
            name: Rc::from("<anonymous>"),
            call_conv: FunctionCallConv::Bare,
         },
      )?;
      self.chunk.emit((Opcode::CreateClosure, function.id));
      Ok(ExpressionResult::Present)
   }
fn generate_function_expression ( & mut self , ast : & Ast , node : NodeId , ) -> Result < ExpressionResult , Error > { let ( _ , parameters ) = ast . node_pair ( node ) ; if ast . node_pair ( parameters ) . 0 != NodeId :: EMPTY { return Err ( ast . error ( ast . node_pair ( parameters ) . 0 , ErrorKind :: FunctionKindOutsideImpl , ) ) ; } let function = self . generate_function ( ast , node , GenerateFunctionOptions { name : Rc :: from ( " " ) , call_conv : FunctionCallConv :: Bare , } , ) ? ; self . chunk . emit ( ( Opcode :: CreateClosure , function . id ) ) ; Ok ( ExpressionResult :: Present ) }
Generates code for a function expression.
Generates code for a function expression .
&mut self
ast
&Ast
node
NodeId