XPathValue lookup(const Scope& scope, const string_type& name) const { typename Scope::const_iterator i = scope.find(name); if(i == scope.end()) return XPathValue(0); return i->second->value(); } // lookup
// Return the declaration associated with the name n, // or nullptr if no such name exists. Expr* lookup(Name* n) { Scope* s = current_scope(); while (s) { auto iter = s->find(n); if (iter != s->end()) return iter->second; s = s->parent; } return nullptr; }