From 6aee41c623b84780810a7a63a33fd5af2c1bd786 Mon Sep 17 00:00:00 2001 From: paulklint Date: Fri, 20 Sep 2024 12:57:56 +0200 Subject: [PATCH] getModuleParseTree: did we really find a source file, otherwise fail --- .../core/library/lang/rascalcore/check/CheckerCommon.rsc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/org/rascalmpl/core/library/lang/rascalcore/check/CheckerCommon.rsc b/src/org/rascalmpl/core/library/lang/rascalcore/check/CheckerCommon.rsc index b3a0181a..2e5fbe46 100644 --- a/src/org/rascalmpl/core/library/lang/rascalcore/check/CheckerCommon.rsc +++ b/src/org/rascalmpl/core/library/lang/rascalcore/check/CheckerCommon.rsc @@ -137,7 +137,9 @@ tuple[bool, Module, ModuleStatus] getModuleParseTree(str qualifiedModuleName, Mo ms.parseTreeLIFO = [qualifiedModuleName, *ms.parseTreeLIFO]; mloc = |unknown:///|; try { - mloc = getModuleLocation(qualifiedModuleName, pcfg); + mloc = getModuleLocation(qualifiedModuleName, pcfg); + // Make sure we found a real source module (as opposed to a tpl module in a library + if(mloc.extension != "rsc") throw ""; } catch _: { //ms.messages[qualifiedModuleName] ? [] = [error("Module not found", mloc)]; //ms.status[qualifiedModuleName] += {not_found()};