Skip to content

Commit

Permalink
- Make it an error if we fail to fully load a library (if a within-st…
Browse files Browse the repository at this point in the history
…atement is fault for example)

  - This was previously printed to stdout and silently ignored


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@10873 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Jan 10, 2012
1 parent f54383b commit 48b5d59
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
16 changes: 6 additions & 10 deletions Compiler/Script/Interactive.mo
Expand Up @@ -9311,12 +9311,7 @@ algorithm
newp_1 = updateProgram(Absyn.PROGRAM(c2,w,ts1), newp);
then
newp_1;
// failing
case (a,b)
equation
Print.printBuf("Further program merging not implemented yet\n");
then
b;

end matchcontinue;
end updateProgram;

Expand Down Expand Up @@ -16143,8 +16138,9 @@ algorithm
Absyn.Class c2,c3,c1;
Absyn.Program pnew,p;
Absyn.Within w;
String n1,s1,name;
String n1,s1,s2,name;
Absyn.TimeStamp ts;
list<Absyn.Path> paths;

case (c1,(w as Absyn.WITHIN(path = Absyn.QUALIFIED(name = n1))),p as Absyn.PROGRAM(globalBuildTimes=ts))
equation
Expand All @@ -16162,10 +16158,10 @@ algorithm
pnew;
case ((c1 as Absyn.CLASS(name = name)),w,p)
equation
print("Error inserting class: " +& name +& " within: (");
s1 = Dump.unparseWithin(0, w);
print(s1 +& ") program: \n");
print(Dump.unparseStr(p, false));
(_,paths) = getClassNamesRecursive(NONE(), p, {});
s2 = stringAppendList(List.map1r(List.map(paths,Absyn.pathString),stringAppend,"\n "));
Error.addMessage(Error.INSERT_CLASS, {name,s1,s2});
then
fail();
end matchcontinue;
Expand Down
2 changes: 2 additions & 0 deletions Compiler/Util/Error.mo
Expand Up @@ -568,6 +568,8 @@ public constant Message SUBSCRIPTED_MODIFIER = MESSAGE(211, TRANSLATION(), ERROR
"Subscripted modifier is illegal.");
public constant Message TRANS_VIOLATION = MESSAGE(212, TRANSLATION(), ERROR(),
"Restriction violation: %s is a %s, which may not contain an %s.");
public constant Message INSERT_CLASS = MESSAGE(213, SCRIPTING(), ERROR(),
"Failed to insert class %s %s the available classes were:%s");
public constant Message UNBOUND_PARAMETER_WARNING = MESSAGE(500, TRANSLATION(), WARNING(),
"Parameter %s has neither value nor start value, and is fixed during initialization (fixed=true)");
public constant Message BUILTIN_FUNCTION_SUM_HAS_SCALAR_PARAMETER = MESSAGE(501, TRANSLATION(), WARNING(),
Expand Down

0 comments on commit 48b5d59

Please sign in to comment.