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

15
LINES

< > BotCompany Repo | #1014558 // replaceCodeTokensUsingMap

JavaX fragment (include)

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);
}

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: 504 / 556
Version history: 6 change(s)
Referenced in: [show references]