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

13
LINES

< > BotCompany Repo | #1008808 // xtok_joinBrackets3

JavaX fragment (include)

1  
static L xtok_joinBrackets3(L tok) {
2  
  new L t;
3  
  Map<Int, Int> map = getBracketMap(tok);
4  
  for (int i = 0; i < l(tok); i++) {
5  
    Int dest = map.get(i);
6  
    if (dest != null && !(i == 1 && dest == l(tok)-2)) {
7  
      t.add(cncAddFirstAndLast(subList(tok, i, dest+1)));
8  
      i = dest;
9  
    } else
10  
      t.add(tok.get(i));
11  
  }
12  
  ret t;
13  
}

Author comment

Began life as a copy of #1008803

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: #1008808
Snippet name: xtok_joinBrackets3
Eternal ID of this version: #1008808/1
Text MD5: 216d4c56fe5b58278b409e38bec8ca14
Author: stefan
Category: javax / parsing
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-06-09 02:41:44
Source code size: 347 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 442 / 508
Referenced in: [show references]