1 | // i must point at the (possibly imaginary) opening bracket |
2 | // index returned is index of closing bracket + 1 |
3 | static int findEndOfCurlyBracketPart(List<String> cnc, int i) {
|
4 | int j = i+2, level = 1; |
5 | while (j < cnc.size()) {
|
6 | if (eq(cnc.get(j), "{")) ++level;
|
7 | else if (eq(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 #1001165
download show line numbers debug dex old transpilations
Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lnbujpyubztb, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt, whxojlpjdney
No comments. add comment
| Snippet ID: | #1011438 |
| Snippet name: | findEndOfCurlyBracketPart |
| Eternal ID of this version: | #1011438/1 |
| Text MD5: | d86bb747a3ad89cae95512d7e939d076 |
| 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:55 |
| Source code size: | 395 bytes / 13 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 739 / 1106 |
| Referenced in: | [show references] |