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

14
LINES

< > BotCompany Repo | #1015999 // tokenIndexWithoutIfclass_forStdClasses

JavaX fragment (include)

1  
static Set<S> tokenIndexWithoutIfclass_forStdClasses(L<S> tok) {
2  
  new HashSet<S> set;
3  
  int n = l(tok);
4  
  int level = 0;
5  
  for (int i = 1; i < n; i += 2) {
6  
    S t = tok.get(i);
7  
    if (eqOneOf_twoNonNullStrings(t, "ifclass", "ifndef")) ++level;
8  
    else if (eqOneOf_twoNonNullStrings(t, "endif", "endifndef")) --level;
9  
    else if (level <= 0 && startsWithJavaIdentifierStart(t)
10  
      && !eqOneOf_twoNonNullStrings(get(tok, i-2), ".", "virtual"))
11  
        set.add(t);
12  
  }
13  
  ret set;
14  
}

Author comment

Began life as a copy of #1007325

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: #1015999
Snippet name: tokenIndexWithoutIfclass_forStdClasses
Eternal ID of this version: #1015999/4
Text MD5: c44fc631bf0d27a4fbe99632615af705
Author: stefan
Category: javax / parsing
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-03-04 00:40:57
Source code size: 498 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 456 / 485
Version history: 3 change(s)
Referenced in: [show references]