fn generate_variable(&mut self, ast: &Ast, node: NodeId) -> Result<ExpressionResult, Error> {
      let name = ast.string(node).unwrap();
      if let Some(variable) = self.lookup_variable(name).map_err(|kind| ast.error(node, kind))? {
         self.generate_variable_load(variable);
         Ok(ExpressionResult::Present)
      } else {
         Err(ast.error(node, ErrorKind::VariableDoesNotExist(name.to_owned())))
      }
   }
/// Generates code for a variable lookup.
Generates code for a variable lookup.
Generates code for a variable lookup .
fn generate_variable(&mut self, ast: &Ast, node: NodeId) -> Result<ExpressionResult, Error> {
      let name = ast.string(node).unwrap();
      if let Some(variable) = self.lookup_variable(name).map_err(|kind| ast.error(node, kind))? {
         self.generate_variable_load(variable);
         Ok(ExpressionResult::Present)
      } else {
         Err(ast.error(node, ErrorKind::VariableDoesNotExist(name.to_owned())))
      }
   }
fn generate_variable ( & mut self , ast : & Ast , node : NodeId ) -> Result < ExpressionResult , Error > { let name = ast . string ( node ) . unwrap ( ) ; if let Some ( variable ) = self . lookup_variable ( name ) . map_err ( | kind | ast . error ( node , kind ) ) ? { self . generate_variable_load ( variable ) ; Ok ( ExpressionResult :: Present ) } else { Err ( ast . error ( node , ErrorKind :: VariableDoesNotExist ( name . to_owned ( ) ) ) ) } }
Generates code for a variable lookup.
Generates code for a variable lookup .
&mut self
ast
&Ast
node
NodeId