Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Commit 59e73d1

Browse files
committed
More robustness
1 parent 076781b commit 59e73d1

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/org/rascalmpl/core/library/lang/rascalcore/check/ADTandGrammar.rsc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,10 @@ tuple[TModel, ModuleStatus] addGrammar(str qualifiedModuleName, set[str] imports
148148
} else {
149149
<found, tm1, ms> = getTModelForModule(m, ms);
150150
if(!found) {
151-
throw "addGrammar: tmodel for <m> not found";
151+
msg = error("Cannot add grammar, tmodel for <m> not found", ms.moduleLocs[qualifiedModuleName] ? |unknown:///|);
152+
ms.messages[qualifiedModuleName] ? {} += { msg };
153+
tm1 = tmodel(modelName=qualifiedModuleName, messages=[msg]);
154+
return <tm1, ms>;
152155
}
153156
}
154157
facts = tm1.facts;

src/org/rascalmpl/core/library/lang/rascalcore/check/ATypeUtils.rsc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ set[Production] aprods2prods(set[AType] alts) = {aprod2prod(p) | p <- alts/*, ac
258258
Production aprod2prod(aprod(AProduction prod)) = aprod2prod(prod);
259259
260260
default Production aprod2prod(AType t) {
261-
throw "internal error: do not know how to translate a <t> to a production rule?!";
261+
throw rascalCheckerInternalError("Do not know how to translate a <t> to a production rule");
262262
}
263263
264264
Production aprod2prod(p:AProduction::prod(AType lhs, list[AType] atypes, attributes=set[AAttr] as))

0 commit comments

Comments
 (0)