Esempio n. 1
0
    internal void Import(string nsName)
    {
        List <string> el;

        if (!EXPORT_LISTS.TryGetValue(nsName, out el))
        {
            throw new Exception(string.Format("no such export list: {0}", nsName));
        }
        foreach (string qualifiedName in el)
        {
            Alias  a;
            string rawName = Names.GetRaw(qualifiedName);
            if (!aliases.TryGetValue(rawName, out a))
            {
                aliases[rawName] =
                    new Alias(qualifiedName, false);
                continue;
            }
            if (a.destination == qualifiedName)
            {
                continue;
            }
            if (a.provenanceFlag)
            {
                continue;
            }
            a.destination = null;
        }
    }
Esempio n. 2
0
    /*
     * Export a name: that name must be qualified. It is added to the
     * export list of its namespace.
     */
    internal static void AddExportQualified(string name)
    {
        string nname = Names.GetNamespace(name);

        if (nname == null)
        {
            throw new Exception(string.Format("cannot export unqualified name: {0}", name));
        }
        List <string> el;

        if (EXPORT_LISTS.TryGetValue(nname, out el))
        {
            if (el.Contains(name))
            {
                return;
            }
        }
        else
        {
            el = new List <string>();
            EXPORT_LISTS[nname] = el;
        }
        el.Add(name);
    }