1 | static L<S> tok_groupRoundBrackets(S s) { |
2 | ret tok_groupRoundBrackets(javaTok(s)); |
3 | } |
4 | |
5 | static L<S> tok_groupRoundBrackets(L<S> tok) { |
6 | while true { |
7 | int i = tok.lastIndexOf("("); |
8 | if (i < 0) ret tok; |
9 | int j = indexOf(tok, ")", i); |
10 | if (j < 0) ret tok; |
11 | tok.set(i, join(subList(tok, i, j+1))); |
12 | tok.subList(i+1, j+1).clear(); |
13 | assertTrue(odd(l(tok))); |
14 | } |
15 | } |
Began life as a copy of #1007458
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1007459 |
Snippet name: | tok_groupRoundBrackets (keeps the brackets too) |
Eternal ID of this version: | #1007459/3 |
Text MD5: | e012326b2d4e6d523287eb63f1c66409 |
Author: | stefan |
Category: | javax / parsing |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-07-11 14:43:28 |
Source code size: | 394 bytes / 15 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 450 / 489 |
Version history: | 2 change(s) |
Referenced in: | [show references] |