Libraryless. Click here for Pure Java version (2189L/14K).
static bool matchStart(S pat, S s) { ret matchStart(pat, s, null); } // matches are as you expect, plus an extra item for the rest string static bool matchStart(S pat, S s, Matches matches) { if (s == null) false; ret matchStart(pat, parse3_cachedInput(s), matches); } static bool matchStart(S pat, LS toks, Matches matches) { if (toks == null) false; L<S> tokpat = parse3_cachedPattern(pat); if (toks.size() < tokpat.size()) ret false; S[] m = match2(tokpat, toks.subList(0, tokpat.size())); //print(structure(tokpat) + " on " + structure(toks) + " => " + structure(m)); if (m == null) false; if (matches != null) { matches.m = new S[m.length+1]; arraycopy(m, matches.m); matches.m[m.length] = joinSubList(toks, tokpat.size(), toks.size()); // for Matches.rest() } true; }
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, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment