Skip to content

Commit

Permalink
fixed subtle bug in applying syntax role
Browse files Browse the repository at this point in the history
  • Loading branch information
jurgenvinju committed Nov 22, 2023
1 parent 123a3f5 commit a1d5b0b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/org/rascalmpl/types/ModifySyntaxRole.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,6 @@ public Type apply() {
else if (arg instanceof ModifySyntaxRole) {
return applyToRole((ModifySyntaxRole) arg);

Check warning on line 73 in src/org/rascalmpl/types/ModifySyntaxRole.java

View check run for this annotation

Codecov / codecov/patch

src/org/rascalmpl/types/ModifySyntaxRole.java#L73

Added line #L73 was not covered by tests
}
else if (arg.isAbstractData()) {
return applyToData(arg);
}
else if (arg instanceof NonTerminalType) {
IConstructor symbol = ((NonTerminalType) arg).getSymbol();

Check warning on line 76 in src/org/rascalmpl/types/ModifySyntaxRole.java

View check run for this annotation

Codecov / codecov/patch

src/org/rascalmpl/types/ModifySyntaxRole.java#L76

Added line #L76 was not covered by tests

Expand All @@ -91,6 +88,9 @@ else if (isKeyword(symbol)) {
return applyToKeyword((NonTerminalType) arg);

Check warning on line 88 in src/org/rascalmpl/types/ModifySyntaxRole.java

View check run for this annotation

Codecov / codecov/patch

src/org/rascalmpl/types/ModifySyntaxRole.java#L88

Added line #L88 was not covered by tests
}
}

Check warning on line 90 in src/org/rascalmpl/types/ModifySyntaxRole.java

View check run for this annotation

Codecov / codecov/patch

src/org/rascalmpl/types/ModifySyntaxRole.java#L90

Added line #L90 was not covered by tests
else if (arg.isAbstractData()) {
return applyToData(arg);

Check warning on line 92 in src/org/rascalmpl/types/ModifySyntaxRole.java

View check run for this annotation

Codecov / codecov/patch

src/org/rascalmpl/types/ModifySyntaxRole.java#L92

Added line #L92 was not covered by tests
}

// this should not happen, but for robustness sake we return the unmodified type.
assert false : "can not modify " + arg + " to " + this;
Expand Down Expand Up @@ -860,7 +860,7 @@ protected Type glbWithAbstractData(Type type) {
public boolean isOpen() {
return arg.isOpen();

Check warning on line 861 in src/org/rascalmpl/types/ModifySyntaxRole.java

View check run for this annotation

Codecov / codecov/patch

src/org/rascalmpl/types/ModifySyntaxRole.java#L861

Added line #L861 was not covered by tests
}

@Override
protected Type lubWithAbstractData(Type type) {
// this is for all the syntax roles that are not data. Data overrides this
Expand Down

0 comments on commit a1d5b0b

Please sign in to comment.