Enters a new scope by appending any necessary whitespace and the given
bracket.
516356
private JsonWriter open(int empty, String openBracket) throws IOException {
    beforeValue();
    pushScope(empty);
    pathIndices[stackSize - 1] = 0;
    sink.writeUtf8(openBracket);
    return this;
  }
954447
void processScope(Scope scope) {
    boolean shouldAddToBlockStack = !scope.isHoistScope();
    this.narrowScope = scope;
    if (shouldAddToBlockStack) {
      blockStack.add(new BasicBlock(null, scope.getRootNode()));
    }
    (new NodeTraversal(compiler, this, scopeCreator)).traverseAtScope(scope);
    if (shouldAddToBlockStack) {
      pop(blockStack);
    }
    this.narrowScope = null;
  }
1037224
public void addScope(IScope scope) {
        String app = scope.getName();
        // add the name to the collection (no '/' prefix)
        activeRooms.add(app);
        // check the context for a predefined websocket scope
        IContext ctx = scope.getContext();
        if (ctx != null && ctx.hasBean("webSocketScopeDefault")) {
            log.debug("WebSocket scope found in context");
            WebSocketScope wsScope = (WebSocketScope) scope.getContext().getBean("webSocketScopeDefault");
            if (wsScope != null) {
                log.trace("Default WebSocketScope has {} listeners", wsScope.getListeners().size());
            }
            // add to scopes
            scopes.put(String.format("/%s", app), wsScope);
        } else {
            log.debug("Creating a new scope");
            // add a default scope and listener if none are defined
            WebSocketScope wsScope = new WebSocketScope();
            wsScope.setScope(scope);
            wsScope.setPath(String.format("/%s", app));
            if (wsScope.getListeners().isEmpty()) {
                log.debug("adding default listener");
                wsScope.addListener(new DefaultWebSocketDataListener());
            }
            notifyListeners(WebSocketEvent.SCOPE_CREATED, wsScope);
            // add to scopes
            addWebSocketScope(wsScope);
        }
    }
1320449
function (token) {
            if (token.prev.type !== 'WhiteSpace') {
                insertBefore(token, whiteSpaceFactory());
            }
            if (token.next.type !== 'WhiteSpace' && token.next.type !== 'LineBreak') {
                insertAfter(token, whiteSpaceFactory());
            }
        }
935779
public void insertCode() throws IOException, ParseException {
        CompilationUnit cuResult = JavaParser.parse(baseFile);
        if (cuResult.getImports() != null) {
            List<ImportDeclaration> importsFromBaseFile = cuResult.getImports();
            for (ImportDeclaration eachImport : importsFromExtendedFile) {
                if (!importAlreadyPresent(importsFromBaseFile, eachImport)) {
                    importsFromBaseFile.add(eachImport);
                }
            }
            cuResult.setImports(importsFromBaseFile);
        }

        String code = cuResult.toString();

        BufferedWriter b = new BufferedWriter(new FileWriter(baseFile));
        b.write(code);
        b.close();
    }
1075326
private int newLocal(Type type, String typeDesc, Label begin, Label end) {
    int newVar = lvs.newLocal(type);
    getLocalScopes().add(new VariableScope(newVar, begin, end, typeDesc));
    return newVar;
  }
214728
function (text, scope, attrKey, bindingDefinitions) {
            if (!_.isString(text)) {
                return text;
            }

            bindingDefinitions = bindingDefinitions || this.parse(text);

            var binding,
                bindings = [],
                ret = [];

            for (var i = 0; i < bindingDefinitions.length; i++) {
                var bindingDef = bindingDefinitions[i];
                if (bindingDef.length) {
                    ret.push(bindingDef);
                } else {
                    try {
                        binding = this.create(bindingDef, scope, attrKey, ret);
                    } catch (e) {
                        throw new Error("Create binding for '" + text + "'. " + e.message);
                    }

                    if (binding instanceof Binding) {
                        bindings.push(binding);
                        scope.$bindings[attrKey] = scope.$bindings[attrKey] || [];
                        scope.$bindings[attrKey].push(binding);
                    }
                    ret.push(binding);
                }

            }

            if (bindings.length > 0) {
                return bindings[0].getContextValue();
            } else if (ret.length > 0) {
                if (ret.length === 1) {
                    return ret[0];
                }
                return Binding.contextToString(ret);
            } else {
                return text;
            }

        }
149038
public void enterScopeNonInheritable() {
		checkState(nonInheritableScopeCache.get() == null, "Scope has already been entered. Forgot to call exitScope()?");
		Map<Key<?>, Object> scopeMap = newHashMap();
		nonInheritableScopeCache.set(scopeMap);
		log.debug("Entered non-inheritable scope.");
	}
