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

10
LINES

< > BotCompany Repo | #1022730 // tok_debugStatements

JavaX fragment (include)

// debug "bla" + blubb; => { if (debug) print("bla" + blubb); }
svoid tok_debugStatements(LS tok) {
  int i = -1;
  while ((i = jfind(tok, i+1, "debug <quoted>")) >= 0) {
    int j = tok_findEndOfStatement(tok, i); // index of semicolon+1
    replaceTokens(tok, i, i+2, "{ if (debug) print(");
    tok.set(j-1, "); }");
    i = j;
  }
}

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1022730
Snippet name: tok_debugStatements
Eternal ID of this version: #1022730/3
Text MD5: bb7304c965986b4026a547efbd1362d1
Author: stefan
Category: javax / transpiling
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-04-03 16:00:00
Source code size: 347 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 185 / 226
Version history: 2 change(s)
Referenced in: [show references]