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

20
LINES

< > BotCompany Repo | #1001104 - match3 function

JavaX fragment (include)

1  
static boolean match3(S pat, S s) {
2  
  return match3(pat, s, null);
3  
}
4  
5  
static boolean match3(S pat, S s, Matches matches) {
6  
  if (pat == null || s == null) return false;
7  
  ret match3(pat, parse3_cachedInput(s), matches);
8  
}
9  
  
10  
static boolean match3(S pat, L<S> toks, Matches matches) {
11  
  L<S> tokpat = parse3_cachedPattern(pat);
12  
  ret match3(tokpat, toks, matches);
13  
}
14  
15  
static boolean match3(L<S> tokpat, L<S> toks, Matches matches) {
16  
  S[] m = match2(tokpat, toks);
17  
  //print(structure(tokpat) + " on " + structure(toks) + " => " + structure(m));
18  
  if (m == null) false;
19  
  if (matches != null) matches.m = m; true;
20  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 22 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, ekrmjmnbrukm, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, jtubtzbbkimh, lpdgvwnxivlt, mqqgnosmbjvj, mqsvbyillbrs, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, sawdedvomwva, tslmcundralx, tvejysmllsmz, vouqrxazstgt, whxojlpjdney, xrpafgyirdlv

No comments. add comment

Snippet ID: #1001104
Snippet name: match3 function
Eternal ID of this version: #1001104/5
Text MD5: f2c0818bd4f3b345276012df89ec1ede
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-08-11 13:35:26
Source code size: 633 bytes / 20 lines
Pitched / IR pitched: No / No
Views / Downloads: 694 / 7208
Version history: 4 change(s)
Referenced in: [show references]

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