Closes the current scope by appending any necessary whitespace and the
given bracket.
964377
private FastJsonWriter close(int empty, int nonempty, String closeBracket)
      {
    int context = peek();
    if (context != nonempty && context != empty) {
      throw new IllegalStateException("Nesting problem.");
    }
    if (deferredUnescapeName != null || deferredName != null) {
      throw new IllegalStateException("Dangling name: " + (deferredUnescapeName == null ? deferredName : deferredUnescapeName));
    }

    stackSize--;
    if (context == nonempty) {
      newline();
    }
    out.append(closeBracket);
    return this;
  }
846100
def close_ns(symbol):
        ''''''
        closing = ' '.join(['}' for x in symbol.module.name_parts])
        name = '::'.join(symbol.module.name_parts)
        return '{0} // namespace {1}'.format(closing, name)
514948
@Override
	public void exitScope() {
		Map<Key<?>, Object> scopeMap = scopeStackCache.get().peek();
		performDisposal(scopeMap);
		scopeStackCache.get().pop();
		log.debug("Exited scope.");
	}
43924
function trimTrailingWhitespace(index, nextTag) {
    for (var endTag = null; index >= 0 && _canTrimWhitespace(endTag); index--) {
      var str = buffer[index];
      var match = str.match(/^<\/([\w:-]+)>$/);
      if (match) {
        endTag = match[1];
      }
      else if (/>$/.test(str) || (buffer[index] = collapseWhitespaceSmart(str, null, nextTag, options))) {
        break;
      }
    }
  }
961873
private void popScope(boolean quietly) {
    if (!quietly && scopeCallback != null) {
      scopeCallback.exitScope(this);
    }
    Node scopeRoot;
    int roots = scopeRoots.size();
    if (roots > 0) {
      scopeRoot = scopeRoots.remove(roots - 1);
    } else {
      scopeRoot = scopes.pop().getRootNode();
    }
    if (NodeUtil.isValidCfgRoot(scopeRoot)) {
      cfgs.pop();
    }
  }
1050434
@Override
  public void exitNotExpression(GDLParser.NotExpressionContext ctx) {
    if (!ctx.NOT().isEmpty()) {
      Predicate not = new Not(currentPredicates.pop());
      currentPredicates.add(not);
    }
  }
732789
void close() {
    final ContextStop contextStop = new ContextStopImpl(this.identifier);
    for (final EventHandler<ContextStop> stopHandler : this.contextStopHandlers) {
      stopHandler.onNext(contextStop);
    }
  }
330415
private void bracketAddOpening(BracketData bd, char match, int position) {
        IsoRun pLastIsoRun = bd.isoRuns[bd.isoRunLast];
        Opening pOpening;
        if (pLastIsoRun.limit >= bd.openings.length) {  /* no available new entry */
            Opening[] saveOpenings = bd.openings;
            int count;
            try {
                count = bd.openings.length;
                bd.openings = new Opening[count * 2];
            } catch (Exception e) {
                throw new OutOfMemoryError("Failed to allocate memory for openings");
            }
            System.arraycopy(saveOpenings, 0, bd.openings, 0, count);
        }
        pOpening = bd.openings[pLastIsoRun.limit];
        if (pOpening == null)
            pOpening = bd.openings[pLastIsoRun.limit]= new Opening();
        pOpening.position = position;
        pOpening.match = match;
        pOpening.contextDir = pLastIsoRun.contextDir;
        pOpening.contextPos = pLastIsoRun.contextPos;
        pOpening.flags = 0;
        pLastIsoRun.limit++;
    }
