fn try_resolve(&mut self, name: SharedSymbol) -> Option<UniqueSymbol> {
        if let Some(unique_symbol) = self.local_symbol(name) {
            return Some(unique_symbol);
        }
        if let Some(unique_symbol) = self.nonlocal_symbol(name) {
            return Some(unique_symbol);
        }

        if let Some(scope) = self.exit_scope() {
            let resolved = self.try_resolve(name);
            self.reenter_scope(scope);
            if let Some(unique_symbol) = resolved {
                self.local_scope().nonlocals.push(unique_symbol);
                return Some(unique_symbol);
            }
        }

        // variable is not defined in this or enclosing scopes
        return None;
    }
Tries to resolve a variable lookup:
1. If this variable is local or nonlocal to this
scope, use it. 2. If this variable is defined in
an enclosing scope, capture it and use it. 3. If
this variable is not defined, return `None`.
passerine/src/compiler/hoist.rs