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

15
LINES

< > BotCompany Repo | #1014558 // replaceCodeTokensUsingMap

JavaX fragment (include)

1  
static S replaceCodeTokensUsingMap(S s, SS map) {
2  
  ret join(replaceCodeTokensUsingMap(javaTok(s), map));
3  
}
4  
5  
static LS replaceCodeTokensUsingMap(L<S> tok, SS map) {
6  
  LS out = emptyList(tok);
7  
  for i over tok: {
8  
    out.add(odd(i) ? lookupOrKeep(map, tok.get(i)) : tok.get(i));
9  
  }
10  
  ret out;
11  
}
12  
13  
sS replaceCodeTokensUsingMap(SS map, S s) {
14  
  ret replaceCodeTokensUsingMap(s, map);
15  
}

Author comment

Began life as a copy of #1014541

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: #1014558
Snippet name: replaceCodeTokensUsingMap
Eternal ID of this version: #1014558/7
Text MD5: 86567ae75f104c19b8e954e98e1efa93
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-11-04 20:27:29
Source code size: 396 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 506 / 558
Version history: 6 change(s)
Referenced in: [show references]