Render entire scope subtree. Scope items are rendered first and bundles at the end (because most likely
they will be subtrees).

@param config tree config
@param root   root node
@param scope  scope to render
186205
private void renderScopeContent(final ContextTreeConfig config, final TreeNode root, final Class<?> scope) {
        renderScopeItems(config, root, scope);

        final List<Class<Object>> bundles = service.getData()
                .getItems(Filters.registeredBy(scope).and(Filters.type(ConfigItem.Bundle)));

        for (Class<Object> bundle : bundles) {
            renderBundle(config, root, scope, bundle);
        }
    }
563551
def render_with_scope(scope = nil, action = self.action_name, path = self.controller_path)
        templates = [ [path, action] ]
        templates << [path, scope, action] if scope
        
        if Sunrise::Config.scoped_views?
          templates << [path, abstract_model.plural, scope, action]
        end
        
        templates.reverse.each do |keys|
          name = File.join(*keys.compact.map(&:to_s))
          return render(:template => name) if template_exists?(name)
        end
      end
828915
private SymbolScope createScopeFrom(StaticScope otherScope) {
    Node otherScopeRoot = otherScope.getRootNode();

    SymbolScope myScope = scopes.get(otherScopeRoot);
    if (myScope == null) {
      StaticScope otherScopeParent = otherScope.getParentScope();

      // If otherScope is a global scope, and we already have a global scope,
      // then something has gone seriously wrong.
      //
      // Not all symbol tables are rooted at the same global node, and
      // we do not want to mix and match symbol tables that are rooted
      // differently.

      if (otherScopeParent == null) {
        // The global scope must be created before any local scopes.
        checkState(globalScope == null, "Global scopes found at different roots");
      }

      myScope =
          new SymbolScope(
              otherScopeRoot,
              otherScopeParent == null ? null : createScopeFrom(otherScopeParent),
              getTypeOfThis(otherScope),
              null);
      scopes.put(otherScopeRoot, myScope);
      if (myScope.isGlobalScope()) {
        globalScope = myScope;
      }
    }
    return myScope;
  }
650347
@Override
	public void setScope(String scope) {
		requireArgument(scope != null && !scope.trim().isEmpty(), "Scope cannot be null or empty.");
		super.setScope(scope);
	}
959834
@Override
    public String renderReport(final ContextTreeConfig config) {

        final Set<Class<?>> scopes = service.getActiveScopes(!config.isHideDisables());

        final TreeNode root = new TreeNode("APPLICATION");
        if (!config.getHiddenScopes().contains(Application.getType())) {
            renderScopeContent(config, root, Application.getType());
        }

        renderSpecialScope(config, scopes, root, "BUNDLES LOOKUP", BundleLookup);
        renderSpecialScope(config, scopes, root, "DROPWIZARD BUNDLES", DropwizardBundle);
        renderSpecialScope(config, scopes, root, "CLASSPATH SCAN", ClasspathScan);
        renderSpecialScope(config, scopes, root, "HOOKS", Hook);

        final StringBuilder res = new StringBuilder().append(Reporter.NEWLINE).append(Reporter.NEWLINE);
        root.render(res);
        return res.toString();
    }
47408
private static Scope getRootScope() {
        if (root == null) {
            synchronized (Scope.class) {
                root = new Scope(true);
                root.create("pi").makeConstant(Math.PI);
                root.create("euler").makeConstant(Math.E);
            }
        }

        return root;
    }
