Warning: session_start(): open(/var/lib/php/sessions/sess_ofn84kv0fhdhr9hmbjkcreu75u, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
svoid gazelle_addHelperTablesToRules(RuleEngine2 engine) {
new Matches m;
for (RuleEngine2.Rule r : engine.rules) {
continue unless matchAny("use helper table mech list *", r.comments, m);
LS entries = mL($1);
continue if empty(entries);
final LL helperTable = map tok_splitAtComma(entries);
final Map> helperIndex = indexTwoDArrayIC(helperTable);
rule.massageMap = func(SS map, LS tokC, LS tokI, RuleEngine2_MatchedRule matched) -> SS {
print("Massaging: " + map + " " + sfu(tokC) + " / " + sfu(tokI));
for (S t : codeTokens(matched.tokenize(rule.out))) {
//print("Checking: " + t);
if (map.containsKey(t)) continue;
Pair idx = helperIndex.get(t);
if (idx == null) continue;
//print("Found: " + t);
for (S key, val : cloneMap(map)) {
int idx2 = indexOfIC(helperTable.get(idx.a), key);
if (idx2 < 0) continue;
Pair idxVal = helperIndex.get(val);
S out = _get(_get(helperTable, idxVal.a), idx.b);
print("Massaged: " + t + " <-> " + key + " => " + out);
mapPut(map, t, out);
}
}
ret map;
};
}
}