Beispiel #1
0
		/// <summary>Copies all symbols from source scope to dest scope.</summary>
		/// <remarks>Copies all symbols from source scope to dest scope.</remarks>
		public static void JoinScopes(Rhino.Ast.Scope source, Rhino.Ast.Scope dest)
		{
			IDictionary<string, Symbol> src = source.EnsureSymbolTable();
			IDictionary<string, Symbol> dst = dest.EnsureSymbolTable();
			if (!Sharpen.Collections.Disjoint(src.Keys, dst.Keys))
			{
				CodeBug();
			}
			foreach (KeyValuePair<string, Symbol> entry in src.EntrySet())
			{
				Symbol sym = entry.Value;
				sym.SetContainingTable(dest);
				dst.Put(entry.Key, sym);
			}
		}