Split a line after the given node.
199831
function breakAfter(lineEndNode) {
    // If there's nothing to the right, then we can skip ending the line
    // here, and move root-wards since splitting just before an end-tag
    // would require us to create a bunch of empty copies.
    while (!lineEndNode.nextSibling) {
      lineEndNode = lineEndNode.parentNode;
      if (!lineEndNode) { return; }
    }

    function breakLeftOf(limit, copy) {
      // Clone shallowly if this node needs to be on both sides of the break.
      var rightSide = copy ? limit.cloneNode(false) : limit;
      var parent = limit.parentNode;
      if (parent) {
        // We clone the parent chain.
        // This helps us resurrect important styling elements that cross lines.
        // E.g. in <i>Foo<br>Bar</i>
        // should be rewritten to <li><i>Foo</i></li><li><i>Bar</i></li>.
        var parentClone = breakLeftOf(parent, 1);
        // Move the clone and everything to the right of the original
        // onto the cloned parent.
        var next = limit.nextSibling;
        parentClone.appendChild(rightSide);
        for (var sibling = next; sibling; sibling = next) {
          next = sibling.nextSibling;
          parentClone.appendChild(sibling);
        }
      }
      return rightSide;
    }

    var copiedListItem = breakLeftOf(lineEndNode.nextSibling, 0);

    // Walk the parent chain until we reach an unattached LI.
    for (var parent;
         // Check nodeType since IE invents document fragments.
         (parent = copiedListItem.parentNode) && parent.nodeType === 1;) {
      copiedListItem = parent;
    }
    // Put it on the list of lines for later processing.
    listItems.push(copiedListItem);
  }
734736
def split(self, text):
        '''
        
        '''
        # nesting character -> count
        counters = {"'": False, '(': 0}

        def reverse(char):

            def wrapped():
                counters[char] = not counters[char]
            return wrapped

        def increase(char):

            def wrapped():
                counters[char] += 1
            return wrapped

        def decrease(char):

            def wrapped():
                counters[char] -= 1
            return wrapped

        def is_top_level():
            return all([not x for x in counters.values()])

        def fail():
            raise BadSyntax('Syntax error processing line: %s' %\
                            self._last_line)


        temp = ""
        # end of field flag indicates that we expect next character to be
        # either whitespace of split
        eof_flag = False

        def append_char(temp, char):
            if eof_flag:
                fail()
            temp += char
            return temp

        # dictionary char -> handler
        nesters = {"'": reverse("'"), "(": increase('('), ")": decrease('(')}
        # chars to split on
        split = (',', )
        # chars to swallow
        consume = (' ', '\n')

        result = list()

        self.log("spliting: %s", text)

        for char in text:
            if char in nesters:
                nesters[char]()
                temp = append_char(temp, char)
            elif not is_top_level():
                temp = append_char(temp, char)
            elif char in consume:
                if len(temp) > 0:
                    eof_flag = True
                continue
            elif char in split:
                result.append(temp)
                temp = ""
                eof_flag = False
            else:
                temp = append_char(temp, char)
        if len(temp) > 0:
            result.append(temp)

        if not is_top_level():
            fail()
        self.log('Split returns %r', result)
        return result
1031707
function removeEmptyLinesAfter(
  node /*: postcss$node*/,
  newline /*: '\n' | '\r\n'*/
) /*: postcss$node*/ {
  node.raws.after = node.raws.after.replace(/(\r?\n\s*\r?\n)+/g, newline);

  return node;
}
774804
def newline(self, node=None, extra=0):
        """"""
        self._new_lines = max(self._new_lines, 1 + extra)
        if node is not None and node.lineno != self._last_line:
            self._write_debug_info = node.lineno
            self._last_line = node.lineno
744619
def get_text_line(self, line_nb):
        """"""
        # Taking into account the case when a file ends in an empty line,
        # since splitlines doesn't return that line as the last element
        # TODO: Make this function more efficient
        try:
            return to_text_string(self.toPlainText()).splitlines()[line_nb]
        except IndexError:
            return self.get_line_separator()
902575
function splitUpParagraph(segment, resultStr, stack, tokens, tokenIndex) {
	let startOfWord = resultStr.indexOf(stack[0].complete) + 1;
	let textBeforeSelected = resultStr.slice(0, startOfWord);
	let startToken = tokens[2][tokenIndex];
	let selected = resultStr.slice(startOfWord + segment.length - 1, resultStr.indexOf(segment));
	let endToken = tokens[3][tokenIndex];
	let textAfterSelected = resultStr.slice(resultStr.indexOf(segment) + segment.length - 1);
	return textBeforeSelected + startToken + selected + endToken + textAfterSelected;
}
1124859
public void split() {
        if (!needsSplitting()) {
            return;
        }

        Node parent = getParentNode();
        String[] parts = getData().split("\\]\\]>");
        parent.insertBefore(new CDATASectionImpl(document, parts[0] + "]]"), this);
        for (int p = 1; p < parts.length - 1; p++) {
            parent.insertBefore(new CDATASectionImpl(document, ">" + parts[p] + "]]"), this);
        }
        setData(">" + parts[parts.length - 1]);
    }
791661
function hasNewlineAfter(node) {
            const lastToken = getLastTokenOnLine(node);
            const tokenAfter = sourceCode.getTokenAfter(lastToken, { includeComments: true });

            return tokenAfter.loc.start.line - lastToken.loc.end.line >= 2;
        }
1081437
function processTextNode(node, options) {
    options = options || {};

    var data = [].concat(getBasicFields(node, options)).
        concat([
            node.lineCount
        ]);

    if (!options.body) {
        data = data.concat(getExtensionFields(node, options));
    }

    data.node = node;
    return data;
}
330904
def find_next_comma(self, node, sub):
        """"""
        position = (sub.last_line, sub.last_col)
        first, last = find_next_comma(self.lcode, position)
        if first:  # comma exists
            node.op_pos.append(NodeWithPosition(last, first))
883893
def bsp_split_once(
    node: tcod.bsp.BSP, horizontal: bool, position: int
) -> None:
    
    node.split_once(horizontal, position)
283549
def _split_vlines_hlines(lines):
    """"""
    vlines, hlines = [], []
    for line in lines:
        (vlines if line.x1 - line.x0 < 0.1 else hlines).append(line)
    return vlines, hlines
923413
def _split(string, splitters):
    """"""
    part = ''
    for character in string:
        if character in splitters:
            yield part
            part = ''
        else:
            part += character
    yield part
961002
def split_seq(iterable, size):
    """"""
    elm = iter(iterable)
    item = list(itertools.islice(elm, size))
    while item:
        yield item
        item = list(itertools.islice(elm, size))
1197853
private final BinTreeNode<K,V> extract_next(BinTreeNode<K,V> node) {
	BinTreeNode<K,V> prev = node.right;
	BinTreeNode<K,V> curr = prev.left;

	if(curr == null) {
	    node.right = node.right.right;
	    return prev;
	}

	while(curr.left != null) {
	    prev = curr;
	    curr = curr.left;
	}

	prev.left = curr.right;
	return curr;
    }
748124
def split(self, decl_string):
        """"""
        assert self.has_pattern(decl_string)
        return self.name(decl_string), self.args(decl_string)
1195745
function splitTag(editor, node, cursor) {
	const open = getText(editor, node.open);
	const m = open.match(/(\s*\/)?>$/);
	const start = node.open.end.translate([0, m ? -m[0].length : 0]);
	editor.setTextInBufferRange(new Range(start, node.open.end), `></${node.name}>`);

	if (cursor) {
		cursor.setBufferPosition(start.translate([0, 1]));
	}
}