/// Obtain the definitions in a scope. Calculate them if needed.
Obtain the definitions in a scope. Calculate them if needed.
Obtain the definitions in a scope . Calculate them if needed .
pub fn defs(&self, id: ScopeRef) -> Result<&'ctx Defs> {
        if let Some(&node) = self.sb.defs.borrow().get(&id) {
            return Ok(node);
        }
        if self.sess.opts.trace_scoreboard {
            println!("[SB] make defs for {:?}", id);
        }
        let node = self.make(id)?;
        if self.sess.opts.trace_scoreboard {
            println!("[SB] defs for {:?} is {:?}", id, node);
        }
        if self.sb.defs.borrow_mut().insert(id, node).is_some() {
            panic!("node should not exist");
        }
        Ok(node)
    }
pub fn defs ( & self , id : ScopeRef ) -> Result < & ' ctx Defs > { if let Some ( & node ) = self . sb . defs . borrow ( ) . get ( & id ) { return Ok ( node ) ; } if self . sess . opts . trace_scoreboard { println ! ( " " id ) ; } let node = self . make ( id ) ? ; if self . sess . opts . trace_scoreboard { println ! ( " " id node ) ; } if self . sb . defs . borrow_mut ( ) . insert ( id , node ) . is_some ( ) { panic ! ( " " ) ; } Ok ( node ) }
Obtain the definitions in a scope.
Obtain the definitions in a scope .
&self
id
ScopeRef