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

14
LINES

< > BotCompany Repo | #1030991 // tok_parseForStatement

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (3132L/19K).

scope tok_parseForStatement.

srecord #For(S condition, S body) {}

static For tok_parseForStatement(TokScanner ts) {
  if (!(eq(ts.get(), "for") && eq(ts.get(1), "("))) null;
  ts.consume();
  S cond = deRoundBracket(ts.consumeBracketPart());
  int idx = ts.idx;
  ts.skipTo(tok_findEndOfStatement(ts.tok, ts.idx));
  ret new For(cond, joinSubList(ts.tok, idx-1, ts.idx+1));
}

end scope

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1030991
Snippet name: tok_parseForStatement
Eternal ID of this version: #1030991/7
Text MD5: aab197c013fa571473a4a87b75ba6af6
Transpilation MD5: 39150485bc3c072c485c5e95950f638f
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-04-18 18:18:08
Source code size: 401 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 99 / 175
Version history: 6 change(s)
Referenced in: [show references]