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)

static boolean match_brackets(S pat, S s) {
  return match_brackets(pat, s, null);
}

static boolean match_brackets(S pat, S s, Matches matches) {
  if (pat == null || s == null) false;
  ret match3(pat, parse3_brackets(s), matches);
}
  
static boolean match_brackets(S pat, L<S> toks, Matches matches) {
  L<S> tokpat = parse3_brackets(pat);
  ret match3(tokpat,toks,matches);
}

static boolean match_brackets(L<S> tokpat, L<S> toks, Matches matches) {
  S[] m = match2(tokpat, toks);
  //print(structure(tokpat) + " on " + structure(toks) + " => " + structure(m));
  if (m == null) false;
  if (matches != null) matches.m = m; true;
}

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: 401 / 441
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)