Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jurgenvinju committed Nov 3, 2023
1 parent 37a36c6 commit 268e9c0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ implement a sensible encoding that follows the contract and tries to differentia
int concreteFingerprint(appl(Production p, list[Tree] _)) = concreteFingerprint(p);
int concreteFingerprint(amb({appl(prod(Symbol s, _, _), list[Tree] _), _})) = internalHashCode("amb") + 43 * internalHashCode(t)
when label(_, Symbol t) := s || Symbol t := s;
int concreteFingerprint(amb({})) = internalHashCode("amb");
int concreteFingerprint(char(int ch)) = internalHashCode("char") + internalHashCode(ch);
int concreteFingerprint(cycle(Symbol s, int _)) = internalHashCode("cycle") + 13 * internalHashCode(s);

Expand Down
4 changes: 4 additions & 0 deletions src/org/rascalmpl/values/RascalValueFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -1052,6 +1052,10 @@ public Amb(ISet alts) {

@Override
public int getConcreteMatchFingerprint() {
if (alternatives.isEmpty()) {
return 96694;

Check warning on line 1056 in src/org/rascalmpl/values/RascalValueFactory.java

View check run for this annotation

Codecov / codecov/patch

src/org/rascalmpl/values/RascalValueFactory.java#L1056

Added line #L1056 was not covered by tests
}

return 96694 /* "amb".hashCode() */ + 43 * ((NonTerminalType) alternatives.getElementType()).getSymbol().hashCode();
}

Expand Down

0 comments on commit 268e9c0

Please sign in to comment.