sbool flexMatchIC_iterate_debug; sbool flexMatchIC_iterate_useTokenization; svoid flexMatchIC_iterate(S pat, S input, VF1 onMatch) { if (flexMatchIC_iterate_debug) print("flexMatchIC_iterate " + pat + " / " + input); flexMatchIC_iterate(pat, javaTokNPunctuation_plusAsterisk(pat), javaTokNPunctuation_plusAsterisk(input), onMatch); } svoid flexMatchIC_iterate(S pat, LS tokPat, LS tokInput, VF1 onMatch) { L varIndices = flexMatchIC_getVarIndices(tokPat, tokInput); if (varIndices == null) ret; if (flexMatchIC_iterate_debug) printStructs(+varIndices, +tokPat, +tokInput); LL spreadInputs = ai_spreadCertainIndices_2(tokPat, tokInput, varIndices); for (L tok : spreadInputs) { if (flexMatchIC_iterate_debug) print("Testing spread " + sfu(codeTokens(tokPat)) + " with input: " + sfu(codeTokens(tok))); new Matches m; if (flexMatchIC_iterate_useTokenization ? match3(tokPat, tokInput, m) : match(pat, tok, m)) { if (flexMatchIC_iterate_debug) print("Got match: " + m); callF(onMatch, m); } } }