Copies all symbols from source scope to dest scope.
(Scope source, Scope dest)
| 127 | |
| 128 | /** Copies all symbols from source scope to dest scope. */ |
| 129 | public static void joinScopes(Scope source, Scope dest) { |
| 130 | Map<String, Symbol> src = source.ensureSymbolTable(); |
| 131 | Map<String, Symbol> dst = dest.ensureSymbolTable(); |
| 132 | if (!Collections.disjoint(src.keySet(), dst.keySet())) { |
| 133 | codeBug(); |
| 134 | } |
| 135 | for (Map.Entry<String, Symbol> entry : src.entrySet()) { |
| 136 | Symbol sym = entry.getValue(); |
| 137 | sym.setContainingTable(dest); |
| 138 | dst.put(entry.getKey(), sym); |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | /** |
| 143 | * Returns the scope in which this name is defined |
no test coverage detected