fn generate_struct(&mut self, ast: &Ast, node: NodeId) -> Result<ExpressionResult, Error> {
      let (name, _) = ast.node_pair(node);
      let name = ast.string(name).unwrap();

      self.chunk.emit(Opcode::CreateType);
      self.chunk.emit_string(name);
      let variable = self
         .create_variable(name, VariableAllocation::Allocate)
         .map_err(|kind| ast.error(node, kind))?;
      self.generate_variable_sink(variable);

      Ok(ExpressionResult::Absent)
   }
/// Generates code for a struct declaration.
Generates code for a struct declaration.
Generates code for a struct declaration .
fn generate_struct(&mut self, ast: &Ast, node: NodeId) -> Result<ExpressionResult, Error> {
      let (name, _) = ast.node_pair(node);
      let name = ast.string(name).unwrap();
      self.chunk.emit(Opcode::CreateType);
      self.chunk.emit_string(name);
      let variable = self
         .create_variable(name, VariableAllocation::Allocate)
         .map_err(|kind| ast.error(node, kind))?;
      self.generate_variable_sink(variable);
      Ok(ExpressionResult::Absent)
   }
fn generate_struct ( & mut self , ast : & Ast , node : NodeId ) -> Result < ExpressionResult , Error > { let ( name , _ ) = ast . node_pair ( node ) ; let name = ast . string ( name ) . unwrap ( ) ; self . chunk . emit ( Opcode :: CreateType ) ; self . chunk . emit_string ( name ) ; let variable = self . create_variable ( name , VariableAllocation :: Allocate ) . map_err ( | kind | ast . error ( node , kind ) ) ? ; self . generate_variable_sink ( variable ) ; Ok ( ExpressionResult :: Absent ) }
Generates code for a struct declaration.
Generates code for a struct declaration .
&mut self
ast
&Ast
node
NodeId