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

11
LINES

< > BotCompany Repo | #1028473 // indexOfAnonymousClassInStruct

JavaX fragment (include)

1  
static int indexOfAnonymousClassInStruct(S s) {
2  
  Pattern p = compileRegexp("\\$\\d");
3  
  Producer<S> it = javaTokC_noMLS_iterator(s);
4  
  S t;
5  
  int idx = 0;
6  
  while ((t = it.next()) != null) {
7  
    if (isIdentifier(t) && regexpContains(p, t)) ret idx;
8  
    idx += l(t);
9  
  }
10  
  ret -1;
11  
}

Author comment

Began life as a copy of #1021816

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1028473
Snippet name: indexOfAnonymousClassInStruct
Eternal ID of this version: #1028473/3
Text MD5: 33c56081f76f7544991f11026769cd4c
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-06-21 00:18:53
Source code size: 292 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 130 / 166
Version history: 2 change(s)
Referenced in: [show references]