fn new_var(&mut self, name: &str, span: Span) -> CompileResult<usize> {
        let offset = self.total_var_count;

        let local = Var {
            offset,
            span,
            moved_at: None,
        };

        self.total_var_count += 1;
        self.local_var_count += 1;

        if let Some(old) = self.locals.insert(name.to_owned(), local) {
            return Err(CompileError::new(
                span,
                CompileErrorKind::VariableConflict {
                    name: name.to_owned(),
                    existing_span: old.span,
                },
            ));
        }

        Ok(offset)
    }
/// Insert a new local, and return the old one if there's a conflict.
Insert a new local, and return the old one if there's a conflict.
Insert a new local and return the old one if there ' s a conflict .
fn new_var(&mut self, name: &str, span: Span) -> CompileResult<usize> {
        let offset = self.total_var_count;
        let local = Var {
            offset,
            span,
            moved_at: None,
        };
        self.total_var_count += 1;
        self.local_var_count += 1;
        if let Some(old) = self.locals.insert(name.to_owned(), local) {
            return Err(CompileError::new(
                span,
                CompileErrorKind::VariableConflict {
                    name: name.to_owned(),
                    existing_span: old.span,
                },
            ));
        }
        Ok(offset)
    }
fn new_var ( & mut self , name : & str , span : Span ) -> CompileResult < usize > { let offset = self . total_var_count ; let local = Var { offset , span , moved_at : None , } ; self . total_var_count += 1 ; self . local_var_count += 1 ; if let Some ( old ) = self . locals . insert ( name . to_owned ( ) , local ) { return Err ( CompileError :: new ( span , CompileErrorKind :: VariableConflict { name : name . to_owned ( ) , existing_span : old . span , } , ) ) ; } Ok ( offset ) }
Insert a new local, and return the old one if there's a conflict.
Insert a new local and return the old one if there ' s a conflict .
&mut self
name
&str
span
Span
&mut self
name
&str
span
Span