342384
public void removeSpaceToLastLineBreak(IContext ctx) {
        boolean shouldRemoveSpace = true;
        List<Token> bl = builders();
        for (int i = bl.size() - 1; i >= 0; --i) {
            TextBuilder tb = bl.get(i);
            if (tb == Token.EMPTY_TOKEN || tb instanceof IDirective) {
                continue;
            }
            if (tb.getClass().equals(Token.StringToken.class)) {
                String s = tb.toString();
                if (s.matches("[ \\t\\x0B\\f]+")) {
                    continue;
                } else if (s.matches("(\\n\\r|\\r\\n|[\\r\\n])")) {
                } else {
                    shouldRemoveSpace = false;
                }
            }
            break;
        }
        if (shouldRemoveSpace) {
            for (int i = bl.size() - 1; i >= 0; --i) {
                TextBuilder tb = bl.get(i);
                if (tb == Token.EMPTY_TOKEN || tb instanceof IDirective) {
                    continue;
                }
                if (tb.getClass().equals(Token.StringToken.class)) {
                    String s = tb.toString();
                    if (s.matches("[ \\t\\x0B\\f]+")) {
                        bl.remove(i);
                        continue;
                    } else if (s.matches("(\\n\\r|\\r\\n|[\\r\\n])")) {
                        bl.remove(i);
                    }
                }
                break;
            }
        }
    }
306043
def add_scope(self, scope_type, scope_name, scope_start, is_method=False):
        """"""
        if self._curr is not None:
            self._curr['end'] = scope_start - 1  # close last scope
        self._curr = {
            'type': scope_type, 'name': scope_name,
            'start': scope_start, 'end': scope_start
        }

        if is_method and self._positions:
            last = self._positions[-1]
            if not 'methods' in last:
                last['methods'] = []
            last['methods'].append(self._curr)
        else:
            self._positions.append(self._curr)
1347448
public void close() throws IOException {
    // Handle leftover bytes
    if (charCount % 3 == 1) { // one leftover
      int lookup = (carryOver << 4) & 63;
      out.write(chars[lookup]);
      out.write('=');
      out.write('=');
    } else if (charCount % 3 == 2) { // two leftovers
      int lookup = (carryOver << 2) & 63;
      out.write(chars[lookup]);
      out.write('=');
    }
    super.close();
  }
515305
public void close() throws IOException {
        if (in != null) {
            try {
                // Clean up
                if (usesDefaultDeflater) {
                    def.end();
                }

                in.close();
            } finally {
                in = null;
            }
        }
    }
16802
function setClosing(tokenOrLexer) {
    metaObj.endLine = tokenOrLexer.line;
    metaObj.endCol = tokenOrLexer.col;

    // whitespace or comments that preceded the end token
    // (e.g. on a () list whitespace or comments that preceded ")")
    metaObj.endPrelude = tokenOrLexer.prelude;
  }
235717
public void close() {
		JWindow w;
		synchronized (this) {
			if (!synch.isUnblocked()) synch.unblock();
			if (win == null) return;
			w = win;
			win = null;
		}
		if (event != null)
			event.fire();
		w.setVisible(false);
		w.removeAll();
		w.dispose();
		RepaintManager.setCurrentManager(null);
		logoContainer = null;
		titleContainer = null;
		bottom = null;
		progressText = null;
		progressSubText = null;
		progressBar = null;
		poweredBy = null;
		logo = null;
		title = null;
		text = null;
		subText = null;
		event = null;
	}
1303256
private void closeValueLength(int value, int index) {
    int initialValue = toIntUnsigned(getValue(index));
    setLength(index, (short) (value - initialValue));
  }
545801
private void pop(char closer) throws JSONException {
        if (m_top <= -1) {
            throw new JSONException("Nesting error.");
        }
        try {
            m_writer.write(closer);
        }
        catch (IOException e) {
            throw new JSONException(e);
        }
        --m_top;
        m_mode = (m_top == -1) ?
                'd' :
                (m_scopeStack[m_top] == null) ? 'a' : 'k';
        m_expectingComma = true;
    }
212293
def clear(self, scope = 'screen'):
        """"""
        if scope == 'line':
            self.clear('beginning of line')
            self.clear('end of line')
        else: self.stream.write(self._get_cap('clear '+scope))
        self.flush()