fn generate_list(&mut self, ast: &Ast, node: NodeId) -> Result<ExpressionResult, Error> {
      let children = ast.children(node).unwrap();
      let len =
         Opr24::try_from(children.len()).map_err(|_| ast.error(node, ErrorKind::ListIsTooLong))?;
      for &child in children {
         self.generate_node(ast, child, Expression::Used)?;
      }
      self.chunk.emit((Opcode::CreateList, len));
      Ok(ExpressionResult::Present)
   }
/// Generates code for a list literal.
Generates code for a list literal.
Generates code for a list literal .
fn generate_list(&mut self, ast: &Ast, node: NodeId) -> Result<ExpressionResult, Error> {
      let children = ast.children(node).unwrap();
      let len =
         Opr24::try_from(children.len()).map_err(|_| ast.error(node, ErrorKind::ListIsTooLong))?;
      for &child in children {
         self.generate_node(ast, child, Expression::Used)?;
      }
      self.chunk.emit((Opcode::CreateList, len));
      Ok(ExpressionResult::Present)
   }
fn generate_list ( & mut self , ast : & Ast , node : NodeId ) -> Result < ExpressionResult , Error > { let children = ast . children ( node ) . unwrap ( ) ; let len = Opr24 :: try_from ( children . len ( ) ) . map_err ( | _ | ast . error ( node , ErrorKind :: ListIsTooLong ) ) ? ; for & child in children { self . generate_node ( ast , child , Expression :: Used ) ? ; } self . chunk . emit ( ( Opcode :: CreateList , len ) ) ; Ok ( ExpressionResult :: Present ) }
Generates code for a list literal.
Generates code for a list literal .
&mut self
ast
&Ast
node
NodeId