Skip to content

Commit

Permalink
Turned mismatch between origin and input into an exception
Browse files Browse the repository at this point in the history
  • Loading branch information
PieterOlivier committed Nov 13, 2024
1 parent e39e494 commit 5cc0b90
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/org/rascalmpl/values/RascalFunctionValueFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -544,12 +544,12 @@ private IString printSymbol(IConstructor symbol) {
}

protected IValue parse(String methodName, ISet filters, ISourceLocation input, ISourceLocation origin, boolean allowAmbiguity, boolean hasSideEffects) {
if (origin == null) {
origin = input;
if (origin != null && !origin.equals(input)) {
throw new IllegalArgumentException("input and origin should be equal: <input> != <origin>");

Check warning on line 548 in src/org/rascalmpl/values/RascalFunctionValueFactory.java

View check run for this annotation

Codecov / codecov/patch

src/org/rascalmpl/values/RascalFunctionValueFactory.java#L548

Added line #L548 was not covered by tests
}

try {
return parseObject(methodName, origin, readAll(input), allowAmbiguity, hasSideEffects, filters);
return parseObject(methodName, input, readAll(input), allowAmbiguity, hasSideEffects, filters);
}
catch (ParseError pe) {
ISourceLocation errorLoc = pe.getLocation();
Expand Down

0 comments on commit 5cc0b90

Please sign in to comment.