pub fn declare(&mut self, name: Spanned<ResolvableName>, def: Def) {
        if self.ctx.sess.opts.trace_scoreboard {
            debugln!("[SB][VHDL][SCOPE] declaring `{}` as {:?}", name.value, def);
        }
        match def {
            // Handle overloadable cases.
            Def::Enum(_) => {
                self.defs
                    .entry(name.value)
                    .or_insert_with(|| Vec::new())
                    .push(Spanned::new(def, name.span));
            }

            // Handle unique cases.
            _ => {
                let ins = self
                    .defs
                    .insert(name.value, vec![Spanned::new(def, name.span)]);
                if let Some(existing) = ins {
                    self.emit(
                        DiagBuilder2::error(format!("`{}` has already been declared", name.value))
                            .span(name.span)
                            .add_note("previous declaration was here:")
                            .span(existing.last().unwrap().span),
                    );
                }
            }
        }
    }
/// Declare a name in the scope.
Declare a name in the scope.
Declare a name in the scope .
pub fn declare(&mut self, name: Spanned<ResolvableName>, def: Def) {
        if self.ctx.sess.opts.trace_scoreboard {
            debugln!("[SB][VHDL][SCOPE] declaring `{}` as {:?}", name.value, def);
        }
        match def {
            // Handle overloadable cases.
            Def::Enum(_) => {
                self.defs
                    .entry(name.value)
                    .or_insert_with(|| Vec::new())
                    .push(Spanned::new(def, name.span));
            }
            // Handle unique cases.
            _ => {
                let ins = self
                    .defs
                    .insert(name.value, vec![Spanned::new(def, name.span)]);
                if let Some(existing) = ins {
                    self.emit(
                        DiagBuilder2::error(format!("`{}` has already been declared", name.value))
                            .span(name.span)
                            .add_note("previous declaration was here:")
                            .span(existing.last().unwrap().span),
                    );
                }
            }
        }
    }
pub fn declare ( & mut self , name : Spanned < ResolvableName > , def : Def ) { if self . ctx . sess . opts . trace_scoreboard { debugln ! ( " " name value def ) ; } match def { // Handle overloadable cases. Def :: Enum ( _ ) => { self . defs . entry ( name . value ) . or_insert_with ( | | Vec :: new ( ) ) . push ( Spanned :: new ( def , name . span ) ) ; } // Handle unique cases. _ => { let ins = self . defs . insert ( name . value , vec ! [ Spanned new ( def name span ) ] ) ; if let Some ( existing ) = ins { self . emit ( DiagBuilder2 :: error ( format ! ( " " name value ) ) . span ( name . span ) . add_note ( " " ) . span ( existing . last ( ) . unwrap ( ) . span ) , ) ; } } } }
Declare a name in the scope.
Declare a name in the scope .
&mut self
name
Spanned<ResolvableName>
def
Def
&mut self
name
Spanned<ResolvableName>
def
Def