Transpiled version (2501L) is out of date.
// rtrims each item static LS tok_splitAtEmptyLines(S s) { new L<Int> indices; LS tok = javaTokWithAllBrackets_cached(s); new LS out; int start = 0; S spacing = ""; for (int i = 2; i+1 < l(tok); i += 2) { int idx = indexOf_regexp(tok.get(i), "\r?\n\\s*\r?\n"); if (idx < 0) continue; int idx2 = idx+1; if (tok.get(i).charAt(idx) == '\r') ++idx2; out.add(dropPrefix("\n", spacing + joinSubList(tok, start, i))); start = i+1; spacing = substring(tok.get(i), idx2); // TODO: not exact } if (start < l(tok)) out.add(dropPrefix("\n", spacing + joinSubList(tok, start))); ret out; }
Began life as a copy of #1024054
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
| Snippet ID: | #1025618 |
| Snippet name: | tok_splitAtEmptyLines - token-aware split at empty lines |
| Eternal ID of this version: | #1025618/7 |
| Text MD5: | ac509bde230a3e3e776a6570460e5e7c |
| Author: | stefan |
| Category: | javax / parsing |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2020-05-17 14:46:55 |
| Source code size: | 645 bytes / 20 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 515 / 656 |
| Version history: | 6 change(s) |
| Referenced in: | [show references] |