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

18
LINES

< > BotCompany Repo | #1008918 // ctxProcessAction - split action body into statements and execute them

JavaX fragment (include)

static void ctxProcessAction(S body) {
  ctxProcessAction(javaTok(body));
}

static void ctxProcessAction(L<S> tok) {
  while (ctxProcessIf(tok)) {}
  if (l(tok) <= 1) ret;
  
  // find end of statement
  int j = indexOf(tok, ";");
  j = j < 0 ? l(tok)-1 : j+1;
  
  L<S> rest = newSubList(tok, j);
  tok = newSubList(tok, 0, j+1);
  
  ctxProcessStatement(tok);
  ctxProcessAction(rest);
}

Author comment

Began life as a copy of #1008896

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: #1008918
Snippet name: ctxProcessAction - split action body into statements and execute them
Eternal ID of this version: #1008918/22
Text MD5: d152fdd224efd2f5c03af40b1f212a64
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-02-07 16:54:09
Source code size: 407 bytes / 18 lines
Pitched / IR pitched: No / No
Views / Downloads: 499 / 542
Version history: 21 change(s)
Referenced in: [show references]