971031
def expand(template, variables):
    
    def _sub(match):
        expression = match.group(1)
        operator = ""
        if expression[0] in OPERATOR:
            operator = expression[0]
            varlist = expression[1:]
        else:
            varlist = expression

        safe = ""
        if operator in ["+", "#"]:
            safe = RESERVED
        varspecs = varlist.split(",")
        varnames = []
        defaults = {}
        for varspec in varspecs:
            default = None
            explode = False
            prefix = None
            if "=" in varspec:
                varname, default = tuple(varspec.split("=", 1))
            else:
                varname = varspec
            if varname[-1] == "*":
                explode = True
                varname = varname[:-1]
            elif ":" in varname:
                try:
                    prefix = int(varname[varname.index(":")+1:])
                except ValueError:
                    raise ValueError("non-integer prefix '{0}'".format(
                       varname[varname.index(":")+1:]))
                varname = varname[:varname.index(":")]
            if default:
                defaults[varname] = default
            varnames.append((varname, explode, prefix))

        retval = []
        joiner = operator
        start = operator
        if operator == "+":
            start = ""
            joiner = ","
        if operator == "#":
            joiner = ","
        if operator == "?":
            joiner = "&"
        if operator == "&":
            start = "&"
        if operator == "":
            joiner = ","
        for varname, explode, prefix in varnames:
            if varname in variables:
                value = variables[varname]
                if not value and value != "" and varname in defaults:
                    value = defaults[varname]
            elif varname in defaults:
                value = defaults[varname]
            else:
                continue
            expanded = TOSTRING[operator](
              varname, value, explode, prefix, operator, safe=safe)
            if expanded is not None:
                retval.append(expanded)
        if len(retval) > 0:
            return start + joiner.join(retval)
        else:
            return ""

    return TEMPLATE.sub(_sub, template)
698792
function (cb, scope) {
            var es = this.__entrySet(), l = es.length, f = cb.bind(scope || this);
            es.forEach.apply(es, arguments);
        }
704389
def add_scopes(query, scope_param)
      scopes = []
      scopes.concat scope_param.split ':' unless scope_param.nil?
      scopes.concat params[:scopes] if params[:scopes].is_a?(Array)
      scopes.each do |scope|
        method, arg_string = scope.split(/(?<=[^\\])\(/)
        if !arg_string.nil?
          arg_string = arg_string.chop.gsub(/\\\\/, "\\backspace").gsub(/\\period/, '.')
          # split on non-escaped commas
          args = arg_string.split(/(?<=[^\\]),/).map(&:strip)
          # map escaped characters to normal values
          args = args.map {|arg| arg.gsub(/\\,/, ',')}.map {|arg| arg.gsub(/\\\(/, '(')}.map {|arg| arg.gsub(/\\backspace/, '\\')}
          query = query.send method.to_sym, *args
        else
          query = query.send method.to_sym
        end
      end
      query
    end
237791
public final void mOPEN_BRACKET() throws RecognitionException {
		try {
			int _type = OPEN_BRACKET;
			int _channel = DEFAULT_TOKEN_CHANNEL;
			// hql.g:751:13: ( '[' )
			// hql.g:751:15: '['
			{
			match('['); if (state.failed) return;
			}

			state.type = _type;
			state.channel = _channel;
		}
		finally {
			// do for sure before leaving
		}
	}
567499
NullSafeAccumulator bracketAccess(Expression arg, boolean nullSafe) {
    chain.add(new Bracket(arg, nullSafe));
    // With a bracket access we no longer need to unpack the entire list, just a singular object.
    accessType = AccessType.SINGULAR;
    return this;
  }
345432
private void beforeKey() throws JSONException {
        Scope context = peek();
        if (context == Scope.NONEMPTY_OBJECT) { // first in object
            out.append(',');
        } else if (context != Scope.EMPTY_OBJECT) { // not in an object!
            throw new JSONException("Nesting problem");
        }
        newline();
        replaceTop(Scope.DANGLING_KEY);
    }
1175144
def addBinding(self, node, value):
        
        # assert value.source in (node, node.parent):
        for scope in self.scopeStack[::-1]:
            if value.name in scope:
                break
        existing = scope.get(value.name)

        if (existing and not isinstance(existing, Builtin) and
                not self.differentForks(node, existing.source)):

            parent_stmt = self.getParent(value.source)
            if isinstance(existing, Importation) and isinstance(parent_stmt, FOR_TYPES):
                self.report(messages.ImportShadowedByLoopVar,
                            node, value.name, existing.source)

            elif scope is self.scope:
                if (isinstance(parent_stmt, ast.comprehension) and
                        not isinstance(self.getParent(existing.source),
                                       (FOR_TYPES, ast.comprehension))):
                    self.report(messages.RedefinedInListComp,
                                node, value.name, existing.source)
                elif not existing.used and value.redefines(existing):
                    if value.name != '_' or isinstance(existing, Importation):
                        if not is_typing_overload(existing, self.scopeStack):
                            self.report(messages.RedefinedWhileUnused,
                                        node, value.name, existing.source)

            elif isinstance(existing, Importation) and value.redefines(existing):
                existing.redefined.append(node)

        if value.name in self.scope:
            # then assume the rebound name is used as a global or within a loop
            value.used = self.scope[value.name].used

        self.scope[value.name] = value
1368040
@Override
	public void enterScope() {
		scopeStackCache.get().push(new HashMap<Key<?>, Object>());
		log.debug("Entered scope.");
	}
398028
private void addScopeVariables() {
    int num = 0;
    for (Var v : orderedVars) {
      scopeVariables.put(v.getName(), num);
      num++;
    }
  }