Push the textbuffer onto the stack as a Text node and clear it.
347397
def _push_textbuffer(self):
        """"""
        if self._textbuffer:
            self._stack.append(tokens.Text(text="".join(self._textbuffer)))
            self._textbuffer = []
484030
def clear(self):
        
        super(XTextEdit, self).clear()
        
        self.textEntered.emit('')
        self.htmlEntered.emit('')
        
        if self.autoResizeToContents():
            self.resizeToContents()
1121665
function () {
            if (this.__stackCache) {
                for (var key in this.__stackCache) {
                    if (this.__stackCache.hasOwnProperty(key)) {
                        var stack = this.__stackCache[key];
                        // break dom reference
                        for (var i = 0, l = stack.length; i < l; i++) {
                            stack.target = null;
                            stack.expandoValue = null;
                            delete stack.target;
                            delete stack.expandoValue;
                        }
                        delete this.__stackCache[i];
                    }
                }
                this.__stackCache = null;
            }
        }
195253
def clear(self):
        """"""
        for i, value in enumerate(self.buffer):
            self.buffer[i] = 0
414360
def _reset_plain(self):
        ''''''
        if self._text:
            self._blocks.append(BlockText('\n'.join(self._text)))
        self._text.clear()
193332
protected function flush()
    {
        $node = null;

        $this->isCode = false;

        if ($this->buffer) {
            switch ($this->state) {
            case self::STATE_TITLE:
                $data = implode("\n", $this->buffer);
                $level = $this->environment->getLevel($this->specialLetter);
                $token = $this->environment->createTitle($level);
                $node = $this->kernel->build('Nodes\TitleNode', $this->createSpan($data), $level, $token);
                break;
            case self::STATE_SEPARATOR:
                $level = $this->environment->getLevel($this->specialLetter);
                $node = $this->kernel->build('Nodes\SeparatorNode', $level);
                break;
            case self::STATE_CODE:
                $node = $this->kernel->build('Nodes\CodeNode', $this->buffer);
                break;
            case self::STATE_BLOCK:
                $node = $this->kernel->build('Nodes\QuoteNode', $this->buffer);
                $data = $node->getValue();
                $subParser = $this->getSubParser();
                $document = $subParser->parseLocal($data);
                $node->setValue($document);
                break;
            case self::STATE_LIST:
                $this->pushListLine(null, true);
                $node = $this->buffer;
                break;
            case self::STATE_TABLE:
                $node = $this->buffer;
                $node->finalize($this);
                break;
            case self::STATE_NORMAL:
                $this->isCode = $this->prepareCode();
                $node = $this->kernel->build('Nodes\ParagraphNode', $this->createSpan($this->buffer));
                break;
            }
        }

        if ($this->directive) {
            $currentDirective = $this->getCurrentDirective();
            if ($currentDirective) {
                $currentDirective->process($this, $node, $this->directive['variable'], $this->directive['data'], $this->directive['options']);
            }
            $node = null;
        }

        $this->directive = null;

        if ($node) {
            $this->document->addNode($node);
        }

        $this->init();
    }
419229
public StackNode<E> clean() {
        do {
            final StackNode<E> oldTop = top.get();
            if (top.compareAndSet(oldTop, null))
                return oldTop;

        } while (true);
    }
1068523
function () {
                var me = this, lines = me._consolidateLines();
                me._buffer.length = 0;
                me._pushBackLastLineIfNotEmpty(lines);
                _gpfArrayForEach(lines, function (line) {
                    me._appendToReadBuffer(line);
                });
            }
1093654
public void clearAll()
    {
        for (int i = 0; i < textFields.size(); i++)
        {
            JTextField textField = textFields.get(i);
            if (textField == null)
            {
                continue;
            }
            textField.setText("");
        }
    }
1289101
public function endStack()
    {
        $stacks = array_pop($this->stacks);

        $stacks = (array) $stacks;

        foreach ($stacks as $block) {
            $content = $this->pushes[$block];

            if (is_null($content)) {
                $content = $this->tintin->getCompiler()->compile(ob_get_clean());
            }

            $this->pushes[$block] = trim($content, "\n");
        }
    }
1140955
final void cleanStack() {
    boolean unlinked = false;
    Completion p;
    while ((p = stack) != null && !p.isLive()) // ensure head of stack live
      unlinked = casStack(p, p.next);
    if (p != null && !unlinked) { // try to unlink first nonlive
      for (Completion q = p.next; q != null;) {
        Completion s = q.next;
        if (q.isLive()) {
          p = q;
          q = s;
        } else {
          casNext(p, q, s);
          break;
        }
      }
    }
  }
887142
private void flushBuffer()
            throws IOException
    {
        if (buffer.position() > 0) {
            buffer.flip();
            writeCompressed(buffer);
            buffer.clear();
        }
    }
621274
@Override
    public void clear() {
        _rows = 0;
        Arrays.fill(_value, null);
        Arrays.fill(_tree, (char) 0);
        Arrays.fill(_key, null);
    }
512624
private void flushEventBuffer() {
        Holder<T> holder = buffer.get();
        logger.accept(holder.getBuffer().get());
        holder.clear();
    }
185702
public void clear() {
        final boolean bTrace = TraceComponent.isAnyTracingEnabled();
        if (bTrace && tc.isEntryEnabled()) {
            Tr.entry(tc, "clear");
        }

        clearAllHeaders();
        this.eohPosition = HeaderStorage.NOTSET;
        this.currentElem = null;
        this.stateOfParsing = PARSING_CRLF;
        this.binaryParsingState = GenericConstants.PARSING_HDR_FLAG;
        this.parsedToken = null;
        this.parsedTokenLength = 0;
        this.bytePosition = 0;
        this.byteLimit = 0;
        this.currentReadBB = null;
        clearBuffers();
        this.debugContext = this;
        this.numCRLFs = 0;
        this.bIsMultiLine = false;
        this.lastCRLFBufferIndex = HeaderStorage.NOTSET;
        this.lastCRLFPosition = HeaderStorage.NOTSET;
        this.lastCRLFisCR = false;
        this.headerChangeCount = 0;
        this.headerAddCount = 0;
        this.bOverChangeLimit = false;
        this.compactHeaderFlag = false;
        this.table = null;
        this.isPushPromise = false;
        this.processedXForwardedHeader = false;
        this.processedForwardedHeader = false;
        this.forwardHeaderErrorState = false;
        this.forwardedByList = null;
        this.forwardedForList = null;
        this.forwardedHost = null;
        this.forwardedPort = null;
        this.forwardedProto = null;

        if (bTrace && tc.isEntryEnabled()) {
            Tr.exit(tc, "clear");
        }
    }
739978
public function clear()
    {
        if ($this->childNodes->length > 0) {
            foreach ($this->childNodes as $childNode) {
                $this->removeChild($childNode);
            }
        }

        $this->textContent = null;
    }
898339
public void clearLast(int N) {
        if (N < 1) {
            throw new IllegalArgumentException("Unable to clear " + N + " lines");
        }
        if (N > count()) {
            throw new IllegalArgumentException("Count: " + N + ", Size: " + count());
        }
        if (N == count()) {
            clear();
            return;
        }

        terminal.format("\r%s", CURSOR_ERASE);
        buffer.remove(buffer.size() - 1);
        for (int i = 1; i < N; ++i) {
            terminal.format("%s%s", UP, CURSOR_ERASE);
            buffer.remove(buffer.size() - 1);
        }

        terminal.format("%s\r%s",
                        UP,
                        cursorRight(printableWidth(lastLine())));
    }