Skip to content

Commit

Permalink
- Fixed redeclaration modifiers for arrays, i.e. 'each redeclare'.
Browse files Browse the repository at this point in the history
- Implemented SCode dumping of defineunit.
- Updated test suite.


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@10211 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
perost committed Oct 25, 2011
1 parent 173b790 commit 1c62053
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Compiler/FrontEnd/Mod.mo
Expand Up @@ -1616,7 +1616,7 @@ algorithm
Integer idx;

case (DAE.NOMOD(),_) then DAE.NOMOD(); /* indx */
case (DAE.REDECL(finalPrefix = _),_) then DAE.NOMOD();
case (DAE.REDECL(finalPrefix = _),_) then inMod;
case (DAE.MOD(finalPrefix = f,eachPrefix = SCode.NOT_EACH(),subModLst = subs,eqModOption = eq),idx)
equation
(_,subs_1) = lookupIdxModification2(subs,idx);
Expand Down
2 changes: 1 addition & 1 deletion Compiler/FrontEnd/Types.mo
Expand Up @@ -3554,7 +3554,7 @@ algorithm
case ((DAE.T_NOTYPE(), _)) then etOther;
case ((DAE.T_ANYTYPE(_), _)) then etOther;

case ((DAE.T_COMPLEX(complexVarLst={},complexTypeOption=SOME(t)),_)) then elabType(t);
case ((DAE.T_COMPLEX(complexTypeOption=SOME(t)),_)) then elabType(t);

// see if we have it in memory
case (inType as (tt, _))
Expand Down
11 changes: 10 additions & 1 deletion Compiler/susan_codegen/SimCode/SCodeDumpTpl.tpl
Expand Up @@ -258,7 +258,16 @@ match component
end dumpComponent;

template dumpDefineUnit(SCode.Element defineUnit)
::= errorMsg("SCodeDump.dumpDefineUnit not implemented.")
::=
match defineUnit
case DEFINEUNIT(__) then
let vis_str = dumpVisibility(visibility)
let exp_str = match exp case SOME(e) then 'exp = "<%e%>"'
let weight_str = match weight case SOME(w) then 'weight = <%w%>'
let args_str = {exp_str, weight_str} ;separator=", "
let pb = if args_str then '('
let pe = if args_str then ')'
'defineunit <%name%><%pb%><%args_str%><%pe%>'
end dumpDefineUnit;

template dumpEnumLiteral(SCode.Enum enum)
Expand Down

0 comments on commit 1c62053

Please sign in to comment.