scope gazelle_addVarSplittersToRules. sclass #VarSplitter { S var; bool debug; *() {} *(S *var, bool *debug) {} SS get(SS map, LS tokC, LS tokI, RuleEngine2_MatchedRule matched) { if (map == null) null; S value = getOrKeep(map, curly(var)); LS tok1 = matched.tokenize(var); LS tok2 = matched.tokenize(uncurly(value)); if (debug) print("VarSplitter: " + tok1 + " / " + tok2); if (l(tok1) != l(tok2)) null; int oldSize = l(map); for (int i = 1; i < l(tok1); i += 2) if (!strictPutIC(map, tok1.get(i), tok2.get(i))) null; if (debug) print("VarSplitter done => " + map); matched.nPossibleVars = matched.nPossibleVars() + l(map)-oldSize; ret map; } } svoid gazelle_addVarSplittersToRules(RuleEngine2 engine, O... _) { new Matches m; bool debug = boolPar debug(_); for (final RuleEngine2.Rule r : engine.rules) { continue unless jmatchAny("split *", r.comments, m) && isQuoted(m.get(0)); S var = $1; if (debug) print("Made splitter for: " + var); r.addMapMassager(new VarSplitter(var, debug)); } } end scope