code: public void remove(final Symbol sym) {
          Assert.check(shared == 0);
          Entry e = lookup(sym.name, new Filter<Symbol>() {
              @Override
              public boolean accepts(Symbol candidate) {
                  return candidate == sym;
              }
          });
          if (e.scope == null) return;
  
          // remove e from table and shadowed list;
          int i = getIndex(sym.name);
          Entry te = table[i];
          if (te == e)
              table[i] = e.shadowed;
          else while (true) {
              if (te.shadowed == e) {
                  te.shadowed = e.shadowed;
                  break;
              }
              te = te.shadowed;
          }
  
          // remove e from elems and sibling list
          te = elems;
          if (te == e)
              elems = e.sibling;
          else while (true) {
              if (te.sibling == e) {
                  te.sibling = e.sibling;
                  break;
              }
              te = te.sibling;
          }
  
          //notify listeners
          for (List<ScopeListener> l = listeners; l.nonEmpty(); l = l.tail) {
              l.head.symbolRemoved(sym, this);
          }
      }
docs: Remove symbol from this scope.