fn create_variable(
      &mut self,
      name: &str,
      allocation: VariableAllocation,
   ) -> Result<VariablePlace, ErrorKind> {
      if !self.locals.scopes.is_empty() {
         let place = self.locals.create_local(name, allocation)?;
         self.chunk.preallocate_stack_slots =
            self.chunk.preallocate_stack_slots.max(self.locals.allocated_local_count);
         Ok(place)
      } else {
         let slot = self.env.create_global(name)?;
         Ok(VariablePlace::Global(slot))
      }
   }
/// Creates a variable. If there is a scope on the stack, the variable is local; otherwise it
/// is global.
Creates a variable. If there is a scope on the stack, the variable is local; otherwise it
is global.
Creates a variable . If there is a scope on the stack the variable is local ; otherwise it is global .
fn create_variable(
      &mut self,
      name: &str,
      allocation: VariableAllocation,
   ) -> Result<VariablePlace, ErrorKind> {
      if !self.locals.scopes.is_empty() {
         let place = self.locals.create_local(name, allocation)?;
         self.chunk.preallocate_stack_slots =
            self.chunk.preallocate_stack_slots.max(self.locals.allocated_local_count);
         Ok(place)
      } else {
         let slot = self.env.create_global(name)?;
         Ok(VariablePlace::Global(slot))
      }
   }
fn create_variable ( & mut self , name : & str , allocation : VariableAllocation , ) -> Result < VariablePlace , ErrorKind > { if ! self . locals . scopes . is_empty ( ) { let place = self . locals . create_local ( name , allocation ) ? ; self . chunk . preallocate_stack_slots = self . chunk . preallocate_stack_slots . max ( self . locals . allocated_local_count ) ; Ok ( place ) } else { let slot = self . env . create_global ( name ) ? ; Ok ( VariablePlace :: Global ( slot ) ) } }
Creates a variable.
Creates a variable .
&mut self
name
&str
allocation
VariableAllocation