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

15
LINES

< > BotCompany Repo | #1023510 // replaceCodeTokensUsingMap_curly - enclose multi-token values in curly brackets

JavaX fragment (include)

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

Author comment

Began life as a copy of #1014558

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1023510
Snippet name: replaceCodeTokensUsingMap_curly - enclose multi-token values in curly brackets
Eternal ID of this version: #1023510/1
Text MD5: d05e547564f29494a2fff6e157ae2ae9
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-06-26 16:44:53
Source code size: 429 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 284 / 324
Referenced in: [show references]