MCPcopy
hub / github.com/donnemartin/gitsome / split

Method split

xonsh/lexer.py:451–476  ·  view source on GitHub ↗

Splits a string into a list of strings which are whitespace-separated tokens.

(self, s)

Source from the content-addressed store, hash-verified

449 t = self.token()
450
451 def split(self, s):
452 """Splits a string into a list of strings which are whitespace-separated
453 tokens.
454 """
455 vals = []
456 self.input(s)
457 l = c = -1
458 ws = "WS"
459 nl = "\n"
460 for t in self:
461 if t.type == ws:
462 continue
463 elif l < t.lineno:
464 vals.append(t.value)
465 elif len(vals) > 0 and c == t.lexpos:
466 vals[-1] = vals[-1] + t.value
467 else:
468 vals.append(t.value)
469 nnl = t.value.count(nl)
470 if nnl == 0:
471 l = t.lineno
472 c = t.lexpos + len(t.value)
473 else:
474 l = t.lineno + nnl
475 c = len(t.value.rpartition(nl)[-1])
476 return vals
477
478 #
479 # All the tokens recognized by the lexer

Callers 15

load_urlsMethod · 0.45
_shlex_splitMethod · 0.45
_format_push_eventMethod · 0.45
format_feed_entryMethod · 0.45
format_trending_entryMethod · 0.45
create_commentMethod · 0.45
create_issueMethod · 0.45
feedMethod · 0.45
issueMethod · 0.45
pull_requestsMethod · 0.45
repositoryMethod · 0.45

Calls 2

inputMethod · 0.95
appendMethod · 0.45

Tested by

no test coverage detected