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

15
LINES

< > BotCompany Repo | #1003865 // findTranslators2 - the good one using tokens

JavaX fragment (include)

1  
// probably better than findTranslators (uses tokens)
2  
// removes invocations from src
3  
static S findTranslators2(S src, L<S> libsOut) {
4  
  ret join(findTranslators2(javaTok(src), libsOut));
5  
}
6  
7  
// modifies original tok
8  
static L<S> findTranslators2(L<S> tok, L<S> libsOut) {
9  
  int i;
10  
  while ((i = jfind(tok, "!<int>")) >= 0) {
11  
    setAdd(libsOut, tok.get(i+2));
12  
    clearTokens(tok, i, i+3);
13  
  }
14  
  ret tok;
15  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1003865
Snippet name: findTranslators2 - the good one using tokens
Eternal ID of this version: #1003865/4
Text MD5: 8906657b57960d0ed3c7410327bf666b
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-08-04 13:26:52
Source code size: 419 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 661 / 671
Version history: 3 change(s)
Referenced in: [show references]