Skip to content

Commit

Permalink
Clean up ResolveHeatCoolAttribute
Browse files Browse the repository at this point in the history
  • Loading branch information
Baltoli committed Oct 24, 2023
1 parent 143996f commit 08fbf2b
Showing 1 changed file with 5 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
package org.kframework.compile;

import org.kframework.attributes.Att;
import org.kframework.attributes.Att.Key;
import org.kframework.builtin.BooleanUtils;
import org.kframework.definition.Context;
import org.kframework.definition.Module;
Expand All @@ -20,13 +19,7 @@
import static org.kframework.definition.Constructors.*;
import static org.kframework.kore.KORE.*;

public class ResolveHeatCoolAttribute {

private final Set<String> unrestrictedRules;

public ResolveHeatCoolAttribute(Set<String> unrestrictedRules) {
this.unrestrictedRules = unrestrictedRules;
}
public record ResolveHeatCoolAttribute(Set<String> unrestrictedRules) {

private Rule resolve(Module m, Rule rule) {
return Rule(
Expand Down Expand Up @@ -70,10 +63,10 @@ public Sentence resolve(Module m, Sentence s) {
if (!s.att().contains(Att.HEAT()) && !s.att().contains(Att.COOL())) {
return s;
}
if (s instanceof Rule) {
return resolve(m, (Rule) s);
} else if (s instanceof Context) {
return resolve(m, (Context) s);
if (s instanceof Rule r) {
return resolve(m, r);
} else if (s instanceof Context c) {
return resolve(m, c);
} else {
return s;
}
Expand Down

0 comments on commit 08fbf2b

Please sign in to comment.