sbool ai_patternSwitch_debug; static S ai_patternSwitch(S to, S s) { ret ai_patternSwitch(ai_getOperator(s), to, s); } static S ai_patternSwitch(S from, S to, S s) { ret ai_patternSwitch(javaTokC(from), to, s); } static S ai_patternSwitch(L from, S to, S s) { L tok = javaTokPlusBracketsC_unquote(s); L tok1 = from, tok2 = javaTokC(to); /*S op = ai_getOperator(s); if (neq(from, op)) fail("Different operator: " + renderStructs(+from, +to, +op, +s));*/ L operands = ai_operands(from, s); int iOperand = 0; new L out; for (S t : tok2) { if (eq(t, "*")) out.add(operands.get(iOperand++)); else out.add(t); } if (ai_patternSwitch_debug) printStruct(+out); ret joinWithSpace(out); }