From eeaf4bc8d14fb1588498e2e0df2a67ef1d42cfc8 Mon Sep 17 00:00:00 2001 From: Toine Hartman Date: Wed, 15 Jul 2026 11:17:35 +0200 Subject: [PATCH 01/26] Run CI on all feature branches. --- .github/workflows/build.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 771c9e9e2ef..7a00f835746 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -8,7 +8,8 @@ on: pull_request: branches: - main - - 'feat/*' + - 'feat/**' + - 'feature/**' env: MAVEN_OPTS: "-Xmx4G -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true" IS_OWN_PR: "${{ secrets.MAVEN_MIRROR_URL }}" From fa40755ec414667b830b8a9b4c03112b7f8fb0ff Mon Sep 17 00:00:00 2001 From: Toine Hartman Date: Fri, 17 Jul 2026 11:57:36 +0200 Subject: [PATCH 02/26] Rename current runtime resolver. Co-authored-by: Rodin Aarssen --- src/org/rascalmpl/library/util/PathConfig.java | 14 +++++++------- .../rascalmpl/shell/AbstractCommandlineTool.java | 4 ++-- .../rascalmpl/uri/StandardLibraryURIResolver.java | 2 +- test/org/rascalmpl/compiler/CheckStdLibTest.java | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/org/rascalmpl/library/util/PathConfig.java b/src/org/rascalmpl/library/util/PathConfig.java index e62238a0575..fa79f51009a 100644 --- a/src/org/rascalmpl/library/util/PathConfig.java +++ b/src/org/rascalmpl/library/util/PathConfig.java @@ -369,7 +369,7 @@ public static ISourceLocation resolveProjectOnClasspath(String projectName) thro throw new FileNotFoundException(projectName + " jar could not be located in the current runtime classpath"); } - public static ISourceLocation resolveCurrentRascalRuntimeJar() throws IOException { + public static ISourceLocation resolveCurrentRascalRuntime() throws IOException { return resolveProjectOnClasspath("rascal"); } @@ -447,7 +447,7 @@ private static void buildRascalSelfApplicationConfig(ISourceLocation workspaceRa messages.append(Messages.info("Bootstrap |std:///| = " + StandardLibraryURIResolver.getDebugBootstrapLocation(), workspaceRascal)); // add our own jar to the lib path to make sure rascal classes are found - var runtime = resolveCurrentRascalRuntimeJar(); + var runtime = resolveCurrentRascalRuntime(); libs.append(runtime); messages.append(Messages.info("Bootstrap runtime = " + runtime, workspaceRascal)); } @@ -499,7 +499,7 @@ private static void buildRascalSelfApplicationConfig(ISourceLocation workspaceRa * Configure paths for the rascal-lsp project when it's open in the IDE (the runtime inside rascal-lsp is not configured here) */ private static void buildRascalLSPConfig(ISourceLocation manifestRoot, RascalConfigMode mode, List mavenClasspath, IListWriter srcs, IListWriter libs, IListWriter messages) throws IOException { - var insideRascalJar = JarURIResolver.jarify(resolveCurrentRascalRuntimeJar()); + var insideRascalJar = JarURIResolver.jarify(resolveCurrentRascalRuntime()); var rascalCompiler = URIUtil.getChildLocation(insideRascalJar, "org/rascalmpl/compiler"); var typepal = URIUtil.getChildLocation(insideRascalJar, "org/rascalmpl/typepal"); @@ -512,7 +512,7 @@ private static void buildRascalLSPConfig(ISourceLocation manifestRoot, RascalCon srcs.append(typepal); } else { - libs.append(JarURIResolver.jarify(resolveCurrentRascalRuntimeJar())); + libs.append(JarURIResolver.jarify(resolveCurrentRascalRuntime())); // while it's tempting to see if the rascal project is there, and we might be able to get the rascal compiler tpls from the target folder. // as long as we're hard wiring the rascal compler to follow the runtime // we have to let the type-checker for rascal-lsp re-type-check rascal compiler @@ -520,7 +520,7 @@ private static void buildRascalLSPConfig(ISourceLocation manifestRoot, RascalCon srcs.append(rascalCompiler); srcs.append(typepal); } - libs.append(resolveCurrentRascalRuntimeJar()); // add our own jar to the lib path to make sure rascal classes are found + libs.append(resolveCurrentRascalRuntime()); // add our own jar to the lib path to make sure rascal classes are found translateSources(manifestRoot, srcs, messages); @@ -551,13 +551,13 @@ private static void buildNormalProjectConfig(ISourceLocation manifestRoot, Rasca if (isRoot) { if (mode == RascalConfigMode.INTERPRETER) { srcs.append(URIUtil.rootLocation("std")); // you'll always get rascal from standard in case of interpreter mode - libs.append(resolveCurrentRascalRuntimeJar()); // add our own jar to the lib path to make sure rascal classes are found + libs.append(resolveCurrentRascalRuntime()); // add our own jar to the lib path to make sure rascal classes are found } else { assert mode == RascalConfigMode.COMPILER: "should be compiler"; // untill we go pom.xml first, you'll always get the rascal jar from our runtime // not the one you requested in the pom.xml - libs.append(JarURIResolver.jarify(resolveCurrentRascalRuntimeJar())); + libs.append(JarURIResolver.jarify(resolveCurrentRascalRuntime())); } } diff --git a/src/org/rascalmpl/shell/AbstractCommandlineTool.java b/src/org/rascalmpl/shell/AbstractCommandlineTool.java index 3bcbfec4a05..1217f98d2c5 100644 --- a/src/org/rascalmpl/shell/AbstractCommandlineTool.java +++ b/src/org/rascalmpl/shell/AbstractCommandlineTool.java @@ -33,7 +33,7 @@ public abstract class AbstractCommandlineTool { public static int main(String mainModule, String[] sourceFolders, String[] args, Terminal term, IRascalMonitor monitor, PrintWriter err, PrintWriter out) { try { var eval = ShellEvaluatorFactory.getBasicEvaluator(term.reader(), out, err, monitor); - var rascalJar = JarURIResolver.jarify(PathConfig.resolveCurrentRascalRuntimeJar()); + var rascalJar = JarURIResolver.jarify(PathConfig.resolveCurrentRascalRuntime()); for (String folder : sourceFolders) { var src = URIUtil.getChildLocation(rascalJar, folder); @@ -83,7 +83,7 @@ else if (result.getType().isInteger()) { public static int main(String mainModule, String[] sourceFolders, Map args, Terminal term, IRascalMonitor monitor, PrintWriter err, PrintWriter out) { try { var eval = ShellEvaluatorFactory.getBasicEvaluator(term.reader(), out, err, monitor); - var rascalJar = JarURIResolver.jarify(PathConfig.resolveCurrentRascalRuntimeJar()); + var rascalJar = JarURIResolver.jarify(PathConfig.resolveCurrentRascalRuntime()); for (String folder : sourceFolders) { var src = URIUtil.getChildLocation(rascalJar, folder); diff --git a/src/org/rascalmpl/uri/StandardLibraryURIResolver.java b/src/org/rascalmpl/uri/StandardLibraryURIResolver.java index fd8270e1f15..ccbb0758a00 100644 --- a/src/org/rascalmpl/uri/StandardLibraryURIResolver.java +++ b/src/org/rascalmpl/uri/StandardLibraryURIResolver.java @@ -34,7 +34,7 @@ public class StandardLibraryURIResolver implements ILogicalSourceLocationResolve private static ISourceLocation resolveCurrentRascalJar() { try { - return PathConfig.resolveCurrentRascalRuntimeJar(); + return PathConfig.resolveCurrentRascalRuntime(); } catch (IOException e) { // this will be reported elsewhere in PathConfig.messages - diff --git a/test/org/rascalmpl/compiler/CheckStdLibTest.java b/test/org/rascalmpl/compiler/CheckStdLibTest.java index f629f3eaf23..129fb613a67 100644 --- a/test/org/rascalmpl/compiler/CheckStdLibTest.java +++ b/test/org/rascalmpl/compiler/CheckStdLibTest.java @@ -60,11 +60,11 @@ private void simulateShadedTypePal() throws IOException { typepal = MavenRepositoryURIResolver.mavenize(typepal); typepal = JarURIResolver.jarify(typepal); - URIResolverRegistry.getInstance().copy(typepal, URIUtil.getChildLocation(PathConfig.resolveCurrentRascalRuntimeJar(), "org/rascalmpl/typepal"), true, true); + URIResolverRegistry.getInstance().copy(typepal, URIUtil.getChildLocation(PathConfig.resolveCurrentRascalRuntime(), "org/rascalmpl/typepal"), true, true); } private void cleanSimulatedTypePal() throws IOException { - URIResolverRegistry.getInstance().remove(URIUtil.getChildLocation(PathConfig.resolveCurrentRascalRuntimeJar(), "org/rascalmpl/typepal"), true); + URIResolverRegistry.getInstance().remove(URIUtil.getChildLocation(PathConfig.resolveCurrentRascalRuntime(), "org/rascalmpl/typepal"), true); } private ISourceLocation rascalProjectRoot(ISourceLocation stdLibRoot) { From 3c038e508b4ee78d852201515bb9bcde5ec7a759 Mon Sep 17 00:00:00 2001 From: Toine Hartman Date: Wed, 15 Jul 2026 12:13:24 +0200 Subject: [PATCH 03/26] Remove `std:///` from Rascal path config." Part of #2819. --- .../rascalmpl/library/util/PathConfig.java | 21 ++++++++----------- .../uri/StandardLibraryURIResolver.java | 12 ++--------- 2 files changed, 11 insertions(+), 22 deletions(-) diff --git a/src/org/rascalmpl/library/util/PathConfig.java b/src/org/rascalmpl/library/util/PathConfig.java index fa79f51009a..3788c65525f 100644 --- a/src/org/rascalmpl/library/util/PathConfig.java +++ b/src/org/rascalmpl/library/util/PathConfig.java @@ -22,7 +22,6 @@ import org.rascalmpl.interpreter.Configuration; import org.rascalmpl.interpreter.utils.RascalManifest; import org.rascalmpl.library.Messages; -import org.rascalmpl.uri.StandardLibraryURIResolver; import org.rascalmpl.uri.URIResolverRegistry; import org.rascalmpl.uri.URIUtil; import org.rascalmpl.uri.file.MavenRepositoryURIResolver; @@ -441,21 +440,19 @@ public static PathConfig parse(String pathConfigString) throws IOException { * Configure paths for the rascal project itself, so if someone has rascal open in their IDE for example, or is starting a REPL for rascal */ private static void buildRascalSelfApplicationConfig(ISourceLocation workspaceRascal, RascalConfigMode mode, List mavenClassPath, IListWriter srcs, IListWriter libs, IListWriter messages) throws IOException { + // we want to help rascal devs work on rascal to at least get type-check errors, so if we're in compile mode, you get the source path + // but otherwise, you always get the boostrap Rascal in your REPL + var stdSrc = URIUtil.getChildLocation(workspaceRascal, "src/org/rascalmpl/library"); + srcs.append(stdSrc); + if (mode == RascalConfigMode.INTERPRETER) { - // if you want to test rascal changes, use RascalShell class and run it as a java process - srcs.append(URIUtil.rootLocation("std")); - - messages.append(Messages.info("Bootstrap |std:///| = " + StandardLibraryURIResolver.getDebugBootstrapLocation(), workspaceRascal)); - // add our own jar to the lib path to make sure rascal classes are found + messages.append(Messages.info("Bootstrap stdlib = " + stdSrc, workspaceRascal)); + + // add our own jar/target folder to the lib path to make sure rascal classes are found var runtime = resolveCurrentRascalRuntime(); libs.append(runtime); messages.append(Messages.info("Bootstrap runtime = " + runtime, workspaceRascal)); } - else { - // we want to help rascal devs work on rascal to at least get type-check errors, so if we're in compile mode, you get the source path - // but otherwise, you alway get the `std:///` in your repl - srcs.append(URIUtil.getChildLocation(workspaceRascal, "src/org/rascalmpl/library")); - } // compiler & tutor only paths srcs.append(URIUtil.getChildLocation(workspaceRascal, "src/org/rascalmpl/compiler")); @@ -487,7 +484,7 @@ private static void buildRascalSelfApplicationConfig(ISourceLocation workspaceRa } // the interpreter should pick up the typepal sources - // and so should the typechecker, otherwise it might get type-checked against the wrong `std:///` jar (namely from it's pom.xml) + // and so should the typechecker, otherwise it might get type-checked against the wrong standard library (namely from it's pom.xml) if (typepal != null) { srcs.append(typepal); } else { diff --git a/src/org/rascalmpl/uri/StandardLibraryURIResolver.java b/src/org/rascalmpl/uri/StandardLibraryURIResolver.java index ccbb0758a00..565a19b11b2 100644 --- a/src/org/rascalmpl/uri/StandardLibraryURIResolver.java +++ b/src/org/rascalmpl/uri/StandardLibraryURIResolver.java @@ -24,7 +24,7 @@ * standard library in the libs path of a PathConfig. */ public class StandardLibraryURIResolver implements ILogicalSourceLocationResolver { - private static final ISourceLocation currentRascalJar = + private static final ISourceLocation currentRascalLibrary = URIUtil.getChildLocation( JarURIResolver.jarify( resolveCurrentRascalJar() @@ -44,7 +44,7 @@ private static ISourceLocation resolveCurrentRascalJar() { @Override public ISourceLocation resolve(ISourceLocation input) throws IOException { - return URIUtil.getChildLocation(currentRascalJar, input.getPath()); + return URIUtil.getChildLocation(currentRascalLibrary, input.getPath()); } @Override @@ -57,12 +57,4 @@ public String authority() { return ""; } - /* - * Not for general use, but necessary information about the bill of - * materials for bootstrapping (running Rascal to implement Rascal). - */ - public static ISourceLocation getDebugBootstrapLocation() { - return currentRascalJar; - } - } From 78c3c58b940d3bbb81059c24f9d79074dafdbcef Mon Sep 17 00:00:00 2001 From: Toine Hartman Date: Wed, 15 Jul 2026 13:04:41 +0200 Subject: [PATCH 04/26] Remove `std:///` from Rascal-LSP path config. Part of #2819. Co-authored-by: Rodin Aarssen --- src/org/rascalmpl/library/util/PathConfig.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/org/rascalmpl/library/util/PathConfig.java b/src/org/rascalmpl/library/util/PathConfig.java index 3788c65525f..9ec3038be91 100644 --- a/src/org/rascalmpl/library/util/PathConfig.java +++ b/src/org/rascalmpl/library/util/PathConfig.java @@ -496,20 +496,22 @@ private static void buildRascalSelfApplicationConfig(ISourceLocation workspaceRa * Configure paths for the rascal-lsp project when it's open in the IDE (the runtime inside rascal-lsp is not configured here) */ private static void buildRascalLSPConfig(ISourceLocation manifestRoot, RascalConfigMode mode, List mavenClasspath, IListWriter srcs, IListWriter libs, IListWriter messages) throws IOException { - var insideRascalJar = JarURIResolver.jarify(resolveCurrentRascalRuntime()); + var currentRascalRuntime = resolveCurrentRascalRuntime(); + var insideRascalJar = JarURIResolver.jarify(currentRascalRuntime); + var rascalLibrary = URIUtil.getChildLocation(insideRascalJar, "org/rascalmpl/library"); var rascalCompiler = URIUtil.getChildLocation(insideRascalJar, "org/rascalmpl/compiler"); var typepal = URIUtil.getChildLocation(insideRascalJar, "org/rascalmpl/typepal"); if (mode == RascalConfigMode.INTERPRETER) { - // we're building a repl for the rascal-lsp project + // we're building a REPL for the rascal-lsp project // so this is a rascal-lsp developer working on code in rascal-lsp // most stuff flows from the - srcs.append(URIUtil.rootLocation("std")); + srcs.append(rascalLibrary); srcs.append(rascalCompiler); srcs.append(typepal); } else { - libs.append(JarURIResolver.jarify(resolveCurrentRascalRuntime())); + libs.append(insideRascalJar); // while it's tempting to see if the rascal project is there, and we might be able to get the rascal compiler tpls from the target folder. // as long as we're hard wiring the rascal compler to follow the runtime // we have to let the type-checker for rascal-lsp re-type-check rascal compiler @@ -517,7 +519,7 @@ private static void buildRascalLSPConfig(ISourceLocation manifestRoot, RascalCon srcs.append(rascalCompiler); srcs.append(typepal); } - libs.append(resolveCurrentRascalRuntime()); // add our own jar to the lib path to make sure rascal classes are found + libs.append(currentRascalRuntime); // add our own jar to the lib path to make sure rascal classes are found translateSources(manifestRoot, srcs, messages); From e337ef1bc89563a7017d8812d2759eca9bfdecce Mon Sep 17 00:00:00 2001 From: Toine Hartman Date: Fri, 17 Jul 2026 12:08:01 +0200 Subject: [PATCH 05/26] Remove `std:///` from regular project's path config. Part of #2819. Co-authored-by: Rodin Aarssen --- .../rascalmpl/library/util/PathConfig.java | 29 +++++++++++++++---- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/src/org/rascalmpl/library/util/PathConfig.java b/src/org/rascalmpl/library/util/PathConfig.java index 9ec3038be91..276ddad6157 100644 --- a/src/org/rascalmpl/library/util/PathConfig.java +++ b/src/org/rascalmpl/library/util/PathConfig.java @@ -546,21 +546,40 @@ private static void translateSources(ISourceLocation manifestRoot, IListWriter s } } + public static boolean isRascalArtifact(Artifact art) { + var coord = art.getCoordinate(); + return coord.getArtifactId().equals("rascal") + && coord.getGroupId().equals("org.rascalmpl"); + } + private static void buildNormalProjectConfig(ISourceLocation manifestRoot, RascalConfigMode mode, List mavenClasspath, boolean isRoot, IListWriter srcs, IListWriter libs, IListWriter messages) throws IOException, URISyntaxException { if (isRoot) { if (mode == RascalConfigMode.INTERPRETER) { - srcs.append(URIUtil.rootLocation("std")); // you'll always get rascal from standard in case of interpreter mode + srcs.append(URIUtil.getChildLocation(JarURIResolver.jarify(resolveCurrentRascalRuntime()), "org/rascalmpl/library")); libs.append(resolveCurrentRascalRuntime()); // add our own jar to the lib path to make sure rascal classes are found } else { assert mode == RascalConfigMode.COMPILER: "should be compiler"; - // untill we go pom.xml first, you'll always get the rascal jar from our runtime - // not the one you requested in the pom.xml - libs.append(JarURIResolver.jarify(resolveCurrentRascalRuntime())); + + var rascalFromPom = mavenClasspath.stream() + .filter(PathConfig::isRascalArtifact) + .findFirst() + .map(Artifact::getResolved) + .map(Path::toUri) + .map(vf::sourceLocation); + + if (rascalFromPom.isPresent()) { + // Explicit Rascal dependency in the pom.xml + libs.append(rascalFromPom.get()); + } else { + // Fall back to current runtime Rascal and warn the user + var runtimeRascal = JarURIResolver.jarify(resolveCurrentRascalRuntime()); + messages.append(Messages.warning(String.format("No Rascal dependency found in pom.xml. Using %s instead.", runtimeRascal), manifestRoot)); + libs.append(runtimeRascal); + } } } - // This processes Rascal libraries we can find in maven dependencies, // and we add them to the srcs unless a project is open with the same name, then we defer to its srcs // to make it easier to edit projects in the IDE From 6d3b185f621b2bc2248073290002a61c776ba455 Mon Sep 17 00:00:00 2001 From: Toine Hartman Date: Fri, 17 Jul 2026 11:11:15 +0200 Subject: [PATCH 06/26] Replace `std:///` on evaluator search path. Closes #2821. Co-authored-by: Rodin Aarssen --- .../load/StandardLibraryContributor.java | 54 ------------------- .../rascalmpl/library/util/PathConfig.java | 4 ++ .../shell/ShellEvaluatorFactory.java | 8 ++- 3 files changed, 10 insertions(+), 56 deletions(-) delete mode 100644 src/org/rascalmpl/interpreter/load/StandardLibraryContributor.java diff --git a/src/org/rascalmpl/interpreter/load/StandardLibraryContributor.java b/src/org/rascalmpl/interpreter/load/StandardLibraryContributor.java deleted file mode 100644 index 5b48cda82b0..00000000000 --- a/src/org/rascalmpl/interpreter/load/StandardLibraryContributor.java +++ /dev/null @@ -1,54 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2011-2013 CWI - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - - * * Jurgen J. Vinju - Jurgen.Vinju@cwi.nl - CWI - * * Atze van der Ploeg - A.J.van.der.Ploeg@cwi.nl - CWI - * * Davy Landman - Davy.Landman@cwi.nl -*******************************************************************************/ -package org.rascalmpl.interpreter.load; - -import java.util.List; - -import org.rascalmpl.uri.URIUtil; - -import io.usethesource.vallang.ISourceLocation; - - -public class StandardLibraryContributor implements - IRascalSearchPathContributor { - - private StandardLibraryContributor() { } - - private static class InstanceHolder { - public static StandardLibraryContributor sInstance = new StandardLibraryContributor(); - } - - @Override - public String getName() { - return "std"; - } - - public static StandardLibraryContributor getInstance() { - return InstanceHolder.sInstance; - } - - public void contributePaths(List l) { - l.add(URIUtil.rootLocation("std")); - } - - @Override - public String toString() { - return "|std:///|"; - } - - @Override - public boolean equals(Object obj) { - return obj == this; - } -} diff --git a/src/org/rascalmpl/library/util/PathConfig.java b/src/org/rascalmpl/library/util/PathConfig.java index 276ddad6157..25910ee439e 100644 --- a/src/org/rascalmpl/library/util/PathConfig.java +++ b/src/org/rascalmpl/library/util/PathConfig.java @@ -372,6 +372,10 @@ public static ISourceLocation resolveCurrentRascalRuntime() throws IOException { return resolveProjectOnClasspath("rascal"); } + public static ISourceLocation resolveCurrentStandardLibrary() throws IOException { + return URIUtil.getChildLocation(JarURIResolver.jarify(resolveCurrentRascalRuntime()), "org/rascalmpl/library"); + } + public static ISourceLocation inferProjectRoot(Class clazz) throws IOException { var url = clazz.getProtectionDomain().getCodeSource().getLocation(); diff --git a/src/org/rascalmpl/shell/ShellEvaluatorFactory.java b/src/org/rascalmpl/shell/ShellEvaluatorFactory.java index 43609761586..1fde572bda7 100644 --- a/src/org/rascalmpl/shell/ShellEvaluatorFactory.java +++ b/src/org/rascalmpl/shell/ShellEvaluatorFactory.java @@ -1,5 +1,6 @@ package org.rascalmpl.shell; +import java.io.IOException; import java.io.PrintWriter; import java.io.Reader; import java.util.function.Function; @@ -9,7 +10,6 @@ import org.rascalmpl.interpreter.Evaluator; import org.rascalmpl.interpreter.env.GlobalEnvironment; import org.rascalmpl.interpreter.env.ModuleEnvironment; -import org.rascalmpl.interpreter.load.StandardLibraryContributor; import org.rascalmpl.interpreter.utils.RascalManifest; import org.rascalmpl.library.Messages; import org.rascalmpl.library.util.PathConfig; @@ -35,7 +35,11 @@ public static Evaluator getBasicEvaluator(Reader input, PrintWriter stdout, Prin var heap = new GlobalEnvironment(); var root = heap.addModule(new ModuleEnvironment(rootEnvironment, heap)); var evaluator = new Evaluator(ValueFactoryFactory.getValueFactory(), input, stderr, stdout, root, heap, monitor); - evaluator.addRascalSearchPathContributor(StandardLibraryContributor.getInstance()); + try { + evaluator.addRascalSearchPath(PathConfig.resolveCurrentStandardLibrary()); + } catch (IOException e) { + monitor.warning("No Rascal runtime found", URIUtil.unknownLocation()); + } return evaluator; } From 30a9a8e6f9a657109753ffe02faa8a38f7a022b9 Mon Sep 17 00:00:00 2001 From: Toine Hartman Date: Fri, 17 Jul 2026 12:58:09 +0200 Subject: [PATCH 07/26] Replace uses of std:/// in Rascal code. Closes #2825. Co-authored-by: Rodin Aarssen --- .../rascalmpl/compiler/CheckTestSources.rsc | 2 +- .../rascalmpl/compiler/CompileTestSources.rsc | 2 +- .../lang/rascalcore/check/TestConfigs.rsc | 4 ++-- .../lang/rascalcore/compile/AREADME.txt | 10 +++++----- .../compile/Examples/RascalExtraction.rsc | 2 +- .../compile/Examples/RascalMetrics.rsc | 14 ++++++------- src/org/rascalmpl/library/IO.rsc | 10 +++++----- src/org/rascalmpl/library/index.md | 4 ++-- .../lang/rascal/grammar/tests/Compare.rsc | 2 +- .../grammar/tests/ParserGeneratorTests.rsc | 8 ++++---- .../syntax/tests/ParsingRegressionTests.rsc | 2 +- .../lang/rascal/tests/basic/IsDefined.rsc | 4 ++-- .../concrete/ModulesWithStoredParsers.rsc | 2 +- .../recovery/ErrorRecoveryBenchmark.rsc | 20 +++++++++---------- .../concrete/recovery/ParseBenchmark.rsc | 4 ++-- .../concrete/recovery/RecoveryTestSupport.rsc | 2 +- .../concrete/recovery/bugs/DataTypeSlow.rsc | 2 +- .../tests/concrete/recovery/bugs/FCASlow.rsc | 2 +- .../recovery/bugs/FlowGraphOutOfMemoryBug.rsc | 2 +- .../recovery/bugs/InfiniteLoopBug.rsc | 2 +- .../concrete/recovery/bugs/OvertakeBug.rsc | 2 +- .../recovery/bugs/OvertakenNullableBug.rsc | 2 +- .../concrete/recovery/bugs/Patterns3Slow.rsc | 2 +- .../recovery/bugs/PreferAvoidSlow.rsc | 2 +- .../analysis/formalconcepts/FCATest.rsc | 4 ++-- .../tests/library/lang/html/IOTests.rsc | 2 +- .../tests/library/lang/json/JSONIOTests.rsc | 4 ++-- .../tests/library/lang/xml/XMLIOTests.rsc | 8 ++++---- src/org/rascalmpl/library/vis/Graphs.rsc | 2 +- .../Test/Libraries/Boolean/Boolean.remote | 2 +- .../benchmark/Visiting/ProdVersusType.rsc | 2 +- 31 files changed, 66 insertions(+), 66 deletions(-) diff --git a/src/org/rascalmpl/compiler/CheckTestSources.rsc b/src/org/rascalmpl/compiler/CheckTestSources.rsc index 9fcd3de8496..34fe25dc206 100644 --- a/src/org/rascalmpl/compiler/CheckTestSources.rsc +++ b/src/org/rascalmpl/compiler/CheckTestSources.rsc @@ -66,7 +66,7 @@ void checkTestSources(list[str] cmdLineArgs) { if("all" in cmdLineArgs){ modulesToCheck = getRascalModules(REPO + "rascal/src/org/rascalmpl/library", pcfg); } else { - testFolders = [ //|std:///lang/rascal/tests|, + testFolders = [ //|project://rascal/src/org/rascalmpl/library/lang/rascal/tests|, //REPO + "/rascal-core/lang/rascalcore/check::tests", REPO + "/typepal/src/" ]; diff --git a/src/org/rascalmpl/compiler/CompileTestSources.rsc b/src/org/rascalmpl/compiler/CompileTestSources.rsc index 5ee3f9e6f05..f9ce0e4b87a 100644 --- a/src/org/rascalmpl/compiler/CompileTestSources.rsc +++ b/src/org/rascalmpl/compiler/CompileTestSources.rsc @@ -145,7 +145,7 @@ void compileTestSources(PathConfig pcfg) { // total += d; //} - testFolder = |std:///lang/rascal/|; + testFolder = |project://rascal/src/org/rascalmpl/library/lang/rascal/|; testModules = [ replaceAll(file[extension=""].path[1..], "/", "::") | loc file <- find(testFolder, "rsc") // all Rascal source files diff --git a/src/org/rascalmpl/compiler/lang/rascalcore/check/TestConfigs.rsc b/src/org/rascalmpl/compiler/lang/rascalcore/check/TestConfigs.rsc index 6a001646f96..e1ef94c3e69 100644 --- a/src/org/rascalmpl/compiler/lang/rascalcore/check/TestConfigs.rsc +++ b/src/org/rascalmpl/compiler/lang/rascalcore/check/TestConfigs.rsc @@ -75,14 +75,14 @@ public loc testModulesRoot = testRoot + "src"; private int npc = 0; @synopsis{PathConfig for testing generated modules in |memory://test-modules/| in memory file system, not depending on any outside libraries.} @description{ -* gets source files exclusively from |memory://test-modules/| and |std:///| (for library code) +* gets source files exclusively from |memory://test-modules/| and |project://rascal/src/org/rascalmpl/library/| (for library code) * generates bin files in the in-memory file system } public PathConfig getDefaultTestingPathConfig() { npc += 1; snpc = ""; return pathConfig( - srcs = [ testModulesRoot, |std:///| ], + srcs = [ testModulesRoot, |project://rascal/src/org/rascalmpl/library/| ], bin = testRoot + "rascal-tests-bin-", generatedSources = testRoot + "generated-test-sources-", generatedResources = testRoot + "generated-test-resources-", diff --git a/src/org/rascalmpl/compiler/lang/rascalcore/compile/AREADME.txt b/src/org/rascalmpl/compiler/lang/rascalcore/compile/AREADME.txt index 4c9f817a307..d6f82fcaf41 100644 --- a/src/org/rascalmpl/compiler/lang/rascalcore/compile/AREADME.txt +++ b/src/org/rascalmpl/compiler/lang/rascalcore/compile/AREADME.txt @@ -71,13 +71,13 @@ config void config( // Inspect type checker configuration file Query select = none()) // Query to define what to show Examples: -compile(|std:///experiments/Compiler/Examples/Fac.rsc|); +compile(|project://rascal/src/org/rascalmpl/library/experiments/Compiler/Examples/Fac.rsc|); -execute(|std:///experiments/Compiler/Examples/Fac.rsc|, []); -execute(|std:///experiments/Compiler/Examples/Fac.rsc|, [], recompile=true); -execute(|std:///experiments/Compiler/Examples/Fac.rsc|, [], profile=true); +execute(|project://rascal/src/org/rascalmpl/library/experiments/Compiler/Examples/Fac.rsc|, []); +execute(|project://rascal/src/org/rascalmpl/library/experiments/Compiler/Examples/Fac.rsc|, [], recompile=true); +execute(|project://rascal/src/org/rascalmpl/library/experiments/Compiler/Examples/Fac.rsc|, [], profile=true); -inspect(|std:///experiments/Compiler/Examples/Fac.rsc|) +inspect(|project://rascal/src/org/rascalmpl/library/experiments/Compiler/Examples/Fac.rsc|) Directory structure: diff --git a/src/org/rascalmpl/compiler/lang/rascalcore/compile/Examples/RascalExtraction.rsc b/src/org/rascalmpl/compiler/lang/rascalcore/compile/Examples/RascalExtraction.rsc index 53412d70803..0ca27c7d5db 100644 --- a/src/org/rascalmpl/compiler/lang/rascalcore/compile/Examples/RascalExtraction.rsc +++ b/src/org/rascalmpl/compiler/lang/rascalcore/compile/Examples/RascalExtraction.rsc @@ -37,7 +37,7 @@ import util::Reflective; value main() = compareAll(); value compareAll() { - moduleLoc = |std:///experiments/Compiler/Rascal2muRascal/RascalExpression.rsc|; + moduleLoc = |project://rascal/src/org/rascalmpl/library/experiments/Compiler/Rascal2muRascal/RascalExpression.rsc|; //moduleLoc = |project://rascal/src/org/rascalmpl/library/experiments/Compiler/Examples/Tst3.rsc|; m = parse(#start[Module], moduleLoc).top; t = cpuTime(); diff --git a/src/org/rascalmpl/compiler/lang/rascalcore/compile/Examples/RascalMetrics.rsc b/src/org/rascalmpl/compiler/lang/rascalcore/compile/Examples/RascalMetrics.rsc index 1f3355de8c5..004b345d34b 100644 --- a/src/org/rascalmpl/compiler/lang/rascalcore/compile/Examples/RascalMetrics.rsc +++ b/src/org/rascalmpl/compiler/lang/rascalcore/compile/Examples/RascalMetrics.rsc @@ -45,13 +45,13 @@ value main() value measure(){ - //moduleLoc = |std:///lang/rascal/syntax/Rascal.rsc|; - moduleLoc = |std:///experiments/Compiler/RVM/AST.rsc|; - //moduleLoc = |std:///experiments/Compiler/RVM/Syntax.rsc|; - //moduleLoc = |std:///experiments/Compiler/muRascal/Syntax.rsc|; - //moduleLoc = |std:///experiments/Compiler/muRascal/AST.rsc|; - //moduleLoc = |std:///demo/lang/Pico/Syntax.rsc|; - //moduleLoc = |std:///demo/lang/Exp/Concrete/NoLayout/Syntax.rsc|; + //moduleLoc = |project://rascal/src/org/rascalmpl/library/lang/rascal/syntax/Rascal.rsc|; + moduleLoc = |project://rascal/src/org/rascalmpl/library/experiments/Compiler/RVM/AST.rsc|; + //moduleLoc = |project://rascal/src/org/rascalmpl/library/experiments/Compiler/RVM/Syntax.rsc|; + //moduleLoc = |project://rascal/src/org/rascalmpl/library/experiments/Compiler/muRascal/Syntax.rsc|; + //moduleLoc = |project://rascal/src/org/rascalmpl/library/experiments/Compiler/muRascal/AST.rsc|; + //moduleLoc = |project://rascal/src/org/rascalmpl/library/demo/lang/Pico/Syntax.rsc|; + //moduleLoc = |project://rascal/src/org/rascalmpl/library/demo/lang/Exp/Concrete/NoLayout/Syntax.rsc|; m = parse(#start[Module], moduleLoc).top; stats = (); nonterm = {}; diff --git a/src/org/rascalmpl/library/IO.rsc b/src/org/rascalmpl/library/IO.rsc index 3725a6a2e05..a3535ef9bbf 100644 --- a/src/org/rascalmpl/library/IO.rsc +++ b/src/org/rascalmpl/library/IO.rsc @@ -204,7 +204,7 @@ import IO; Does the library file `IO.rsc` exist? ```rascal-shell,continue -exists(|std:///IO.rsc|); +exists(|project://rascal/src/org/rascalmpl/library/IO.rsc|); ``` } @javaClass{org.rascalmpl.library.Prelude} @@ -218,7 +218,7 @@ import IO; ``` Find the file `IO.rsc` in the standard library: ```rascal-shell,continue -find("IO.rsc", [|std:///|]); +find("IO.rsc", [|project://rascal/src/org/rascalmpl/library/|]); ``` } public loc find(str name, list[loc] path) throws PathNotFound { @@ -367,7 +367,7 @@ import IO; ``` Determine the last modification date of the Rascal standard library: ```rascal-shell,continue -lastModified(|std:///IO.rsc|); +lastModified(|project://rascal/src/org/rascalmpl/library/IO.rsc|); ``` } @javaClass{org.rascalmpl.library.Prelude} @@ -384,7 +384,7 @@ import IO; ``` Determine the last modification date of the Rascal standard library: ```rascal-shell,continue -created(|std:///IO.rsc|); +created(|project://rascal/src/org/rascalmpl/library/IO.rsc|); ``` } @javaClass{org.rascalmpl.library.Prelude} @@ -412,7 +412,7 @@ import IO; ``` List all entries in the standard library: ```rascal-shell,continue -listEntries(|std:///|); +listEntries(|project://rascal/src/org/rascalmpl/library/|); ``` } @javaClass{org.rascalmpl.library.Prelude} diff --git a/src/org/rascalmpl/library/index.md b/src/org/rascalmpl/library/index.md index b8d56ac67d2..0533fc75eb5 100644 --- a/src/org/rascalmpl/library/index.md +++ b/src/org/rascalmpl/library/index.md @@ -21,11 +21,11 @@ println("Hello Rascal!"); The ((Library:module:IO)) module is otherwise most commonly used, because it contains ((println)). -The standard library has its own location scheme `std:///` which can be used to explore +The standard library has its own location scheme `project://rascal/src/org/rascalmpl/library/` which can be used to explore its folder structure on the REPL. Note that source locations have auto-complete for the path component. ```rascal-shell -|std:///|.ls +|project://rascal/src/org/rascalmpl/library/|.ls ``` These are the entry points to the entire library: diff --git a/src/org/rascalmpl/library/lang/rascal/grammar/tests/Compare.rsc b/src/org/rascalmpl/library/lang/rascal/grammar/tests/Compare.rsc index 72be006293a..4911aba671b 100644 --- a/src/org/rascalmpl/library/lang/rascal/grammar/tests/Compare.rsc +++ b/src/org/rascalmpl/library/lang/rascal/grammar/tests/Compare.rsc @@ -8,7 +8,7 @@ import Set; value main() = compare3(); value compare1() { - INT = split("\n", readFile(|std:///lang/rascal/grammar/tests/generated_parsers/CParserINT.java|)); + INT = split("\n", readFile(|project://rascal/src/org/rascalmpl/library/lang/rascal/grammar/tests/generated_parsers/CParserINT.java|)); COMP = split("\n", readFile(|std://lang/rascal/grammar/tests/generated_parsers/CParserCOMP.java|)); INTSET = toSet(INT); diff --git a/src/org/rascalmpl/library/lang/rascal/grammar/tests/ParserGeneratorTests.rsc b/src/org/rascalmpl/library/lang/rascal/grammar/tests/ParserGeneratorTests.rsc index 1723c7fd455..9d68ff3aa19 100644 --- a/src/org/rascalmpl/library/lang/rascal/grammar/tests/ParserGeneratorTests.rsc +++ b/src/org/rascalmpl/library/lang/rascal/grammar/tests/ParserGeneratorTests.rsc @@ -307,16 +307,16 @@ bool sameLines(str s1, str s2) = size(removeEmptyLines(s1) - removeEmptyLines(s2 test bool tstNewGenerateGEMPTY() = sameLines(newGenerate("org.rascalmpl.library.lang.rascal.grammar.tests.generated_parsers", "GEMPTYParser", GEMPTY), - readFile(|std:///lang/rascal/grammar/tests/generated_parsers/GEMPTYParser.java.gz|)); + readFile(|project://rascal/src/org/rascalmpl/library/lang/rascal/grammar/tests/generated_parsers/GEMPTYParser.java.gz|)); test bool tstNewGenerateG0() = sameLines(newGenerate("org.rascalmpl.library.lang.rascal.grammar.tests.generated_parsers", "G0Parser", G0), - readFile(|std:///lang/rascal/grammar/tests/generated_parsers/G0Parser.java.gz|)); + readFile(|project://rascal/src/org/rascalmpl/library/lang/rascal/grammar/tests/generated_parsers/G0Parser.java.gz|)); test bool tstNewGenerateGEXP() = sameLines(newGenerate("org.rascalmpl.library.lang.rascal.grammar.tests.generated_parsers", "GEXPParser", GEXP), - readFile(|std:///lang/rascal/grammar/tests/generated_parsers/GEXPParser.java.gz|)); + readFile(|project://rascal/src/org/rascalmpl/library/lang/rascal/grammar/tests/generated_parsers/GEXPParser.java.gz|)); test bool tstNewGenerateGEXPPRIO() = sameLines(newGenerate("org.rascalmpl.library.lang.rascal.grammar.tests.generated_parsers", "GEXPPRIOParser", GEXPPRIO), - readFile(|std:///lang/rascal/grammar/tests/generated_parsers/GEXPPRIOParser.java.gz|)); + readFile(|project://rascal/src/org/rascalmpl/library/lang/rascal/grammar/tests/generated_parsers/GEXPPRIOParser.java.gz|)); diff --git a/src/org/rascalmpl/library/lang/rascal/syntax/tests/ParsingRegressionTests.rsc b/src/org/rascalmpl/library/lang/rascal/syntax/tests/ParsingRegressionTests.rsc index 20de62fb49c..1f4cf9d2df5 100644 --- a/src/org/rascalmpl/library/lang/rascal/syntax/tests/ParsingRegressionTests.rsc +++ b/src/org/rascalmpl/library/lang/rascal/syntax/tests/ParsingRegressionTests.rsc @@ -40,7 +40,7 @@ public bool testModules(list[loc] files, list[loc] _) { } -public test bool StandardLibrary() = testModules([f | /file(f) <- crawl(|std:///|), f.extension == "rsc", /experiments/ !:= f.path], []); +public test bool StandardLibrary() = testModules([f | /file(f) <- crawl(|project://rascal/src/org/rascalmpl/library/|), f.extension == "rsc", /experiments/ !:= f.path], []); public test bool testTutor() = testModules([f | /file(f) <- crawl(|tutor:///|), f.extension == "rsc"], [|tutor:///|]); diff --git a/src/org/rascalmpl/library/lang/rascal/tests/basic/IsDefined.rsc b/src/org/rascalmpl/library/lang/rascal/tests/basic/IsDefined.rsc index 178a39c03e3..cf39d92b79b 100644 --- a/src/org/rascalmpl/library/lang/rascal/tests/basic/IsDefined.rsc +++ b/src/org/rascalmpl/library/lang/rascal/tests/basic/IsDefined.rsc @@ -19,8 +19,8 @@ test bool isDefinedLoc1() = |project://x/y.txt|(5,4,<1,5>,<1,9>).begin?; test bool isDefinedLoc2() = |project://x/y.txt|(5,4,<1,5>,<1,9>).end?; test bool isDefinedLoc3() = !(|project://x/y.txt|(5,4,<1,5>,<1,9>).host?); -test bool isDefinedLoc4() = !(|std:///List.rsc|.ls?); -test bool isDefinedLoc5() = |std:///util|.ls?; +test bool isDefinedLoc4() = !(|project://rascal/src/org/rascalmpl/library/List.rsc|.ls?); +test bool isDefinedLoc5() = |project://rascal/src/org/rascalmpl/library/util|.ls?; // Lists diff --git a/src/org/rascalmpl/library/lang/rascal/tests/concrete/ModulesWithStoredParsers.rsc b/src/org/rascalmpl/library/lang/rascal/tests/concrete/ModulesWithStoredParsers.rsc index b7545bf768b..a415fae7d3b 100644 --- a/src/org/rascalmpl/library/lang/rascal/tests/concrete/ModulesWithStoredParsers.rsc +++ b/src/org/rascalmpl/library/lang/rascal/tests/concrete/ModulesWithStoredParsers.rsc @@ -29,7 +29,7 @@ PathConfig getTestPathConfig(loc root) { pcfg = getProjectPathConfig(root); pcfg.bin = root + "target/classes"; // remove std to avoid generating parsers for all modules in the library that contain syntax definitions - pcfg.srcs -= [|std:///|]; + pcfg.srcs -= [|project://rascal/src/org/rascalmpl/library/|]; return pcfg; } diff --git a/src/org/rascalmpl/library/lang/rascal/tests/concrete/recovery/ErrorRecoveryBenchmark.rsc b/src/org/rascalmpl/library/lang/rascal/tests/concrete/recovery/ErrorRecoveryBenchmark.rsc index e63564a78b6..b846431715e 100644 --- a/src/org/rascalmpl/library/lang/rascal/tests/concrete/recovery/ErrorRecoveryBenchmark.rsc +++ b/src/org/rascalmpl/library/lang/rascal/tests/concrete/recovery/ErrorRecoveryBenchmark.rsc @@ -23,15 +23,15 @@ void runTestJson() { testRecoveryJson(); } void runTestPico() { testRecoveryPico(); } void runTestRascal() { testRecoveryRascal(); } -FileStats testRecoveryC() = testErrorRecovery(|std:///lang/c90/syntax/C.rsc|, "TranslationUnit", |std:///lang/c90/examples/hello-world.c|); -FileStats testRecoveryDiff() = testErrorRecovery(|std:///lang/diff/unified/UnifiedDiff.rsc|, "DiffFile", |std:///lang/diff/unified/examples/example.diff|); -FileStats testRecoveryDot() = testErrorRecovery(|std:///lang/dot/syntax/Dot.rsc|, "DOT", |std:///lang/dot/examples/parser-state.dot|); -FileStats testRecoveryJava() = testErrorRecovery(|std:///lang/java/syntax/Java15.rsc|, "CompilationUnit", zippedFile("m3/snakes-and-ladders-project-source.zip", "src/snakes/LastSquare.java")); -FileStats testRecoveryJson() = testErrorRecovery(|std:///lang/json/syntax/JSON.rsc|, "JSONText", |std:///lang/json/examples/ex01.json|); -FileStats testRecoveryPico() = testErrorRecovery(|std:///lang/pico/syntax/Main.rsc|, "Program", |std:///lang/pico/examples/fac.pico|); -FileStats testRecoveryRascal() = testErrorRecovery(|std:///lang/rascal/syntax/Rascal.rsc|, "Module", |std:///lang/rascal/vis/ImportGraph.rsc|); +FileStats testRecoveryC() = testErrorRecovery(|project://rascal/src/org/rascalmpl/library/lang/c90/syntax/C.rsc|, "TranslationUnit", |project://rascal/src/org/rascalmpl/library/lang/c90/examples/hello-world.c|); +FileStats testRecoveryDiff() = testErrorRecovery(|project://rascal/src/org/rascalmpl/library/lang/diff/unified/UnifiedDiff.rsc|, "DiffFile", |project://rascal/src/org/rascalmpl/library/lang/diff/unified/examples/example.diff|); +FileStats testRecoveryDot() = testErrorRecovery(|project://rascal/src/org/rascalmpl/library/lang/dot/syntax/Dot.rsc|, "DOT", |project://rascal/src/org/rascalmpl/library/lang/dot/examples/parser-state.dot|); +FileStats testRecoveryJava() = testErrorRecovery(|project://rascal/src/org/rascalmpl/library/lang/java/syntax/Java15.rsc|, "CompilationUnit", zippedFile("m3/snakes-and-ladders-project-source.zip", "src/snakes/LastSquare.java")); +FileStats testRecoveryJson() = testErrorRecovery(|project://rascal/src/org/rascalmpl/library/lang/json/syntax/JSON.rsc|, "JSONText", |project://rascal/src/org/rascalmpl/library/lang/json/examples/ex01.json|); +FileStats testRecoveryPico() = testErrorRecovery(|project://rascal/src/org/rascalmpl/library/lang/pico/syntax/Main.rsc|, "Program", |project://rascal/src/org/rascalmpl/library/lang/pico/examples/fac.pico|); +FileStats testRecoveryRascal() = testErrorRecovery(|project://rascal/src/org/rascalmpl/library/lang/rascal/syntax/Rascal.rsc|, "Module", |project://rascal/src/org/rascalmpl/library/lang/rascal/vis/ImportGraph.rsc|); -FileStats testMemoBug() = testErrorRecovery(|std:///lang/rascal/syntax/Rascal.rsc|, "Module", |std:///lang/rascal/tests/concrete/PostParseFilter.rsc|); +FileStats testMemoBug() = testErrorRecovery(|project://rascal/src/org/rascalmpl/library/lang/rascal/syntax/Rascal.rsc|, "Module", |project://rascal/src/org/rascalmpl/library/lang/rascal/tests/concrete/PostParseFilter.rsc|); void runLanguageTests() { testRecoveryC(); @@ -50,5 +50,5 @@ int main(list[str] args) { return 0; } -int rascalSmokeTest() = main(["source-loc=|std:///|", "max-amb-depth=2", "max-files=3", "max-file-size=500", "sample-window=3", "random-seed=1", "count-nodes=true"]); -int rascalStandardTest() = main(["source-loc=|std:///|", "max-files=1000", "max-file-size=5120"]); \ No newline at end of file +int rascalSmokeTest() = main(["source-loc=|project://rascal/src/org/rascalmpl/library/|", "max-amb-depth=2", "max-files=3", "max-file-size=500", "sample-window=3", "random-seed=1", "count-nodes=true"]); +int rascalStandardTest() = main(["source-loc=|project://rascal/src/org/rascalmpl/library/|", "max-files=1000", "max-file-size=5120"]); \ No newline at end of file diff --git a/src/org/rascalmpl/library/lang/rascal/tests/concrete/recovery/ParseBenchmark.rsc b/src/org/rascalmpl/library/lang/rascal/tests/concrete/recovery/ParseBenchmark.rsc index 9795414b8d0..e7bb923bebe 100644 --- a/src/org/rascalmpl/library/lang/rascal/tests/concrete/recovery/ParseBenchmark.rsc +++ b/src/org/rascalmpl/library/lang/rascal/tests/concrete/recovery/ParseBenchmark.rsc @@ -22,7 +22,7 @@ import lang::rascal::\syntax::Rascal; import lang::rascal::grammar::definition::Modules; public data ParseBenchmarkConfig = parseBenchmarkConfig( - loc syntaxFile = |std:///lang/rascal/syntax/Rascal.rsc|, + loc syntaxFile = |project://rascal/src/org/rascalmpl/library/lang/rascal/syntax/Rascal.rsc|, str topSort = "Module", str extension = ".rsc", loc files = |unknown:///|, @@ -133,4 +133,4 @@ int main(list[str] args) { return 0; } -public int benchmarkRascal() = main(["files=|std:///|"]); +public int benchmarkRascal() = main(["files=|project://rascal/src/org/rascalmpl/library/|"]); diff --git a/src/org/rascalmpl/library/lang/rascal/tests/concrete/recovery/RecoveryTestSupport.rsc b/src/org/rascalmpl/library/lang/rascal/tests/concrete/recovery/RecoveryTestSupport.rsc index 1a001ccab5a..5923dbe1f62 100644 --- a/src/org/rascalmpl/library/lang/rascal/tests/concrete/recovery/RecoveryTestSupport.rsc +++ b/src/org/rascalmpl/library/lang/rascal/tests/concrete/recovery/RecoveryTestSupport.rsc @@ -716,7 +716,7 @@ RecoveryTestConfig createRecoveryTestConfig(list[str] args) { private RecoveryTestConfig createSyntaxConfig(str spec) { println("Determining test config based on syntax spec: "); switch (spec) { - case "rascal": return recoveryTestConfig(syntaxFile=|std:///lang/rascal/syntax/Rascal.rsc|, topSort="Module", ext=".rsc"); + case "rascal": return recoveryTestConfig(syntaxFile=|project://rascal/src/org/rascalmpl/library/lang/rascal/syntax/Rascal.rsc|, topSort="Module", ext=".rsc"); case "java18": return recoveryTestConfig(syntaxFile=|cwd:///src/lang/java/syntax/Java18.rsc|, topSort="CompilationUnit", ext=".java"); case "java15": return recoveryTestConfig(syntaxFile=|cwd:///src/lang/java/syntax/Java15.rsc|, topSort="CompilationUnit", ext=".java"); case "cobol": return recoveryTestConfig(syntaxModule="lang::vscobolii::Main", topSort="VSCobolII", ext=".CBL"); diff --git a/src/org/rascalmpl/library/lang/rascal/tests/concrete/recovery/bugs/DataTypeSlow.rsc b/src/org/rascalmpl/library/lang/rascal/tests/concrete/recovery/bugs/DataTypeSlow.rsc index b4e0e149937..5b1bf48a325 100644 --- a/src/org/rascalmpl/library/lang/rascal/tests/concrete/recovery/bugs/DataTypeSlow.rsc +++ b/src/org/rascalmpl/library/lang/rascal/tests/concrete/recovery/bugs/DataTypeSlow.rsc @@ -11,7 +11,7 @@ import util::Benchmark; bool testDataType() { normalParser = parser(#start[Module], allowRecovery=false); recoveryParser = parser(#start[Module], allowRecovery=true, maxAmbDepth=1000); - loc source = |std:///lang/rascal/tests/functionality/DataType.rsc?deletedUntilEol=253:8344:8395|; + loc source = |project://rascal/src/org/rascalmpl/library/lang/rascal/tests/functionality/DataType.rsc?deletedUntilEol=253:8344:8395|; str input = getTestInput(source); //println("input: "); diff --git a/src/org/rascalmpl/library/lang/rascal/tests/concrete/recovery/bugs/FCASlow.rsc b/src/org/rascalmpl/library/lang/rascal/tests/concrete/recovery/bugs/FCASlow.rsc index d5cbceabf09..497a22d834b 100644 --- a/src/org/rascalmpl/library/lang/rascal/tests/concrete/recovery/bugs/FCASlow.rsc +++ b/src/org/rascalmpl/library/lang/rascal/tests/concrete/recovery/bugs/FCASlow.rsc @@ -12,7 +12,7 @@ This tests the slowest error recovery in all tests < 10kb */ bool testFCA() { recoveryParser = parser(#start[Module], allowRecovery=true, allowAmbiguity=true, maxAmbDepth=1000); - loc source = |std:///analysis/formalconcepts/FCA.rsc?deletedUntilEol=54:2242:2261|; + loc source = |project://rascal/src/org/rascalmpl/library/analysis/formalconcepts/FCA.rsc?deletedUntilEol=54:2242:2261|; str input = getTestInput(source); //println("input: "); Tree result = recoveryParser(input, source); diff --git a/src/org/rascalmpl/library/lang/rascal/tests/concrete/recovery/bugs/FlowGraphOutOfMemoryBug.rsc b/src/org/rascalmpl/library/lang/rascal/tests/concrete/recovery/bugs/FlowGraphOutOfMemoryBug.rsc index 80814fd1472..af2543cea42 100644 --- a/src/org/rascalmpl/library/lang/rascal/tests/concrete/recovery/bugs/FlowGraphOutOfMemoryBug.rsc +++ b/src/org/rascalmpl/library/lang/rascal/tests/concrete/recovery/bugs/FlowGraphOutOfMemoryBug.rsc @@ -11,7 +11,7 @@ import String; test bool testFlowGraphBug() { standardParser = parser(#start[Module], allowRecovery=false, allowAmbiguity=true); recoveryParser = parser(#start[Module], allowRecovery=true, allowAmbiguity=true); - loc source = |std:///analysis/m3/FlowGraph.rsc|; + loc source = |project://rascal/src/org/rascalmpl/library/analysis/m3/FlowGraph.rsc|; input = readFile(source); // Resulted in extremely long runtime and eventually an out-of-memory exception testSingleCharDeletions(standardParser, recoveryParser, source, input, 200, 150, 100, 100, begin=387, end=387); diff --git a/src/org/rascalmpl/library/lang/rascal/tests/concrete/recovery/bugs/InfiniteLoopBug.rsc b/src/org/rascalmpl/library/lang/rascal/tests/concrete/recovery/bugs/InfiniteLoopBug.rsc index 450771c6491..90aaf279b93 100644 --- a/src/org/rascalmpl/library/lang/rascal/tests/concrete/recovery/bugs/InfiniteLoopBug.rsc +++ b/src/org/rascalmpl/library/lang/rascal/tests/concrete/recovery/bugs/InfiniteLoopBug.rsc @@ -18,7 +18,7 @@ import ParseTree; import IO; test bool testInfiniteLoop() { - str input = readFile(|std:///lang/rascal/tests/concrete/recovery/bugs/InfiniteLoopInput.txt|); + str input = readFile(|project://rascal/src/org/rascalmpl/library/lang/rascal/tests/concrete/recovery/bugs/InfiniteLoopInput.txt|); p = parser(#start[Module], allowRecovery=true, allowAmbiguity=true); println("starting parse"); p(input, |unknown:///?visualize=false|); diff --git a/src/org/rascalmpl/library/lang/rascal/tests/concrete/recovery/bugs/OvertakeBug.rsc b/src/org/rascalmpl/library/lang/rascal/tests/concrete/recovery/bugs/OvertakeBug.rsc index 4d9f6e4463d..2e583123fb2 100644 --- a/src/org/rascalmpl/library/lang/rascal/tests/concrete/recovery/bugs/OvertakeBug.rsc +++ b/src/org/rascalmpl/library/lang/rascal/tests/concrete/recovery/bugs/OvertakeBug.rsc @@ -17,7 +17,7 @@ import ParseTree; import IO; bool testOvertakeBug() { - str input = readFile(|std:///lang/rascal/tests/concrete/recovery/bugs/OvertakeBugInput.txt|); + str input = readFile(|project://rascal/src/org/rascalmpl/library/lang/rascal/tests/concrete/recovery/bugs/OvertakeBugInput.txt|); parser(#Module, allowRecovery=true, allowAmbiguity=true)(input, |unknown:///?visualize=false|); // If the parse completes without crashing, the test succeeds return true; diff --git a/src/org/rascalmpl/library/lang/rascal/tests/concrete/recovery/bugs/OvertakenNullableBug.rsc b/src/org/rascalmpl/library/lang/rascal/tests/concrete/recovery/bugs/OvertakenNullableBug.rsc index 340aa6f4690..1b89f63d4ce 100644 --- a/src/org/rascalmpl/library/lang/rascal/tests/concrete/recovery/bugs/OvertakenNullableBug.rsc +++ b/src/org/rascalmpl/library/lang/rascal/tests/concrete/recovery/bugs/OvertakenNullableBug.rsc @@ -22,7 +22,7 @@ import IO; test bool testOvertakeNullableBug() { standardParser = parser(#start[Module], allowRecovery=false, allowAmbiguity=true); recoveryParser = parser(#start[Module], allowRecovery=true, allowAmbiguity=true); - loc source = |std:///lang/rascal/tests/library/analysis/statistics/DescriptiveTests.rsc|; + loc source = |project://rascal/src/org/rascalmpl/library/lang/rascal/tests/library/analysis/statistics/DescriptiveTests.rsc|; input = readFile(source); testDeleteUntilEol(standardParser, recoveryParser, source, input, 200, 100, 100, 100, begin=561, end=561); diff --git a/src/org/rascalmpl/library/lang/rascal/tests/concrete/recovery/bugs/Patterns3Slow.rsc b/src/org/rascalmpl/library/lang/rascal/tests/concrete/recovery/bugs/Patterns3Slow.rsc index 88db0738738..9ec7b42fff3 100644 --- a/src/org/rascalmpl/library/lang/rascal/tests/concrete/recovery/bugs/Patterns3Slow.rsc +++ b/src/org/rascalmpl/library/lang/rascal/tests/concrete/recovery/bugs/Patterns3Slow.rsc @@ -13,7 +13,7 @@ import IO; This tests the slowest error recovery in all tests < 10kb */ bool testPatterns3() { - loc source = |std:///lang/rascal/tests/concrete/Patterns3.rsc?deletedUntilEol=85:2133:2136|; + loc source = |project://rascal/src/org/rascalmpl/library/lang/rascal/tests/concrete/Patterns3.rsc?deletedUntilEol=85:2133:2136|; str input = getTestInput(source); recoveryParser = parser(#start[Module], allowRecovery=true, allowAmbiguity=true, maxRecoveryAttempts=50, maxRecoveryTokens=30); diff --git a/src/org/rascalmpl/library/lang/rascal/tests/concrete/recovery/bugs/PreferAvoidSlow.rsc b/src/org/rascalmpl/library/lang/rascal/tests/concrete/recovery/bugs/PreferAvoidSlow.rsc index 52a794da0b0..0c29e9a9dc8 100644 --- a/src/org/rascalmpl/library/lang/rascal/tests/concrete/recovery/bugs/PreferAvoidSlow.rsc +++ b/src/org/rascalmpl/library/lang/rascal/tests/concrete/recovery/bugs/PreferAvoidSlow.rsc @@ -9,7 +9,7 @@ import IO; bool testPreferAvoid() { recoveryParser = parser(#start[Module], allowRecovery=true, allowAmbiguity=true, maxAmbDepth=1000); - loc source = |std:///lang/sdf2/filters/PreferAvoid.rsc?deletedUntilEol=8:208:271|; + loc source = |project://rascal/src/org/rascalmpl/library/lang/sdf2/filters/PreferAvoid.rsc?deletedUntilEol=8:208:271|; str input = getTestInput(source); println("input: "); Tree result = recoveryParser(input, source); diff --git a/src/org/rascalmpl/library/lang/rascal/tests/library/analysis/formalconcepts/FCATest.rsc b/src/org/rascalmpl/library/lang/rascal/tests/library/analysis/formalconcepts/FCATest.rsc index 8045ac7e812..21ab8e0d46d 100644 --- a/src/org/rascalmpl/library/lang/rascal/tests/library/analysis/formalconcepts/FCATest.rsc +++ b/src/org/rascalmpl/library/lang/rascal/tests/library/analysis/formalconcepts/FCATest.rsc @@ -71,7 +71,7 @@ bool checkNoUnRelatedConcepts(rel[&TObject, &TAttribute] input) { } test bool fcaHasExpectedOutput() { - result = fca(readCxt(|std:///lang/rascal/tests/library/analysis/formalconcepts/FCxt1.cxt|)); - reference = readBinaryValueFile(#ConceptLattice[str,str], |std:///lang/rascal/tests/library/analysis/formalconcepts/FCxt1.fca|); + result = fca(readCxt(|project://rascal/src/org/rascalmpl/library/lang/rascal/tests/library/analysis/formalconcepts/FCxt1.cxt|)); + reference = readBinaryValueFile(#ConceptLattice[str,str], |project://rascal/src/org/rascalmpl/library/lang/rascal/tests/library/analysis/formalconcepts/FCxt1.fca|); return result == reference; } diff --git a/src/org/rascalmpl/library/lang/rascal/tests/library/lang/html/IOTests.rsc b/src/org/rascalmpl/library/lang/rascal/tests/library/lang/html/IOTests.rsc index b4e5d5aacf2..f027212072e 100644 --- a/src/org/rascalmpl/library/lang/rascal/tests/library/lang/html/IOTests.rsc +++ b/src/org/rascalmpl/library/lang/rascal/tests/library/lang/html/IOTests.rsc @@ -3,7 +3,7 @@ module lang::rascal::tests::library::lang::html::IOTests import lang::html::IO; import IO; -private loc exampleHTML = |std:///lang/html/examples/example.html|; +private loc exampleHTML = |project://rascal/src/org/rascalmpl/library/lang/html/examples/example.html|; test bool simpleParseTest() = html(_) := readHTMLFile(exampleHTML); diff --git a/src/org/rascalmpl/library/lang/rascal/tests/library/lang/json/JSONIOTests.rsc b/src/org/rascalmpl/library/lang/rascal/tests/library/lang/json/JSONIOTests.rsc index 350a355e7fc..87ff97f4ec3 100644 --- a/src/org/rascalmpl/library/lang/rascal/tests/library/lang/json/JSONIOTests.rsc +++ b/src/org/rascalmpl/library/lang/rascal/tests/library/lang/json/JSONIOTests.rsc @@ -110,7 +110,7 @@ bool originTest(loc example) { } test bool originTracking() { - files = [ l | loc l <- |std:///lang/rascal/tests/library/lang/json|.ls, l.extension == "json"]; + files = [ l | loc l <- |project://rascal/src/org/rascalmpl/library/lang/rascal/tests/library/lang/json|.ls, l.extension == "json"]; return (true | it && originTest(example) | loc example <- files); } @@ -185,7 +185,7 @@ value toDefaultValue(real r) = r - round(r) == 0 default value toDefaultValue(value x) = x; test bool accurateParseErrors() { - ex = readFile(|std:///lang/rascal/tests/library/lang/json/glossary.json|); + ex = readFile(|project://rascal/src/org/rascalmpl/library/lang/rascal/tests/library/lang/json/glossary.json|); broken = ex[..size(ex)/2] + ex[size(ex)/2+10..]; try { diff --git a/src/org/rascalmpl/library/lang/rascal/tests/library/lang/xml/XMLIOTests.rsc b/src/org/rascalmpl/library/lang/rascal/tests/library/lang/xml/XMLIOTests.rsc index 5513ca7018b..4b11082074c 100644 --- a/src/org/rascalmpl/library/lang/rascal/tests/library/lang/xml/XMLIOTests.rsc +++ b/src/org/rascalmpl/library/lang/rascal/tests/library/lang/xml/XMLIOTests.rsc @@ -73,12 +73,12 @@ test bool namespacesMultiple() test bool originTrackingElements() { - loc l = |std:///lang/rascal/tests/library/lang/xml/glossary.xml|; + loc l = |project://rascal/src/org/rascalmpl/library/lang/rascal/tests/library/lang/xml/glossary.xml|; return originTracking(readXML(l, trackOrigins=true), readFile(l)); } test bool originTrackingElementsWithEndTags() { - loc l = |std:///lang/rascal/tests/library/lang/xml/glossary.xml|; + loc l = |project://rascal/src/org/rascalmpl/library/lang/rascal/tests/library/lang/xml/glossary.xml|; return originTracking(readXML(l, trackOrigins=true, includeEndTags=true), readFile(l)); } @@ -100,8 +100,8 @@ private bool originTracking(node example, str content) { } test bool streamingAPI() { - loc l = |std:///lang/rascal/tests/library/lang/xml/glossary.xml|; - next = streamXML(|std:///lang/rascal/tests/library/lang/xml/glossary.xml|, "GlossEntry"); + loc l = |project://rascal/src/org/rascalmpl/library/lang/rascal/tests/library/lang/xml/glossary.xml|; + next = streamXML(|project://rascal/src/org/rascalmpl/library/lang/rascal/tests/library/lang/xml/glossary.xml|, "GlossEntry"); return just(node _) := next() && nothing() := next(); } \ No newline at end of file diff --git a/src/org/rascalmpl/library/vis/Graphs.rsc b/src/org/rascalmpl/library/vis/Graphs.rsc index d499153b4d7..a072b3fa9ff 100644 --- a/src/org/rascalmpl/library/vis/Graphs.rsc +++ b/src/org/rascalmpl/library/vis/Graphs.rsc @@ -202,7 +202,7 @@ Providing locations as node identities automatically transforms them to node lin ```rascal-shell import vis::Graphs; import IO; -d = [<|std:///|, e> | e <- |std:///|.ls]; +d = [<|project://rascal/src/org/rascalmpl/library/|, e> | e <- |project://rascal/src/org/rascalmpl/library/|.ls]; d += [ | <_, e> <- d, isDirectory(e), f <- e.ls]; graph(d, \layout=defaultDagreLayout()); // here we adapt the node labeler to show only the last file name in the path of the location: diff --git a/src/org/rascalmpl/tutor/lang/rascal/tutor/examples/Test/Libraries/Boolean/Boolean.remote b/src/org/rascalmpl/tutor/lang/rascal/tutor/examples/Test/Libraries/Boolean/Boolean.remote index 8816436b0ab..d685dbf9389 100644 --- a/src/org/rascalmpl/tutor/lang/rascal/tutor/examples/Test/Libraries/Boolean/Boolean.remote +++ b/src/org/rascalmpl/tutor/lang/rascal/tutor/examples/Test/Libraries/Boolean/Boolean.remote @@ -1 +1 @@ -|std:///Boolean.rsc| \ No newline at end of file +|project://rascal/src/org/rascalmpl/library/Boolean.rsc| \ No newline at end of file diff --git a/test/org/rascalmpl/benchmark/Visiting/ProdVersusType.rsc b/test/org/rascalmpl/benchmark/Visiting/ProdVersusType.rsc index f31bed20fb4..c2c7f12e2db 100644 --- a/test/org/rascalmpl/benchmark/Visiting/ProdVersusType.rsc +++ b/test/org/rascalmpl/benchmark/Visiting/ProdVersusType.rsc @@ -66,7 +66,7 @@ int ProdMatch(Tree tr) { } } value main(){ - m = parseModuleWithSpaces(|std:///List.rsc|); + m = parseModuleWithSpaces(|project://rascal/src/org/rascalmpl/library/List.rsc|); warmup(m); println("ProdMatch:"); a = ProdMatch(m); From ee58f72b0ca8793610b50933f39e2ac80c3b4e9d Mon Sep 17 00:00:00 2001 From: Toine Hartman Date: Fri, 17 Jul 2026 11:40:52 +0200 Subject: [PATCH 08/26] Disable resolver for `std:///`. Closes #2822. Co-authored-by: Rodin Aarssen --- .../uri/StandardLibraryURIResolver.java | 38 ++----------------- 1 file changed, 3 insertions(+), 35 deletions(-) diff --git a/src/org/rascalmpl/uri/StandardLibraryURIResolver.java b/src/org/rascalmpl/uri/StandardLibraryURIResolver.java index 565a19b11b2..37383bfc134 100644 --- a/src/org/rascalmpl/uri/StandardLibraryURIResolver.java +++ b/src/org/rascalmpl/uri/StandardLibraryURIResolver.java @@ -2,49 +2,17 @@ import java.io.IOException; -import org.rascalmpl.library.util.PathConfig; -import org.rascalmpl.uri.jar.JarURIResolver; import io.usethesource.vallang.ISourceLocation; /** - * Provides transparant access to the source code of the one and only standard library - * that should be on the source path of the interpreter, which is contained in the same - * jar as the current interpreter is from. - * - * The std:/// scheme is mainly used by the interpreter, to load library modules; but it is also the location - * of distributed sources of the standard library for use in the debugger. The references - * that the type-checker produces for UI feature in the IDE also depend on this scheme. - * - * This is accomplished by: - * 1. rewriting all the references to the source locations of the library in - * project://rascal/src/org/rascalmpl/library/...` to `std:///...`. This is done by the "packager" - * 2. copying all the .rsc files of the library to the jar in the right location (mvn resources plugin) - * 3. resolving std:/// to the same location inside of the jar - * 4. **not** having more than one standard library in the classpath of the JVM, or more than one - * standard library in the libs path of a PathConfig. + * Used to provide transparant access to the source code of the one and only standard library, + * but is now defunct. One should use a direct URI, like `mvn://`, `project://`, `jar+file://`, etc. */ public class StandardLibraryURIResolver implements ILogicalSourceLocationResolver { - private static final ISourceLocation currentRascalLibrary = - URIUtil.getChildLocation( - JarURIResolver.jarify( - resolveCurrentRascalJar() - ), - "org/rascalmpl/library" - ); - - private static ISourceLocation resolveCurrentRascalJar() { - try { - return PathConfig.resolveCurrentRascalRuntime(); - } - catch (IOException e) { - // this will be reported elsewhere in PathConfig.messages - - return URIUtil.unknownLocation(); - } - } @Override public ISourceLocation resolve(ISourceLocation input) throws IOException { - return URIUtil.getChildLocation(currentRascalLibrary, input.getPath()); + throw new IOException("std:/// scheme does not exist anymore; use a physical URI instead"); } @Override From 64173b4af831611b746389f281aa741e07911bbf Mon Sep 17 00:00:00 2001 From: Toine Hartman Date: Wed, 15 Jul 2026 10:32:53 +0200 Subject: [PATCH 09/26] Package stdlib locations as `mvn://` This removes `std://` locations in the published Rascal JARs, in favor of `mvn://` pointing to this specific released version. Closes #2820. Closes #2820. --- pom.xml | 1 - test/org/rascalmpl/util/maven/poms/rascal/pom.xml | 1 - 2 files changed, 2 deletions(-) diff --git a/pom.xml b/pom.xml index af4336d8e52..c5a3d6e58d5 100644 --- a/pom.xml +++ b/pom.xml @@ -201,7 +201,6 @@ ${project.basedir}/src/org/rascalmpl/library - |std:///| diff --git a/test/org/rascalmpl/util/maven/poms/rascal/pom.xml b/test/org/rascalmpl/util/maven/poms/rascal/pom.xml index dd223a9232e..476de5a4266 100644 --- a/test/org/rascalmpl/util/maven/poms/rascal/pom.xml +++ b/test/org/rascalmpl/util/maven/poms/rascal/pom.xml @@ -141,7 +141,6 @@ ${project.basedir}/src/org/rascalmpl/compiler --> - |std:///| ${project.basedir}/FUNDING ${project.basedir}/CITATION.md |https://github.com/usethesource/rascal/issues| From 1e324e326d097d6468c502c245200b7e575bc1a0 Mon Sep 17 00:00:00 2001 From: Toine Hartman Date: Fri, 17 Jul 2026 14:07:46 +0200 Subject: [PATCH 10/26] Replace another std loc with project. --- src/org/rascalmpl/library/lang/rascal/grammar/tests/Compare.rsc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/org/rascalmpl/library/lang/rascal/grammar/tests/Compare.rsc b/src/org/rascalmpl/library/lang/rascal/grammar/tests/Compare.rsc index 4911aba671b..5f5faa31146 100644 --- a/src/org/rascalmpl/library/lang/rascal/grammar/tests/Compare.rsc +++ b/src/org/rascalmpl/library/lang/rascal/grammar/tests/Compare.rsc @@ -9,7 +9,7 @@ value main() = compare3(); value compare1() { INT = split("\n", readFile(|project://rascal/src/org/rascalmpl/library/lang/rascal/grammar/tests/generated_parsers/CParserINT.java|)); - COMP = split("\n", readFile(|std://lang/rascal/grammar/tests/generated_parsers/CParserCOMP.java|)); + COMP = split("\n", readFile(|project://rascal/src/org/rascalmpl/library/lang/rascal/grammar/tests/generated_parsers/CParserCOMP.java|)); INTSET = toSet(INT); COMPSET = toSet(COMP); From f208de3c7c38cbcedee94926d40fb46bdf15f8e4 Mon Sep 17 00:00:00 2001 From: Rodin Aarssen Date: Fri, 17 Jul 2026 17:00:14 +0200 Subject: [PATCH 11/26] [maven-release-plugin] prepare release v0.43.0-RC9-PREVIEW1 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index c5a3d6e58d5..81ee4e08e93 100644 --- a/pom.xml +++ b/pom.xml @@ -3,12 +3,12 @@ org.rascalmpl rascal - 0.43.0-RC9-SNAPSHOT + 0.43.0-RC9-PREVIEW1 jar scm:git:ssh://git@github.com/usethesource/rascal.git - v0.43.0-RC2-SNAPSHOT + v0.43.0-RC9-PREVIEW1 From acde947a51634a0c5098c6a4f9dfedc7630fb7c3 Mon Sep 17 00:00:00 2001 From: Rodin Aarssen Date: Sat, 18 Jul 2026 13:30:31 +0200 Subject: [PATCH 12/26] Set version to next snapshot --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 81ee4e08e93..c958dcf4c21 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ org.rascalmpl rascal - 0.43.0-RC9-PREVIEW1 + 0.43.0-RC9-PREVIEW2-SNAPSHOT jar From 939f22b981af60fa8634ff4b63c936947c90d4ed Mon Sep 17 00:00:00 2001 From: Toine Hartman Date: Mon, 20 Jul 2026 13:55:19 +0200 Subject: [PATCH 13/26] Jarify/mavenize as much as possible. --- src/org/rascalmpl/library/util/PathConfig.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/org/rascalmpl/library/util/PathConfig.java b/src/org/rascalmpl/library/util/PathConfig.java index 25910ee439e..c7f0440b68c 100644 --- a/src/org/rascalmpl/library/util/PathConfig.java +++ b/src/org/rascalmpl/library/util/PathConfig.java @@ -369,7 +369,7 @@ public static ISourceLocation resolveProjectOnClasspath(String projectName) thro } public static ISourceLocation resolveCurrentRascalRuntime() throws IOException { - return resolveProjectOnClasspath("rascal"); + return MavenRepositoryURIResolver.mavenize(resolveProjectOnClasspath("rascal")); } public static ISourceLocation resolveCurrentStandardLibrary() throws IOException { @@ -570,11 +570,12 @@ private static void buildNormalProjectConfig(ISourceLocation manifestRoot, Rasca .findFirst() .map(Artifact::getResolved) .map(Path::toUri) - .map(vf::sourceLocation); + .map(vf::sourceLocation) + .map(MavenRepositoryURIResolver::mavenize); if (rascalFromPom.isPresent()) { // Explicit Rascal dependency in the pom.xml - libs.append(rascalFromPom.get()); + libs.append(rascalFromPom.get()); } else { // Fall back to current runtime Rascal and warn the user var runtimeRascal = JarURIResolver.jarify(resolveCurrentRascalRuntime()); From 6a8b4b2a22b818646f1ecaabc90befd0ba4b6e1b Mon Sep 17 00:00:00 2001 From: Toine Hartman Date: Wed, 22 Jul 2026 13:02:08 +0200 Subject: [PATCH 14/26] [maven-release-plugin] prepare release v0.43.0-RC9-PREVIEW2 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index c958dcf4c21..a67c1fe7ca1 100644 --- a/pom.xml +++ b/pom.xml @@ -3,12 +3,12 @@ org.rascalmpl rascal - 0.43.0-RC9-PREVIEW2-SNAPSHOT + 0.43.0-RC9-PREVIEW2 jar scm:git:ssh://git@github.com/usethesource/rascal.git - v0.43.0-RC9-PREVIEW1 + v0.43.0-RC9-PREVIEW2 From acbe56dc3487c23247cda56710a9a08341444e3e Mon Sep 17 00:00:00 2001 From: Toine Hartman Date: Wed, 22 Jul 2026 15:35:51 +0200 Subject: [PATCH 15/26] Set version to next snapshot. --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a67c1fe7ca1..694b521d6c8 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ org.rascalmpl rascal - 0.43.0-RC9-PREVIEW2 + 0.43.0-RC9-PREVIEW3-SNAPSHOT jar From 29690e01282175271fcd78e62a82b354a6fb0a11 Mon Sep 17 00:00:00 2001 From: Toine Hartman Date: Thu, 23 Jul 2026 14:38:16 +0200 Subject: [PATCH 16/26] Also type-check against stdlib from POM. --- .../rascalmpl/library/util/PathConfig.java | 45 +++++++++---------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/src/org/rascalmpl/library/util/PathConfig.java b/src/org/rascalmpl/library/util/PathConfig.java index c7f0440b68c..51c387e6fd5 100644 --- a/src/org/rascalmpl/library/util/PathConfig.java +++ b/src/org/rascalmpl/library/util/PathConfig.java @@ -558,30 +558,29 @@ public static boolean isRascalArtifact(Artifact art) { private static void buildNormalProjectConfig(ISourceLocation manifestRoot, RascalConfigMode mode, List mavenClasspath, boolean isRoot, IListWriter srcs, IListWriter libs, IListWriter messages) throws IOException, URISyntaxException { if (isRoot) { - if (mode == RascalConfigMode.INTERPRETER) { - srcs.append(URIUtil.getChildLocation(JarURIResolver.jarify(resolveCurrentRascalRuntime()), "org/rascalmpl/library")); - libs.append(resolveCurrentRascalRuntime()); // add our own jar to the lib path to make sure rascal classes are found + ISourceLocation rascal; + var rascalFromPom = mavenClasspath.stream() + .filter(PathConfig::isRascalArtifact) + .findFirst() + .map(Artifact::getResolved) + .map(Path::toUri) + .map(vf::sourceLocation) + .map(MavenRepositoryURIResolver::mavenize) + .map(JarURIResolver::jarify); + + if (rascalFromPom.isPresent()) { + // Explicit Rascal dependency in the pom.xml + rascal = rascalFromPom.get(); + } else { + // Fall back to current runtime Rascal and warn the user + rascal = JarURIResolver.jarify(resolveCurrentRascalRuntime()); + messages.append(Messages.warning(String.format("No Rascal dependency found in pom.xml. Using %s instead.", rascal), manifestRoot)); } - else { - assert mode == RascalConfigMode.COMPILER: "should be compiler"; - - var rascalFromPom = mavenClasspath.stream() - .filter(PathConfig::isRascalArtifact) - .findFirst() - .map(Artifact::getResolved) - .map(Path::toUri) - .map(vf::sourceLocation) - .map(MavenRepositoryURIResolver::mavenize); - - if (rascalFromPom.isPresent()) { - // Explicit Rascal dependency in the pom.xml - libs.append(rascalFromPom.get()); - } else { - // Fall back to current runtime Rascal and warn the user - var runtimeRascal = JarURIResolver.jarify(resolveCurrentRascalRuntime()); - messages.append(Messages.warning(String.format("No Rascal dependency found in pom.xml. Using %s instead.", runtimeRascal), manifestRoot)); - libs.append(runtimeRascal); - } + + libs.append(rascal); + if (mode == RascalConfigMode.INTERPRETER) { + // The compiler does not need sources, but the interpreter does. + srcs.append(URIUtil.getChildLocation(rascal, "org/rascalmpl/library")); } } From 9775112e739b03fb292f01d5303d50031e267322 Mon Sep 17 00:00:00 2001 From: Toine Hartman Date: Thu, 23 Jul 2026 15:11:46 +0200 Subject: [PATCH 17/26] Get keywords from auto-complete from stdlib. Instead of from the grammar. --- .../repl/completers/RascalQualifiedNames.java | 82 +++++-------------- 1 file changed, 21 insertions(+), 61 deletions(-) diff --git a/src/org/rascalmpl/repl/completers/RascalQualifiedNames.java b/src/org/rascalmpl/repl/completers/RascalQualifiedNames.java index 314b52afd25..9db44582810 100644 --- a/src/org/rascalmpl/repl/completers/RascalQualifiedNames.java +++ b/src/org/rascalmpl/repl/completers/RascalQualifiedNames.java @@ -26,17 +26,19 @@ */ package org.rascalmpl.repl.completers; -import java.io.IOException; +import java.io.PrintWriter; import java.io.Reader; -import java.net.URISyntaxException; +import java.io.Writer; import java.util.HashSet; import java.util.Set; -import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; -import org.rascalmpl.uri.URIResolverRegistry; -import org.rascalmpl.values.ValueFactoryFactory; +import org.rascalmpl.debug.NullRascalMonitor; +import org.rascalmpl.shell.ShellEvaluatorFactory; + +import io.usethesource.vallang.ISet; +import io.usethesource.vallang.IString; /** * Make sure we generate escapes before rascal keywords, such that `lang::rascal::syntax` becomes `lang::rascal::\syntax` @@ -62,66 +64,24 @@ public static String unescape(String term) { private static final Set RASCAL_KEYWORDS = new HashSet(); - private static void assureKeywordsAreScrapped() { - // TODO: replace this with the `util::Reflective::getRascalReservedIdentifiers` - // BUT! it doesn't contain all the keywords, it's missing the `BasicType` ones like `int` etc + private static void assureKeywordsAreLoaded() { if (RASCAL_KEYWORDS.isEmpty()) { synchronized (RASCAL_KEYWORDS) { if (!RASCAL_KEYWORDS.isEmpty()) { return; } - String rascalGrammar = ""; - URIResolverRegistry reg = URIResolverRegistry.getInstance(); - try (Reader grammarReader = reg.getCharacterReader(ValueFactoryFactory.getValueFactory().sourceLocation("std", "", "/lang/rascal/syntax/Rascal.rsc"))) { - StringBuilder res = new StringBuilder(); - char[] chunk = new char[8 * 1024]; - int read; - while ((read = grammarReader.read(chunk, 0, chunk.length)) != -1) { - res.append(chunk, 0, read); - } - rascalGrammar = res.toString(); - } - catch (IOException | URISyntaxException e) { - e.printStackTrace(); - } - if (!rascalGrammar.isEmpty()) { - /* - * keyword RascalKeywords - * = "o" - * | "syntax" - * | "keyword" - * | "lexical" - * ... - * ; - */ - Pattern findKeywordSection = Pattern.compile("^\\s*keyword([^=]|\\s)*=(?([^;]|\\s)*);", Pattern.MULTILINE); - Matcher m = findKeywordSection.matcher(rascalGrammar); - if (m.find()) { - String keywords = "|" + m.group("keywords"); - Pattern keywordEntry = Pattern.compile("\\s*[|]\\s*[\"](?[^\"]*)[\"]"); - m = keywordEntry.matcher(keywords); - while (m.find()) { - RASCAL_KEYWORDS.add(m.group("keyword")); - } - } - /* - * syntax BasicType - = \value: "value" - | \loc: "loc" - | \node: "node" - */ - Pattern findBasicTypeSection = Pattern.compile("^\\s*syntax\\s*BasicType([^=]|\\s)*=(?([^;]|\\s)*);", Pattern.MULTILINE); - m = findBasicTypeSection.matcher(rascalGrammar); - if (m.find()) { - String keywords = "|" + m.group("keywords"); - Pattern keywordEntry = Pattern.compile("\\s*[|][^:]*:\\s*[\"](?[^\"]*)[\"]"); - m = keywordEntry.matcher(keywords); - while (m.find()) { - RASCAL_KEYWORDS.add(m.group("keyword")); - } - } - } + var monitor = new NullRascalMonitor(); + var eval = ShellEvaluatorFactory.getBasicEvaluator(Reader.nullReader(), new PrintWriter(Writer.nullWriter()), new PrintWriter(Writer.nullWriter()), monitor); + eval.doImport(monitor, "util::Reflective"); + + ((ISet) eval.call("getRascalReservedIdentifiers")) + .stream() + .filter(IString.class::isInstance) + .map(IString.class::cast) + .map(IString::getValue) + .forEach(RASCAL_KEYWORDS::add); + if (RASCAL_KEYWORDS.isEmpty()) { RASCAL_KEYWORDS.add("syntax"); } @@ -130,7 +90,7 @@ private static void assureKeywordsAreScrapped() { } private static String escapeKeyword(String s) { - assureKeywordsAreScrapped(); + assureKeywordsAreLoaded(); if (RASCAL_KEYWORDS.contains(s.trim())) { return "\\" + s; } @@ -143,5 +103,5 @@ private static String unescapeKeyword(String s) { } return s; } - + } From f800bfecd572d9cbd10c09de7945e2fc3a45451c Mon Sep 17 00:00:00 2001 From: Toine Hartman Date: Mon, 27 Jul 2026 13:51:19 +0200 Subject: [PATCH 18/26] Properly unsupport std scheme. --- .../uri/StandardLibraryURIResolver.java | 28 ------------------- src/org/rascalmpl/uri/resolvers.config | 2 +- .../StandardLibraryURIResolver.java | 13 +++++++++ 3 files changed, 14 insertions(+), 29 deletions(-) delete mode 100644 src/org/rascalmpl/uri/StandardLibraryURIResolver.java create mode 100644 src/org/rascalmpl/uri/unsupported/StandardLibraryURIResolver.java diff --git a/src/org/rascalmpl/uri/StandardLibraryURIResolver.java b/src/org/rascalmpl/uri/StandardLibraryURIResolver.java deleted file mode 100644 index 37383bfc134..00000000000 --- a/src/org/rascalmpl/uri/StandardLibraryURIResolver.java +++ /dev/null @@ -1,28 +0,0 @@ -package org.rascalmpl.uri; - -import java.io.IOException; - -import io.usethesource.vallang.ISourceLocation; - -/** - * Used to provide transparant access to the source code of the one and only standard library, - * but is now defunct. One should use a direct URI, like `mvn://`, `project://`, `jar+file://`, etc. - */ -public class StandardLibraryURIResolver implements ILogicalSourceLocationResolver { - - @Override - public ISourceLocation resolve(ISourceLocation input) throws IOException { - throw new IOException("std:/// scheme does not exist anymore; use a physical URI instead"); - } - - @Override - public String scheme() { - return "std"; - } - - @Override - public String authority() { - return ""; - } - -} diff --git a/src/org/rascalmpl/uri/resolvers.config b/src/org/rascalmpl/uri/resolvers.config index c25d506cf23..cb365c536cd 100644 --- a/src/org/rascalmpl/uri/resolvers.config +++ b/src/org/rascalmpl/uri/resolvers.config @@ -3,7 +3,6 @@ org.rascalmpl.uri.file.TempURIResolver org.rascalmpl.uri.CompressedStreamResolver org.rascalmpl.uri.remote.HttpsURIResolver org.rascalmpl.uri.remote.HttpURIResolver -org.rascalmpl.uri.StandardLibraryURIResolver org.rascalmpl.uri.classloaders.SystemClassloaderResolver org.rascalmpl.uri.jar.JarURIResolver org.rascalmpl.uri.zip.ZipURIResolver @@ -16,4 +15,5 @@ org.rascalmpl.uri.file.SystemPathURIResolver org.rascalmpl.uri.libraries.MemoryResolver org.rascalmpl.uri.unsupported.UnknownURIResolver org.rascalmpl.uri.unsupported.LibraryURIResolver +org.rascalmpl.uri.unsupported.StandardLibraryURIResolver diff --git a/src/org/rascalmpl/uri/unsupported/StandardLibraryURIResolver.java b/src/org/rascalmpl/uri/unsupported/StandardLibraryURIResolver.java new file mode 100644 index 00000000000..b3bbf82d03c --- /dev/null +++ b/src/org/rascalmpl/uri/unsupported/StandardLibraryURIResolver.java @@ -0,0 +1,13 @@ +package org.rascalmpl.uri.unsupported; + +/** + * Used to provide transparant access to the source code of the one and only standard library, + * but is now defunct. One should use a direct URI, like `mvn://`, `project://`, `jar+file://`, etc. + */ +public class StandardLibraryURIResolver extends UnsupportedURIResolver { + + public StandardLibraryURIResolver() { + super("std", "The std scheme has been removed; please rewrite to mvn scheme, jar+file or similar."); + } + +} From eed2384487b806cfa16e836cade27b7165270973 Mon Sep 17 00:00:00 2001 From: Toine Hartman Date: Mon, 27 Jul 2026 15:43:59 +0200 Subject: [PATCH 19/26] Fix search path order. --- .../load/IRascalSearchPathContributor.java | 4 ++-- .../rascalmpl/interpreter/load/RascalSearchPath.java | 12 ++++++++---- .../load/SourceLocationListContributor.java | 6 +++--- .../rascalmpl/interpreter/load/URIContributor.java | 6 +++--- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/org/rascalmpl/interpreter/load/IRascalSearchPathContributor.java b/src/org/rascalmpl/interpreter/load/IRascalSearchPathContributor.java index 95d26ee9253..1b3de4ef51d 100644 --- a/src/org/rascalmpl/interpreter/load/IRascalSearchPathContributor.java +++ b/src/org/rascalmpl/interpreter/load/IRascalSearchPathContributor.java @@ -11,11 +11,11 @@ *******************************************************************************/ package org.rascalmpl.interpreter.load; -import java.util.List; +import java.util.Queue; import io.usethesource.vallang.ISourceLocation; public interface IRascalSearchPathContributor { - void contributePaths(List path); + void contributePaths(Queue path); String getName(); } diff --git a/src/org/rascalmpl/interpreter/load/RascalSearchPath.java b/src/org/rascalmpl/interpreter/load/RascalSearchPath.java index 36efd08a475..c4da4a79ddb 100644 --- a/src/org/rascalmpl/interpreter/load/RascalSearchPath.java +++ b/src/org/rascalmpl/interpreter/load/RascalSearchPath.java @@ -17,13 +17,16 @@ import java.io.IOException; import java.net.URISyntaxException; import java.util.ArrayList; +import java.util.Collection; import java.util.Collections; import java.util.LinkedList; import java.util.List; +import java.util.Queue; import org.rascalmpl.interpreter.Configuration; import org.rascalmpl.uri.URIResolverRegistry; import org.rascalmpl.uri.URIUtil; + import io.usethesource.vallang.ISourceLocation; /** @@ -41,7 +44,8 @@ public RascalSearchPath() { } public void addPathContributor(IRascalSearchPathContributor contrib) { - if(!contributors.contains(contrib)){ + if (!contributors.contains(contrib)) { + // Later contributors take precedence over earlier ones. Insert at the front. contributors.add(0, contrib); } } @@ -103,12 +107,12 @@ public ISourceLocation getRootForModule(String module) { } } - public List collect() { - List paths = new LinkedList(); + public Collection collect() { + Queue paths = new LinkedList(); for (IRascalSearchPathContributor c : contributors) { c.contributePaths(paths); } - + return paths; } diff --git a/src/org/rascalmpl/interpreter/load/SourceLocationListContributor.java b/src/org/rascalmpl/interpreter/load/SourceLocationListContributor.java index 2702eb399a3..66e2214d066 100644 --- a/src/org/rascalmpl/interpreter/load/SourceLocationListContributor.java +++ b/src/org/rascalmpl/interpreter/load/SourceLocationListContributor.java @@ -1,6 +1,6 @@ package org.rascalmpl.interpreter.load; -import java.util.List; +import java.util.Queue; import io.usethesource.vallang.IList; import io.usethesource.vallang.ISourceLocation; @@ -18,9 +18,9 @@ public SourceLocationListContributor(String label, IList sourceLocations) { } @Override - public void contributePaths(List path) { + public void contributePaths(Queue path) { for (IValue elem : locs) { - path.add(((ISourceLocation) elem)); + path.add((ISourceLocation) elem); } } diff --git a/src/org/rascalmpl/interpreter/load/URIContributor.java b/src/org/rascalmpl/interpreter/load/URIContributor.java index 48c82279dce..d1b740cf1c9 100644 --- a/src/org/rascalmpl/interpreter/load/URIContributor.java +++ b/src/org/rascalmpl/interpreter/load/URIContributor.java @@ -12,7 +12,7 @@ *******************************************************************************/ package org.rascalmpl.interpreter.load; -import java.util.List; +import java.util.Queue; import io.usethesource.vallang.ISourceLocation; @@ -30,8 +30,8 @@ public String getName() { } @Override - public void contributePaths(List path) { - path.add(0, uri); + public void contributePaths(Queue path) { + path.add(uri); } @Override From 6d181800ddf6b714306af201995a437e42375ec4 Mon Sep 17 00:00:00 2001 From: Toine Hartman Date: Tue, 28 Jul 2026 18:09:51 +0200 Subject: [PATCH 20/26] Expose Maven parsing and resolution for use in Rascal LSP. Co-authored-by: rodinaarssen --- .../uri/file/MavenRepositoryURIResolver.java | 111 ++++++++++-------- .../util/maven/ArtifactCoordinate.java | 2 +- 2 files changed, 61 insertions(+), 52 deletions(-) diff --git a/src/org/rascalmpl/uri/file/MavenRepositoryURIResolver.java b/src/org/rascalmpl/uri/file/MavenRepositoryURIResolver.java index 6fd8a1e2330..1c8dd09426d 100644 --- a/src/org/rascalmpl/uri/file/MavenRepositoryURIResolver.java +++ b/src/org/rascalmpl/uri/file/MavenRepositoryURIResolver.java @@ -16,6 +16,7 @@ import org.rascalmpl.uri.URIUtil; import org.rascalmpl.uri.classloaders.IClassloaderLocationResolver; import org.rascalmpl.uri.jar.JarURIResolver; +import org.rascalmpl.util.maven.ArtifactCoordinate; import org.rascalmpl.util.maven.MavenSettings; import io.usethesource.vallang.ISourceLocation; @@ -23,109 +24,117 @@ /** * Finds jar files (and what's inside) relative to the root of the LOCAL Maven repository. * For a discussion om REMOTE repositories see below. - * + * * We use `mvn://----/` as the scheme; - * + * * So the authority encodes the identity of the maven project and the path encodes * what's inside the respective jar file. This is analogous to other schemes for projects * and deployed projects such as project://, target://, plugin://, bundle:// and bundleresource://: * the authority identifies the container, and the path identifies what is inside. - * + * * Here `version` is an arbitrary string with lots of numbers, dots, dashed and underscores. * Typically we'd expect the semantic versioning scheme here with some release tag, but * real maven projects frequently do not adhere to that standard. Hence we have to be "free" * here and allow lots of funny version strings. This is also why we use -- to separate * the version from the artifactId. - * - * Locations with the `mvn` scheme are typically produced by configuration code that uses + * + * Locations with the `mvn` scheme are typically produced by configuration code that uses * a Maven pom.xml to resolve dependencies. Once the group id, name and version are known, any * `mvn:///` location is easily constructed and used. It can be seen as a transparent * short-hand for an absolute `file:///` location that points into the (deeply nested) * .m2 local repository. The prime benefits are: * 1. much shorter location than `file:///` * 2. full referential transparency, more so than `lib:///` - * 3. unique identification, modulo the (configured) location of the local repository. - * + * 3. unique identification, modulo the (configured) location of the local repository. + * * This resolver does NOT find the "latest" version or any version of a package without an explicit * version reference in the authority pattern, by design. Any automated resolution here would - * make the dependency management downstream less transparant and possibly error-prone. - * The `mvn://` locations are intended to be the _result_ of dependency resolution, not + * make the dependency management downstream less transparant and possibly error-prone. + * The `mvn://` locations are intended to be the _result_ of dependency resolution, not * to implement dependency resolution. - * + * * This resolver also does not implement any download or installation procedure, by design. * It does not access any REMOTE repositories although it easily could be implemented. * This scheme should simply reflect what _has been downloaded and installed_ into the LOCAL maven * repository. This is for the sake of transparancy and predictability, but also for _legal_ reasons: - * Any automated implicit downloading by the `mvn://` scheme could easily result in late/lazy downloading - * and linking by end-users who have not been able to diligently vet the legal implications of the + * Any automated implicit downloading by the `mvn://` scheme could easily result in late/lazy downloading + * and linking by end-users who have not been able to diligently vet the legal implications of the * reuse of another library. Therefore this scheme DOES NOT DOWNLOAD stuff, ever. - * + * * PLEASE DO NOT EVER ADD AUTOMATIC DOWNLOADING OR ACCESS TO REMOTE REPOSITORIES TO THIS SCHEME, * however easy or practical this may seem. - * Download, installation, linking, bundling, making fat jars, etc. must all be scrutinized by the due + * Download, installation, linking, bundling, making fat jars, etc. must all be scrutinized by the due * diligence legal processes for open-source dependencies. Those who take responsibility - * for dependencies on open-source packages, with for example GPL licenses, must have the + * for dependencies on open-source packages, with for example GPL licenses, must have the * opportunity to scrutinize every instance of incorporating such as dependency. Therefore * it must not be automated here. Note that these are not necessarily people from the usethesource or - * Rascal-contributing organizations; but our industrial, educational and academic users + * Rascal-contributing organizations; but our industrial, educational and academic users * (Rascal language engineers) that we protect here. - * + * * This resolver is to replace for the large part the use of the deprecate `lib` scheme - * from {@see RascalLibraryURIResolver} which left too much implicit and automated too - * much to obtain any transparancy in dependency resolution. - * + * from {@see RascalLibraryURIResolver} which left too much implicit and automated too + * much to obtain any transparancy in dependency resolution. + * */ public class MavenRepositoryURIResolver implements ISourceLocationInput, IClassloaderLocationResolver { private static final String GROUP_ARTIFACT_VERSION_SEPARATOR = "--"; private final ISourceLocation root = inferMavenRepositoryLocation(); private final URIResolverRegistry reg; - - public MavenRepositoryURIResolver(URIResolverRegistry reg) throws IOException, URISyntaxException { + + public MavenRepositoryURIResolver(URIResolverRegistry reg) throws URISyntaxException { this.reg = reg; } private static ISourceLocation inferMavenRepositoryLocation() throws URISyntaxException { return URIUtil.createFileLocation(MavenSettings.mavenRepository()); } - - /** - * @param input mvn://groupid--artifactId--version/path - * @return a file:/// reference to the jar file that is designated by the authority. - * @throws IOException when the authority does not designate a jar file - */ - private ISourceLocation resolveJar(ISourceLocation input) throws IOException { + + public static ArtifactCoordinate getCoordinates(ISourceLocation input) throws IOException { String authority = input.getAuthority(); if (authority.isEmpty()) { throw new IOException("missing mvn://groupid--artifactId--version/ as the authority in " + input); } + if (!"mvn".equals(input.getScheme())) { + throw new IllegalArgumentException("Cannot resolve non-Maven location"); + } + var parts = authority.split(GROUP_ARTIFACT_VERSION_SEPARATOR); - if (parts.length == 3) { - String group = parts[0]; - String name = parts[1]; - String version = parts[2]; - - String jarPath - = group.replaceAll("\\.", "/") - + "/" - + name - + "/" - + version - + "/" - + name - + "-" - + version - + ".jar" - ; - - // find the right jar file in the .m2 folder - return URIUtil.getChildLocation(root, jarPath); - } - else { + if (parts.length != 3) { throw new IOException("Pattern mvn://groupId--artifactId--version did not match on " + input); } + + return new ArtifactCoordinate(parts[0], parts[1], parts[2], null); + } + + /** + * @param input mvn://groupid--artifactId--version/path + * @return a file:/// reference to the jar file that is designated by the authority. + * @throws IOException when the authority does not designate a jar file + */ + public ISourceLocation resolveJar(ISourceLocation input) throws IOException { + var coordinates = getCoordinates(input); + var group = coordinates.getGroupId(); + var name = coordinates.getArtifactId(); + var version = coordinates.getVersion(); + + String jarPath + = group.replaceAll("\\.", "/") + + "/" + + name + + "/" + + version + + "/" + + name + + "-" + + version + + ".jar" + ; + + // find the right jar file in the .m2 folder + return URIUtil.getChildLocation(root, jarPath); } private ISourceLocation resolveInsideJar(ISourceLocation input) throws IOException { diff --git a/src/org/rascalmpl/util/maven/ArtifactCoordinate.java b/src/org/rascalmpl/util/maven/ArtifactCoordinate.java index b201e2d6384..e512780d555 100644 --- a/src/org/rascalmpl/util/maven/ArtifactCoordinate.java +++ b/src/org/rascalmpl/util/maven/ArtifactCoordinate.java @@ -40,7 +40,7 @@ public class ArtifactCoordinate { private final String version; private final String classifier; - ArtifactCoordinate(String groupId, String artifactId, String version, @Nullable String classifier) { + public ArtifactCoordinate(String groupId, String artifactId, String version, @Nullable String classifier) { Objects.requireNonNull(groupId); Objects.requireNonNull(artifactId); Objects.requireNonNull(version); From 6dd7221d49cb4935749aaae7d2af1d65b572f4ac Mon Sep 17 00:00:00 2001 From: Rodin Aarssen Date: Wed, 29 Jul 2026 09:14:44 +0200 Subject: [PATCH 21/26] [maven-release-plugin] prepare release v0.43.0-RC9-PREVIEW3 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 694b521d6c8..0bba928de5c 100644 --- a/pom.xml +++ b/pom.xml @@ -3,12 +3,12 @@ org.rascalmpl rascal - 0.43.0-RC9-PREVIEW3-SNAPSHOT + 0.43.0-RC9-PREVIEW3 jar scm:git:ssh://git@github.com/usethesource/rascal.git - v0.43.0-RC9-PREVIEW2 + v0.43.0-RC9-PREVIEW3 From ce822eca8052590e9c703204de11af19f609521e Mon Sep 17 00:00:00 2001 From: Rodin Aarssen Date: Wed, 29 Jul 2026 09:19:25 +0200 Subject: [PATCH 22/26] Set to next snapshot version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0bba928de5c..b33891c1a7c 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ org.rascalmpl rascal - 0.43.0-RC9-PREVIEW3 + 0.43.0-RC9-PREVIEW4-SNAPSHOT jar From 78e4c11a0e59ee8de31983827cf972dcd821e82c Mon Sep 17 00:00:00 2001 From: Toine Hartman Date: Thu, 30 Jul 2026 15:49:49 +0200 Subject: [PATCH 23/26] Fix broken path config constructor. --- src/org/rascalmpl/library/util/PathConfig.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/org/rascalmpl/library/util/PathConfig.java b/src/org/rascalmpl/library/util/PathConfig.java index 51c387e6fd5..f8d748b31d1 100644 --- a/src/org/rascalmpl/library/util/PathConfig.java +++ b/src/org/rascalmpl/library/util/PathConfig.java @@ -131,7 +131,7 @@ private PathConfig(ISourceLocation projectRoot, List srcs, List this.srcs = srcs; this.ignores = ignores; this.bin = bin; - this.libs = ignores; + this.libs = libs; this.resources = resources; this.messages = messages; } From 0cd347dfbaa49330091e45565a1fc1dc843b86e9 Mon Sep 17 00:00:00 2001 From: Toine Hartman Date: Thu, 30 Jul 2026 16:11:00 +0200 Subject: [PATCH 24/26] Annotate nullability of source location response. --- .../uri/remote/jsonrpc/SourceLocationResponse.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/org/rascalmpl/uri/remote/jsonrpc/SourceLocationResponse.java b/src/org/rascalmpl/uri/remote/jsonrpc/SourceLocationResponse.java index a4a509965d1..a78170f4b29 100644 --- a/src/org/rascalmpl/uri/remote/jsonrpc/SourceLocationResponse.java +++ b/src/org/rascalmpl/uri/remote/jsonrpc/SourceLocationResponse.java @@ -28,16 +28,18 @@ import java.util.Objects; +import org.checkerframework.checker.nullness.qual.Nullable; + import io.usethesource.vallang.ISourceLocation; public class SourceLocationResponse { - private final ISourceLocation loc; + private final @Nullable ISourceLocation loc; - public SourceLocationResponse(ISourceLocation loc) { + public SourceLocationResponse(@Nullable ISourceLocation loc) { this.loc = loc; } - public ISourceLocation getLocation() { + public @Nullable ISourceLocation getLocation() { return loc; } From 78df980e17c6462c285d6c92e9ff68bda7ec2011 Mon Sep 17 00:00:00 2001 From: Toine Hartman Date: Thu, 30 Jul 2026 16:26:43 +0200 Subject: [PATCH 25/26] [maven-release-plugin] prepare release v0.43.0-RC9-PREVIEW4 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index b33891c1a7c..7f5b4fdba0b 100644 --- a/pom.xml +++ b/pom.xml @@ -3,12 +3,12 @@ org.rascalmpl rascal - 0.43.0-RC9-PREVIEW4-SNAPSHOT + 0.43.0-RC9-PREVIEW4 jar scm:git:ssh://git@github.com/usethesource/rascal.git - v0.43.0-RC9-PREVIEW3 + v0.43.0-RC9-PREVIEW4 From ba81e03bbc1c3cc160c6763ce23906a25d8b4334 Mon Sep 17 00:00:00 2001 From: Toine Hartman Date: Thu, 30 Jul 2026 16:28:08 +0200 Subject: [PATCH 26/26] Set to next snapshot version. --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7f5b4fdba0b..758eb21a936 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ org.rascalmpl rascal - 0.43.0-RC9-PREVIEW4 + 0.43.0-RC9-PREVIEW5-SNAPSHOT jar