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
Beispiel #2
0
// 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;
}