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

11
LINES

< > BotCompany Repo | #1009545 - tok_hasClassRef2 - leaves out ifclass blocks

JavaX fragment (include)

static bool tok_hasClassRef2(L<S> tok, S className) {
  int n = l(tok);
  int level = 0;
  for (int i = 1; i < n; i += 2) {
    S t = tok.get(i);
    if (eqOneOf(t, "ifclass", "ifndef")) ++level;
    else if (eqOneOf(t, "endif", "endifndef")) --level;
    else if (level <= 0 && eq(t, className)) true;
  }
  false;
}

Author comment

Began life as a copy of #1007936

download  show line numbers  debug dex   

Travelled to 9 computer(s): aoiabmzegqzx, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, tslmcundralx, tvejysmllsmz

No comments. add comment

Snippet ID: #1009545
Snippet name: tok_hasClassRef2 - leaves out ifclass blocks
Eternal ID of this version: #1009545/1
Text MD5: fa16af32503c9a171bba5a0bef28417b
Author: stefan
Category: javax / parsing
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-08-07 17:42:41
Source code size: 327 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 224 / 237
Referenced in: [show references]

Formerly at http://tinybrain.de/1009545 & http://1009545.tinybrain.de