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

11
LINES

< > BotCompany Repo | #1026114 // rewriteWithDollarVars - uses emit(S)

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (4995L/33K).

1  
svoid rewriteWithDollarVars(S input, S inputPattern, S... outPatterns) {
2  
  SS map = flexMatchDollarVarsIC_first(inputPattern, input);
3  
  if (map == null) ret;
4  
  
5  
  // group it
6  
  emitUnlessEqualTo(input, replaceVars_optRound(inputPattern, map));
7  
  
8  
  // rewrite it
9  
  for (S pat : outPatterns)
10  
    emit(replaceVars_optRound(pat, map));
11  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1026114
Snippet name: rewriteWithDollarVars - uses emit(S)
Eternal ID of this version: #1026114/2
Text MD5: ccba02002d1b559c0dc520686b8d7ace
Transpilation MD5: 0eb0f2d9e9dbb61c425c1f8e5ebba2e7
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-02-22 16:24:11
Source code size: 344 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 236 / 323
Version history: 1 change(s)
Referenced in: [show references]