@@ -165,7 +165,7 @@ list[&T <: node ] unsetRec(list[&T <: node] args) = [unsetRec(a) | a <- args];
165165
166166bool isManualLayout (AProduction p ) = (p has attributes && atag ("manual" ()) in p .attributes );
167167
168- tuple [TModel , ModuleStatus ] addGrammar (MODID moduleId , set [MODID ] imports , set [MODID ] extends , map [MODID ,TModel ] transient_tms , ModuleStatus ms ){
168+ tuple [bool , TModel , ModuleStatus ] addGrammar (MODID moduleId , set [MODID ] imports , set [MODID ] extends , map [MODID ,TModel ] transient_tms , ModuleStatus ms ){
169169 try {
170170 rel [AType ,AProduction ] definedProductions = {};
171171 allStarts = {};
@@ -177,10 +177,11 @@ tuple[TModel, ModuleStatus] addGrammar(MODID moduleId, set[MODID] imports, set[M
177177 } else {
178178 <found , tm1 , ms > = getTModelForModule(m, ms);
179179 if(!found) {
180- msg = error("Cannot add grammar, tmodel for <m > not found", ms.moduleLocs[moduleId] ? |unknown:/ //|);
180+ msg = error("Cannot add grammar or tmodel since `<moduleId2moduleName (m )> ` is not found", ms.moduleLocs[moduleId] ? |unknown:/ //|);
181+ //println(msg); // TODO: Just to record this event; this should probably go to a log file
181182 ms .messages [moduleId ] ? {} += { msg };
182183 tm1 = tmodel (modelName =qualifiedModuleName , messages =[msg ]);
183- return <tm1 , ms > ;
184+ return <false , tm1 , ms > ;
184185 }
185186 }
186187 facts = tm1.facts;
@@ -317,10 +318,10 @@ tuple[TModel, ModuleStatus] addGrammar(MODID moduleId, set[MODID] imports, set[M
317318 tm = tmlayouts (tm , definedLayout , allManualLayouts );
318319 //println("ADTandGrammar:"); iprintln(g, lineLimit=10000);
319320 tm .store [key_grammar ] = [g ];
320- return <tm , ms > ;
321+ return <true , tm , ms > ;
321322 } catch TypeUnavailable(): {
322323 // protect against undefined entities in the grammar that have not yet been reported.
323- return <tmodel (), ms > ;
324+ return <false , tmodel (), ms > ;
324325 }
325326}
326327
0 commit comments