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

28
LINES

< > BotCompany Repo | #1011087 // doubleFor (complicated version, abandoned)

JavaX fragment (include)

/* complicated version - TODO */
// for (S key, S value : map)
/*static void doubleFor(L<S> tok) {
  int i;
  while ((i = jfind(tok, "for (<id> <id>, <id> <id> :")) >= 0) {
    int iComma = indexOf(tok, ",", i);
    S valType = tok.get(iComma+2);
    S valName = tok.get(iComma+4);
    int expStart = indexOf(tok, ":", i)+2;
    int expEnd = findEndOfBracketPart(expStart-2);
    assertEquals(")", tok.get(expEnd));
    assertEquals("{", tok.get(expEnd+2));
    replaceTokens(tok, iComma, expStart, ": keys(");
    tok.set(expEnd, "))");
    tok.set(expEnd+2, "{ " + valType + " " + valName + " = " + 
    S type = tok.get(i+2), id = tok.get(i+4);
      int j = scanOverExpression(tok, bracketMap, i+8, "|");
      S exp = join(tok.subList(i+8, j));
      j += 2;
      int k = scanOverExpression(tok, bracketMap, j, "]");
      S where = join(tok.subList(j, k));
      ++k;
      
      S code = "filter(" + exp + ", func(" + type + " " + id + ") { " + where + " })";
      replaceTokens(tok, i, k, code);
      reTok(tok, i, k);
    }
}*/

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: #1011087
Snippet name: doubleFor (complicated version, abandoned)
Eternal ID of this version: #1011087/1
Text MD5: 1a5ff43910f34a39f8e23916c4dfdb7e
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-10-12 02:57:39
Source code size: 1067 bytes / 28 lines
Pitched / IR pitched: No / No
Views / Downloads: 413 / 452
Referenced in: [show references]