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 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; }