Skip to content

Commit

Permalink
Clean up LabelInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
Baltoli committed Oct 24, 2023
1 parent 4afe42f commit 17fb4e5
Showing 1 changed file with 4 additions and 22 deletions.
26 changes: 4 additions & 22 deletions kore/src/main/java/org/kframework/compile/LabelInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,9 @@ public boolean isFunction(K term) {
if (term instanceof KApply && isFunction(((KApply) term).klabel())) {
return true;
}
if (term instanceof KRewrite && ((KRewrite) term).left() instanceof KApply
&& isFunction(((KApply) ((KRewrite) term).left()).klabel())) {
return true;
}
return false;

return term instanceof KRewrite && ((KRewrite) term).left() instanceof KApply
&& isFunction(((KApply) ((KRewrite) term).left()).klabel());
}

/**
Expand All @@ -92,23 +90,7 @@ public AssocInfo getAssocInfo(KLabel l) {
return assocInfo.get(l);
}

public static class AssocInfo {
public AssocInfo(boolean isAssoc, boolean isComm) {
this.isAssoc = isAssoc;
this.isComm = isComm;
}

private final boolean isAssoc;
private final boolean isComm;

public boolean isAssoc() {
return isAssoc;
}

public boolean isComm() {
return isComm;
}
}
public record AssocInfo(boolean isAssoc, boolean isComm) {}

public Production getProduction(String label) {
return productions.get(label);
Expand Down

0 comments on commit 17fb4e5

Please sign in to comment.