Skip to content

Commit

Permalink
* miner updates for pretty printing of modifers
Browse files Browse the repository at this point in the history
* removal of dead code

git-svn-id: https://openmodelica.org/svn/OpenModelica/branches/MathCoreOSMC@4153 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Björn Zachrisson committed Aug 7, 2009
1 parent 8ceeaeb commit d413222
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 27 deletions.
28 changes: 2 additions & 26 deletions Compiler/Inst.mo
Expand Up @@ -397,6 +397,7 @@ algorithm
case (cache,cdecls,path) /* error instantiating */
equation
cname_str = Absyn.pathString(path);
//print(" Error flattening partial, errors: " +& ErrorExt.printMessagesStr() +& "\n");
Error.addMessage(Error.ERROR_FLATTENING, {cname_str});
then
fail();
Expand Down Expand Up @@ -9029,32 +9030,7 @@ algorithm
EQ_IF. When the condition is constant evaluate it and
select the correct branch */

case (cache,env,mod,pre,csets,ci_state,SCode.EQ_IF(condition = conditions,thenBranch = tb,elseBranch = fb),SCode.NON_INITIAL(),impl,graph)
equation
true = OptManager.getOption("cevalEquation"); // BoschRexroth specifics
(cache, expl1,props,_) = Static.elabExpList(cache,env, conditions, impl, NONE,true);
(Types.PROP((Types.T_BOOL(_),_),_)) = Types.propsAnd(props);
(cache,valList) = Ceval.cevalList(cache,env, expl1, impl, NONE, Ceval.NO_MSG());
blist = Util.listMap(valList,Values.valueBool);
b = selectList(blist, tb, fb);
(cache,dae,env_1,csets_1,ci_state_1,graph) = instList(cache,env, mod, pre, csets, ci_state, instEEquation, b, impl, graph);
then
(cache,dae,env_1,csets_1,ci_state_1,graph);

/* initial EQ_IF. When the condition is constant evaluate it and
select the correct branch */
case (cache,env,mod,pre,csets,ci_state,SCode.EQ_IF(condition = conditions,thenBranch = tb,elseBranch = fb),SCode.INITIAL(),impl,graph)
equation
true = OptManager.getOption("cevalEquation"); // BoschRexroth specifics
(cache, expl1,props,_) = Static.elabExpList(cache,env, conditions, impl, NONE,true);
(Types.PROP((Types.T_BOOL(_),_),_)) = Types.propsAnd(props);
(cache,valList) = Ceval.cevalList(cache,env, expl1, impl, NONE, Ceval.NO_MSG());
blist = Util.listMap(valList,Values.valueBool);
b = selectList(blist, tb, fb);
(cache,dae,env_1,csets_1,ci_state_1,graph) = instList(cache,env, mod, pre, csets, ci_state, instEInitialequation, b, impl,graph);
then
(cache,dae,env_1,csets_1,ci_state_1,graph);


/* IF_EQUATION */
case (cache,env,mod,pre,csets,ci_state,SCode.EQ_IF(condition = conditions,thenBranch = tb,elseBranch = fb),SCode.NON_INITIAL(),impl,graph)
equation
Expand Down
9 changes: 8 additions & 1 deletion Compiler/Mod.mo
Expand Up @@ -1921,9 +1921,16 @@ algorithm str := matchcontinue(inSubs,depth)
Types.Mod m;
list<Integer> li;
case({},_) then "";
case((s as Types.NAMEMOD(id,m))::inSubs,depth)
case((s as Types.NAMEMOD(id,(m as Types.REDECL(finalPrefix=_))))::inSubs,depth)
equation
//s1 = prettyPrintSubs(inSubs);
//s2 = prettyPrintMod(m,depth+1);
//s2 = Util.if_(stringLength(s2) == 0, ""," = " +& s2);
s2 = " redeclare(" +& id +& "), class or component " +& id;
then
s2;
case((s as Types.NAMEMOD(id,m))::inSubs,depth)
equation
s2 = prettyPrintMod(m,depth+1);
s2 = Util.if_(stringLength(s2) == 0, ""," = " +& s2);
s2 = "(" +& id +& s2 +& "), class or component " +& id;
Expand Down

0 comments on commit d413222

Please sign in to comment.