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

11
LINES

< > BotCompany Repo | #1028473 // indexOfAnonymousClassInStruct

JavaX fragment (include)

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

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: 128 / 164
Version history: 2 change(s)
Referenced in: [show references]