From e39e494d0880a0fbc93072235a98114112457164 Mon Sep 17 00:00:00 2001 From: Pieter Olivier Date: Thu, 3 Oct 2024 13:37:45 +0200 Subject: [PATCH 1/2] Parser origin location was not forwarded properly --- src/org/rascalmpl/values/RascalFunctionValueFactory.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/org/rascalmpl/values/RascalFunctionValueFactory.java b/src/org/rascalmpl/values/RascalFunctionValueFactory.java index 268d049479f..df56f84d499 100644 --- a/src/org/rascalmpl/values/RascalFunctionValueFactory.java +++ b/src/org/rascalmpl/values/RascalFunctionValueFactory.java @@ -549,7 +549,7 @@ protected IValue parse(String methodName, ISet filters, ISourceLocation input, I } try { - return parseObject(methodName, input, readAll(input), allowAmbiguity, hasSideEffects, filters); + return parseObject(methodName, origin, readAll(input), allowAmbiguity, hasSideEffects, filters); } catch (ParseError pe) { ISourceLocation errorLoc = pe.getLocation(); From 5cc0b90399497d0f4e5dcbf3da8cf03c1982c558 Mon Sep 17 00:00:00 2001 From: Pieter Olivier Date: Wed, 13 Nov 2024 12:11:40 +0100 Subject: [PATCH 2/2] 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();