static S replaceCodeTokensUsingMap(S s, SS map) { ret join(replaceCodeTokensUsingMap(javaTok(s), map)); } static LS replaceCodeTokensUsingMap(L<S> tok, SS map) { LS out = emptyList(tok); for i over tok: { out.add(odd(i) ? lookupOrKeep(map, tok.get(i)) : tok.get(i)); } ret out; } sS replaceCodeTokensUsingMap(SS map, S s) { ret replaceCodeTokensUsingMap(s, map); }
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: | 505 / 557 |
Version history: | 6 change(s) |
Referenced in: | #1006654 - Standard functions list 2 (LIVE, continuation of #761) #1023231 - replaceOrDropCodeTokensUsingMap - drops token on empty value [dev.] #1023510 - replaceCodeTokensUsingMap_curly - enclose multi-token values in curly brackets #1025974 - replaceVars_optRound |