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  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

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: 541 / 596
Version history: 3 change(s)
Referenced in: [show references]