fn symbol(&mut self, sym: Symbol) -> WeldResult<Symbol> {
        match self.stack.entry(sym.clone()) {
            Entry::Occupied(ref ent) => {
                let name = ent.key().name();
                let id = ent.get().last().cloned().ok_or_else(|| {
                    WeldCompileError::new(format!("Symbol {} is out of scope", &sym))
                })?;
                Ok(Symbol::new(name, id))
            }
            _ => compile_err!("Undefined symbol {}", sym),
        }
    }
Returns the symbol in the current scope for the given symbol, or an error if the symbol is
undefined.
weld/src/ast/uniquify.rs