Esempio n. 1
0
 /// <summary>
 /// Removes the provided name from this scope removing names
 /// visible to both the current context and all contexts.
 /// </summary>
 public void RemoveNameForContext(LanguageContext context, SymbolId name)
 {
     if (!TryRemoveForContext(context, name))
     {
         throw context.MissingName(name);
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Removes the provided name from this scope removing names
 /// visible to both the current context and all contexts.
 /// </summary>
 public bool RemoveName(LanguageContext context, SymbolId name)
 {
     if (!TryRemoveName(context, name))
     {
         throw context.MissingName(name);
     }
     return(true);
 }
Esempio n. 3
0
        /// <summary>
        /// Attempts to lookup the provided name in this scope or any outer scope.  The
        /// search includes looking for names that are only visible to the provided LanguageContext.
        ///
        /// If the name is not defined the language defined MissingName exception is thrown.
        /// </summary>
        public object LookupName(LanguageContext context, SymbolId name)
        {
            object res;

            if (!TryLookupName(context, name, out res))
            {
                throw context.MissingName(name);
            }

            return(res);
        }