1 | static L<S> joinBrackets(L<S> tok) { |
2 | new L<S> 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) { |
7 | t.add(join(subList(tok, i, dest+1))); |
8 | i = dest; |
9 | } else |
10 | t.add(tok.get(i)); |
11 | } |
12 | ret t; |
13 | } |
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: | 554 / 568 |
Version history: | 2 change(s) |
Referenced in: | [show references] |