X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=bundles%2Forg.simantics.scl.compiler%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fcompiler%2Felaboration%2Fchr%2FCHRRuleset.java;h=aa59d4c0239159b604d396be91710fb66d69cfda;hb=91682baa9a8252390f09b80fd724f47e5957b234;hp=2a405952219e15b92866fd073020eed2e91f93c1;hpb=6dfe20b0f514b91337fcac4de0267ffd8268be07;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/chr/CHRRuleset.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/chr/CHRRuleset.java index 2a4059522..aa59d4c02 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/chr/CHRRuleset.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/chr/CHRRuleset.java @@ -42,7 +42,6 @@ import org.simantics.scl.compiler.types.Types; import gnu.trove.map.hash.THashMap; import gnu.trove.map.hash.TObjectIntHashMap; -import gnu.trove.set.hash.THashSet; import gnu.trove.set.hash.TIntHashSet; public class CHRRuleset extends Symbol { @@ -258,7 +257,7 @@ public class CHRRuleset extends Symbol { PlanRealizer realizer = new PlanRealizer(cachedContext, this, runtimeRulesetVariable, implementationParameters[0], plan.ops); realizer.nextOp(methodWriter); if(methodWriter.isUnfinished()) - methodWriter.return_(BooleanConstant.TRUE); + methodWriter.return_(rule.location, BooleanConstant.TRUE); } } if(!includes.isEmpty() || extensible) { @@ -274,7 +273,7 @@ public class CHRRuleset extends Symbol { methodWriter.apply(Locations.NO_LOCATION, new JavaMethod(true, runtimeRulesetClassName, "register", Types.PROC, Types.UNIT, new Type[] {runtimeRulesetType, Types.CHRContext}), object.getTarget(), methodWriter.getParameters()[0]); - methodWriter.return_(NoRepConstant.UNIT); + methodWriter.return_(location, NoRepConstant.UNIT); } { CodeWriter methodWriter = object.createMethod(w.getModuleWriter(), TVar.EMPTY_ARRAY, Types.PROC, Types.UNIT, new Type[] {Types.CHRContext}); @@ -288,7 +287,7 @@ public class CHRRuleset extends Symbol { methodWriter.apply(Locations.NO_LOCATION, new JavaMethod(true, runtimeRulesetClassName, "unregister", Types.PROC, Types.UNIT, new Type[] {runtimeRulesetType, Types.CHRContext}), object.getTarget(), methodWriter.getParameters()[0]); - methodWriter.return_(NoRepConstant.UNIT); + methodWriter.return_(location, NoRepConstant.UNIT); } } if(initConstraint != null) { @@ -310,15 +309,6 @@ public class CHRRuleset extends Symbol { return runtimeRulesetVariable; } - public void collectEffects(THashSet effects) { - for(CHRRule rule : rules) { - for(CHRLiteral literal : rule.head.literals) - literal.collectQueryEffects(effects); - for(CHRLiteral literal : rule.head.literals) - literal.collectEnforceEffects(effects); - } - } - public void addRule(CHRRule rule) { rules.add(rule); rule.parentRuleset = this;