fn generate_dot(&mut self, ast: &Ast, node: NodeId) -> Result<ExpressionResult, Error> {
      let (left, method) = ast.node_pair(node);
      self.generate_node(ast, left, Expression::Used)?;

      if ast.kind(method) != NodeKind::Identifier {
         return Err(ast.error(method, ErrorKind::InvalidMethodName));
      }
      let signature = FunctionSignature {
         name: Rc::clone(ast.string(method).unwrap()),
         arity: Some(1),
      };
      let method_index =
         self.env.get_method_index(&signature).map_err(|kind| ast.error(node, kind))?;
      self.chunk.emit((Opcode::CallMethod, Opr24::pack((method_index, 1))));

      Ok(ExpressionResult::Present)
   }
/// Generates code for a bare dot call (without parentheses).
Generates code for a bare dot call (without parentheses).
Generates code for a bare dot call ( without parentheses ) .
fn generate_dot(&mut self, ast: &Ast, node: NodeId) -> Result<ExpressionResult, Error> {
      let (left, method) = ast.node_pair(node);
      self.generate_node(ast, left, Expression::Used)?;
      if ast.kind(method) != NodeKind::Identifier {
         return Err(ast.error(method, ErrorKind::InvalidMethodName));
      }
      let signature = FunctionSignature {
         name: Rc::clone(ast.string(method).unwrap()),
         arity: Some(1),
      };
      let method_index =
         self.env.get_method_index(&signature).map_err(|kind| ast.error(node, kind))?;
      self.chunk.emit((Opcode::CallMethod, Opr24::pack((method_index, 1))));
      Ok(ExpressionResult::Present)
   }
fn generate_dot ( & mut self , ast : & Ast , node : NodeId ) -> Result < ExpressionResult , Error > { let ( left , method ) = ast . node_pair ( node ) ; self . generate_node ( ast , left , Expression :: Used ) ? ; if ast . kind ( method ) != NodeKind :: Identifier { return Err ( ast . error ( method , ErrorKind :: InvalidMethodName ) ) ; } let signature = FunctionSignature { name : Rc :: clone ( ast . string ( method ) . unwrap ( ) ) , arity : Some ( 1 ) , } ; let method_index = self . env . get_method_index ( & signature ) . map_err ( | kind | ast . error ( node , kind ) ) ? ; self . chunk . emit ( ( Opcode :: CallMethod , Opr24 :: pack ( ( method_index , 1 ) ) ) ) ; Ok ( ExpressionResult :: Present ) }
Generates code for a bare dot call (without parentheses).
Generates code for a bare dot call ( without parentheses ) .
&mut self
ast
&Ast
node
NodeId