svoid gazelle_saveExampleFromCommentAsAppliedRule(S ruleID) { for (S example : gazelle_goodExamplesFromComments(ruleID)) { PairS xmp = splitAtDoubleArrow_pair(example); if (xmp == null) continue; GazelleEvalContext ctx = dm_gazelle_stdEvalContext(ll(t3(dm_textForRule(ruleID), dm_commentOfRule(ruleID), ruleID))); L l = ai_ruleEngine2_rulesForInput_5(ctx.engine, litmap(standard := xmp.a)); print("Matched: " + sfu(l)); if (empty(l)) continue; RuleEngine2_MatchedRule mr = first(l); LS tokC = mr.outTokenize(mr.rule.out); LS tokI = mr.outTokenize(xmp.b); printStruct(tokI); SS map = zipTwoListsToCIMap_strict_withoutEquals(tokC, tokI); if (!gazelle_addMatch(mr, map, tokC, tokI)) continue; print("Got map: " + mr.map); dm_gazelle_saveAppliedRule( judgement := 'good, matchedRuleStruct := struct(mr), context := "comment on " + ruleID); } }