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   

Travelled to 9 computer(s): aoiabmzegqzx, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, tslmcundralx, tvejysmllsmz

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

Formerly at http://tinybrain.de/1014558 & http://1014558.tinybrain.de