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

13
LINES

< > BotCompany Repo | #1003150 // joinBrackets - returns new list - uses "()", "{}"

JavaX fragment (include)

static L<S> joinBrackets(L<S> tok) {
  new L<S> t;
  Map<Int, Int> map = getBracketMap(tok);
  for (int i = 0; i < l(tok); i++) {
    Int dest = map.get(i);
    if (dest != null) {
      t.add(join(subList(tok, i, dest+1)));
      i = dest;
    } else
      t.add(tok.get(i));
  }
  ret t;
}

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: #1003150
Snippet name: joinBrackets - returns new list - uses "()", "{}"
Eternal ID of this version: #1003150/3
Text MD5: fa7495f0dfd32bc692144b8c82e0e89c
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-05-15 15:55:11
Source code size: 303 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 555 / 568
Version history: 2 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1008282 - tok_bracketsToQuoted
#1008799 - xtok_joinBrackets