Skip to content

Commit 02778d9

Browse files
committed
- fix #2112
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@15979 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
1 parent ffb8b2c commit 02778d9

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

Compiler/FrontEnd/DAE.mo

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -577,10 +577,11 @@ end ClassAttributes;
577577

578578
/* TODO: create a backend and a simcode uniontype */
579579
public
580-
uniontype Statement "There are four kinds of statements. Assignments (`a := b;\'),
581-
if statements (`if A then B; elseif C; else D;\'), for loops
582-
(`for i in 1:10 loop ...; end for;\') and when statements
583-
(`when E do S; end when;\')."
580+
uniontype Statement "There are four kinds of statements:
581+
1. assignments ('a := b;')
582+
2. if statements ('if A then B; elseif C; else D;')
583+
3. for loops ('for i in 1:10 loop ...; end for;')
584+
4. when statements ('when E do S; end when;')"
584585
record STMT_ASSIGN
585586
Type type_;
586587
Exp exp1;

Compiler/Template/CodegenC.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5655,6 +5655,7 @@ template indexedAssign(DAE.Type ty, String exp, DAE.ComponentRef cr,
56555655
else
56565656
let tmp = tempDecl("real_array", &varDecls)
56575657
<<
5658+
alloc_<%type%>(&<%tmp%>, 1, size_of_dimension_<%type%>(<%exp%>, 1));
56585659
indexed_assign_<%type%>(&<%exp%>, &<%tmp%>, &<%ispec%>);
56595660
copy_<%type%>_data_mem(&<%tmp%>, &<%cref%>);
56605661
>>
@@ -8247,8 +8248,7 @@ end outDecl;
82478248
template tempDecl(String ty, Text &varDecls /*BUFP*/)
82488249
"Declares a temporary variable in varDecls and returns the name."
82498250
::=
8250-
let newVar
8251-
=
8251+
let newVar =
82528252
match ty /* TODO! FIXME! UGLY! UGLY! hack! */
82538253
case "modelica_metatype"
82548254
case "metamodelica_string"

0 commit comments

Comments
 (0)