Skip to content

Commit

Permalink
- Added an error rollback when calling elabCall. In interactive mode …
Browse files Browse the repository at this point in the history
…some functions are elaborated by StaticScript.elabCall but the error messages are kept.

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@15847 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Leonardo Laguna committed Apr 17, 2013
1 parent e32e10a commit 0946a13
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Compiler/FrontEnd/Static.mo
Expand Up @@ -6462,13 +6462,15 @@ algorithm
/* Interactive mode */
case (cache,env,fn,args,nargs,(impl as true),st,pre,_,_)
equation
ErrorExt.setCheckpoint("elabCall_InteractiveFunction"); // Added because StaticScript.elabCallInteractive may succed and there are error messages left
false = hasBuiltInHandler(fn);
Debug.fprintln(Flags.SEI, "elab_call 3");
fn_1 = Absyn.crefToPath(fn);
(cache,e,prop) = elabCallArgs(cache,env, fn_1, args, nargs, impl, st,pre,info);
Debug.fprint(Flags.SEI, "elab_call 3 succeeded: ");
fnstr = Dump.printComponentRefStr(fn);
Debug.fprintln(Flags.SEI, fnstr);
ErrorExt.delCheckpoint("elabCall_InteractiveFunction");
then
(cache,e,prop,st);

Expand Down Expand Up @@ -6500,11 +6502,13 @@ algorithm
Debug.fprint(Flags.FAILTRACE, " prefix: ");
prestr = PrefixUtil.printPrefixStr(pre);
Debug.fprintln(Flags.FAILTRACE, prestr);
ErrorExt.delCheckpoint("elabCall_InteractiveFunction");
then
fail();
case (cache,env,fn,args,nargs,impl,st as SOME(_),pre,_,_) /* impl LS: Check if a builtin function call, e.g. size() and calculate if so */
equation
(cache,e,prop,st) = StaticScript.elabCallInteractive(cache,env, fn, args, nargs, impl,st,pre,info) "Elaborate interactive function calls, such as simulate(), plot() etc." ;
ErrorExt.rollBack("elabCall_InteractiveFunction");
then
(cache,e,prop,st);
end matchcontinue;
Expand Down

0 comments on commit 0946a13

Please sign in to comment.