environment add_namespace(environment const & env, name const & ns) { scope_mng_ext ext = get_extension(env); if (!ext.m_namespace_set.contains(ns)) { ext.m_namespace_set.insert(ns); environment r = update(env, ext); r = module::add(r, *g_new_namespace_key, [=](environment const &, serializer & s) { s << ns; }); if (ns.is_atomic()) return r; else return add_namespace(r, ns.get_prefix()); } else { return env; } }
static bool is_explicit_placeholder(name const & n) { return !n.is_atomic() && n.get_prefix() == *g_explicit_placeholder_name; }
static bool is_placeholder(name const & n) { if (n.is_atomic()) return false; name const & p = n.get_prefix(); return p == *g_implicit_placeholder_name || p == *g_strict_placeholder_name || p == *g_explicit_placeholder_name; }