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

14
LINES

< > BotCompany Repo | #1005437 // genericPatternize

JavaX fragment (include)

1  
static Patternized genericPatternize(O pred, S s) {
2  
  L<S> tok = codeTokens(javaTok(s));
3  
  new L<S> pat;
4  
  new L<S> args;
5  
  for (S t : tok)
6  
    if (callPred(pred, t)) {
7  
      pat.add("*");
8  
      args.add(t);
9  
    } else if (eq(t, "*"))
10  
      pat.add("\\*");
11  
    else
12  
      pat.add(t);
13  
  ret new Patternized(join(" ", pat), args);
14  
}

Author comment

Began life as a copy of #1005435

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1005437
Snippet name: genericPatternize
Eternal ID of this version: #1005437/1
Text MD5: 7eb3f1e1f25172c0410177f59a8425bc
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-11-16 20:38:04
Source code size: 343 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 491 / 510
Referenced in: [show references]