1034828
static void render(List<AbstractConfigValue> stack, StringBuilder sb, int indent, boolean atRoot, String atKey,
            ConfigRenderOptions options) {
        boolean commentMerge = options.getComments();
        if (commentMerge) {
            sb.append("# unresolved merge of " + stack.size() + " values follows (\n");
            if (atKey == null) {
                indent(sb, indent, options);
                sb.append("# this unresolved merge will not be parseable because it's at the root of the object\n");
                indent(sb, indent, options);
                sb.append("# the HOCON format has no way to list multiple root objects in a single file\n");
            }
        }

        List<AbstractConfigValue> reversed = new ArrayList<AbstractConfigValue>();
        reversed.addAll(stack);
        Collections.reverse(reversed);

        int i = 0;
        for (AbstractConfigValue v : reversed) {
            if (commentMerge) {
                indent(sb, indent, options);
                if (atKey != null) {
                    sb.append("#     unmerged value " + i + " for key "
                            + ConfigImplUtil.renderJsonString(atKey) + " from ");
                } else {
                    sb.append("#     unmerged value " + i + " from ");
                }
                i += 1;
                sb.append(v.origin().description());
                sb.append("\n");

                for (String comment : v.origin().comments()) {
                    indent(sb, indent, options);
                    sb.append("# ");
                    sb.append(comment);
                    sb.append("\n");
                }
            }
            indent(sb, indent, options);

            if (atKey != null) {
                sb.append(ConfigImplUtil.renderJsonString(atKey));
                if (options.getFormatted())
                    sb.append(" : ");
                else
                    sb.append(":");
            }
            v.render(sb, indent, atRoot, options);
            sb.append(",");
            if (options.getFormatted())
                sb.append('\n');
        }
        // chop comma or newline
        sb.setLength(sb.length() - 1);
        if (options.getFormatted()) {
            sb.setLength(sb.length() - 1); // also chop comma
            sb.append("\n"); // put a newline back
        }
        if (commentMerge) {
            indent(sb, indent, options);
            sb.append("# ) end of unresolved merge\n");
        }
    }
329276
function Scope(node,parent){
	this._nr = STACK.incr('scopes');
	this._head = [];
	this._node = node;
	this._parent = parent;
	this._vars = new VariableDeclaration([]);
	this._meta = {};
	this._annotations = [];
	this._closure = this;
	this._virtual = false;
	this._counter = 0;
	this._varmap = {};
	this._counters = {};
	this._varpool = [];
	this.setup();
}
904039
@Override
    public void link(NGScope scope, JQElement element, JSON attrs) {
        IsWidget widget = scope.get(getName());
        String id = "gwt-widget-" + counter++;
        element.attr("id", id);
        RootPanel.get(id).add(widget);
    }
852193
public void setRoot(int root)
  {

    super.setRoot(root);

  	m_exprObj = FilterExprIteratorSimple.executeFilterExpr(root, 
  	                  m_lpi.getXPathContext(), m_lpi.getPrefixResolver(), 
  	                  m_lpi.getIsTopLevel(), m_lpi.m_stackFrame, m_expr);

  }
967250
public void render(Template template, Writer out, GlobalScope... extraGlobalScopes) throws IOException {
    newInterpreter(extraGlobalScopes).process((TemplateImpl) template, out);
  }
952396
def apply_scopes(params = nil, pagination = true)
      raise ::AbstractController::ActionNotFound.new("List config is turn off") if without_index?
      params ||= @request_params
      
      scope = default_scope(params)

      if current_list == :tree
        scope = scope.roots
      elsif pagination
        scope = page_scope(scope, params[:page], params[:per])
      end

      scope
    end
820267
@Override
  public final FieldScopeLogic subScope(
      Descriptor rootDescriptor, FieldDescriptorOrUnknown fieldDescriptorOrUnknown) {
    FieldScopeResult result = policyFor(rootDescriptor, fieldDescriptorOrUnknown);
    if (result.recursive()) {
      return result.included() ? all() : none();
    } else {
      return subScopeImpl(rootDescriptor, fieldDescriptorOrUnknown);
    }
  }
1215143
@Override
    public void init(final Scope scope) throws InitializationException, InterruptedException {
        init(scope, RSBSharedConnectionConfig.getParticipantConfig());
    }
537519
function Scope(node, parent, scope, state) {
    // check if this scope has a local binding that will shadow the rest parameter
    if (!scope.bindingIdentifierEquals(state.name, state.outerBinding)) {
      this.skip();
    }
  }
1281131
public void setScope(String scopeName) {
        if ("page".equals(scopeName)) {
            scope = PageContext.PAGE_SCOPE;
        }
        else if ("request".equals(scopeName)) {
            scope = PageContext.REQUEST_SCOPE;
        }
        else if ("session".equals(scopeName)) {
            scope = PageContext.SESSION_SCOPE;
        }
        else if ("application".equals(scopeName)) {
            scope = PageContext.APPLICATION_SCOPE;
        }
    }
390499
@Override
  public TypedScope createScope(Node root, AbstractScope<?, ?> parent) {
    checkArgument(parent == null || parent instanceof TypedScope);
    TypedScope typedParent = (TypedScope) parent;

    TypedScope scope = memoized.get(root);
    if (scope != null) {
      checkState(typedParent == scope.getParent());
    } else {
      scope = createScopeInternal(root, typedParent);
      memoized.put(root, scope);
    }
    return scope;
  }