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: | 553 / 566 |
Version history: | 2 change(s) |
Referenced in: | [show references] |