Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

13
LINES

< > BotCompany Repo | #1012540 // findEndOfAngleBracketPart

JavaX fragment (include)

1  
// i must point at the (possibly imaginary) opening bracket
2  
// index returned is index of closing bracket + 1
3  
static int findEndOfAngleBracketPart(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  
}

Author comment

Began life as a copy of #1011438

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: #1012540
Snippet name: findEndOfAngleBracketPart
Eternal ID of this version: #1012540/1
Text MD5: 1ab752af8273cbcd877cb467cd5e8f2b
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-12-06 22:57:26
Source code size: 395 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 548 / 590
Referenced in: [show references]