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

13
LINES

< > BotCompany Repo | #1008964 - tok_tokenBeforeLonelyReturnValue

JavaX fragment (include)

static bool tok_tokenBeforeLonelyReturnValue(LS tok, int i) {
  S t = get(tok, i);
  if (l(t) == 1 && "{};".contains(t) || eq(t, "else")) true;
  if (!eq(t, ")")) false;
  int level = 0;
  while (i > 0) {
    if (eq(tok.get(i), ")")) ++level;
    if (eq(tok.get(i), "(")) --level;
    if (level == 0) ret eq(get(tok, i-2), "if");
    i -= 2;
  }
  false;
}

download  show line numbers  debug dex   

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

No comments. add comment

Snippet ID: #1008964
Snippet name: tok_tokenBeforeLonelyReturnValue
Eternal ID of this version: #1008964/4
Text MD5: 15643c7809a2cc3325ef3720dab622c1
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-10-06 04:10:11
Source code size: 368 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 286 / 310
Version history: 3 change(s)
Referenced in: [show references]

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