sS tok_expandIfQuoted(S s) { ret applyTranspilationFunction tok_expandIfQuoted(s); } svoid tok_expandIfQuoted(LS tok) { jreplace(tok, "if || ", "if (matchOneOf(s, m, $2, $5))"); // "bla * bla | blubb * blubb" jreplace_dyn(tok, "if ", func(L tok, int cIdx) -> S { S s = unquote(tok.get(cIdx+2)); //print("multimatch: " + quote(s)); new L l; for (S pat : splitAtJavaToken(s, "|")) { //print("multimatch part: " + quote(pat)); if (pat.contains("...")) l.add("matchX(" + quote(trim(pat)) + ", s, m)"); else if (javaTok(pat).contains("*")) l.add("match(" + quote(trim(pat)) + ", s, m)"); else l.add("match(" + quote(trim(pat)) + ", s)"); } ret "if (" + join(" || ", l) + ")"; }, tokcondition { ret javaTokC(unquote(tok.get(i+3))).contains("|"); }); tok_transpileIfQuoted_dollarVars(tok); // "...bla..." jreplace(tok, "if ", "if (find3plusRestsX($2, s, m))", tokcondition { ret startsAndEndsWith(unquote(tok.get(i+3)), "..."); }); // "bla..." jreplace(tok, "if ", "if (matchStartX($2, s, m))", tokcondition { ret unquote(tok.get(i+3)).endsWith("..."); }); // "bla" jreplace(tok, "if ", "if (match($2, s))", tokcondition { ret !javaTokC(unquote(tok.get(i+3))).contains("*"); }); // "bla * bla" jreplace(tok, "if ", "if (match($2, s, m))"); jreplace(tok, "if match ", "if (match($3, s, m))"); }