From 5cc0b90399497d0f4e5dcbf3da8cf03c1982c558 Mon Sep 17 00:00:00 2001 From: Pieter Olivier Date: Wed, 13 Nov 2024 12:11:40 +0100 Subject: [PATCH] Turned mismatch between origin and input into an exception --- src/org/rascalmpl/values/RascalFunctionValueFactory.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/org/rascalmpl/values/RascalFunctionValueFactory.java b/src/org/rascalmpl/values/RascalFunctionValueFactory.java index df56f84d499..876be4d9794 100644 --- a/src/org/rascalmpl/values/RascalFunctionValueFactory.java +++ b/src/org/rascalmpl/values/RascalFunctionValueFactory.java @@ -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: != "); } 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();