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

20
LINES

< > BotCompany Repo | #1016378 // match_brackets - match3 + combining round/curly brackets

JavaX fragment (include)

1  
static boolean match_brackets(S pat, S s) {
2  
  return match_brackets(pat, s, null);
3  
}
4  
5  
static boolean match_brackets(S pat, S s, Matches matches) {
6  
  if (pat == null || s == null) false;
7  
  ret match3(pat, parse3_brackets(s), matches);
8  
}
9  
  
10  
static boolean match_brackets(S pat, L<S> toks, Matches matches) {
11  
  L<S> tokpat = parse3_brackets(pat);
12  
  ret match3(tokpat,toks,matches);
13  
}
14  
15  
static boolean match_brackets(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  
}

Author comment

Began life as a copy of #1001104

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1016378
Snippet name: match_brackets - match3 + combining round/curly brackets
Eternal ID of this version: #1016378/1
Text MD5: 349caaacc448496835b21fdb789c4bdb
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-06-16 17:01:44
Source code size: 656 bytes / 20 lines
Pitched / IR pitched: No / No
Views / Downloads: 336 / 376
Referenced in: [show references]