Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

8
LINES

< > BotCompany Repo | #1008439 // tok_joinEllipsis_flex - join ". . ." or "..." into one token. Not very optimized

JavaX fragment (include)

static L<S> tok_joinEllipsis_flex(L<S> tok) {
  for (int i = 1; i+4 < l(tok); i += 2)
    if (allEq(".", get(tok, i), get(tok, i+2), get(tok, i+4))) {
      removeSubList(tok, i+1, i+5);
      tok.set(i, "...");
    }
  ret tok;
}

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1008439
Snippet name: tok_joinEllipsis_flex - join ". . ." or "..." into one token. Not very optimized
Eternal ID of this version: #1008439/5
Text MD5: 524b4237ae3feafa5e4b8caa58b0f746
Author: stefan
Category: javax / parsing
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-03-27 15:19:20
Source code size: 237 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 428 / 466
Version history: 4 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)