Skip to content

Commit

Permalink
- fix #2112
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@15979 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
lochel committed May 3, 2013
1 parent ffb8b2c commit 02778d9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions Compiler/FrontEnd/DAE.mo
Original file line number Diff line number Diff line change
Expand Up @@ -577,10 +577,11 @@ end ClassAttributes;

/* TODO: create a backend and a simcode uniontype */
public
uniontype Statement "There are four kinds of statements. Assignments (`a := b;\'),
if statements (`if A then B; elseif C; else D;\'), for loops
(`for i in 1:10 loop ...; end for;\') and when statements
(`when E do S; end when;\')."
uniontype Statement "There are four kinds of statements:
1. assignments ('a := b;')
2. if statements ('if A then B; elseif C; else D;')
3. for loops ('for i in 1:10 loop ...; end for;')
4. when statements ('when E do S; end when;')"
record STMT_ASSIGN
Type type_;
Exp exp1;
Expand Down
4 changes: 2 additions & 2 deletions Compiler/Template/CodegenC.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -5655,6 +5655,7 @@ template indexedAssign(DAE.Type ty, String exp, DAE.ComponentRef cr,
else
let tmp = tempDecl("real_array", &varDecls)
<<
alloc_<%type%>(&<%tmp%>, 1, size_of_dimension_<%type%>(<%exp%>, 1));
indexed_assign_<%type%>(&<%exp%>, &<%tmp%>, &<%ispec%>);
copy_<%type%>_data_mem(&<%tmp%>, &<%cref%>);
>>
Expand Down Expand Up @@ -8247,8 +8248,7 @@ end outDecl;
template tempDecl(String ty, Text &varDecls /*BUFP*/)
"Declares a temporary variable in varDecls and returns the name."
::=
let newVar
=
let newVar =
match ty /* TODO! FIXME! UGLY! UGLY! hack! */
case "modelica_metatype"
case "metamodelica_string"
Expand Down

0 comments on commit 02778d9

Please sign in to comment.