1 | // i must point at the (possibly imaginary) opening bracket (any of the 2 types, not type parameters) |
2 | // index returned is index of closing bracket + 1 |
3 | static int findEndOfBracketPart(List<String> cnc, int i) { |
4 | int j = i+2, level = 1; |
5 | while (j < cnc.size()) { |
6 | if (eqOneOf(cnc.get(j), "{", "(")) ++level; |
7 | else if (eqOneOf(cnc.get(j), "}", ")")) --level; |
8 | if (level == 0) |
9 | return j+1; |
10 | ++j; |
11 | } |
12 | return cnc.size(); |
13 | } |
Began life as a copy of #1001160
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mowyntqkapby, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1001165 |
Snippet name: | findEndOfBracketPart |
Eternal ID of this version: | #1001165/3 |
Text MD5: | bfe2a152fbf0014e89e667dd5bffd899 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2017-10-29 03:00:37 |
Source code size: | 450 bytes / 13 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 888 / 2672 |
Version history: | 2 change(s) |
Referenced in: | [show references] |