Skip to content

Commit caab11c

Browse files
committed
Serialize algorithm sections with a single assignment differently
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@25008 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
1 parent 9cd11c8 commit caab11c

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

Compiler/SimCode/SerializeModelInfo.mo

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,26 @@ algorithm
524524
serializeList(file,eq.beqs,serializeExp);
525525
File.write(file,"]}]}");
526526
then true;
527+
case SimCode.SES_ALGORITHM(statements={stmt as DAE.STMT_ASSIGN()})
528+
equation
529+
File.write(file, "\n{\"eqIndex\":");
530+
File.write(file, intString(eq.index));
531+
if parent <> 0 then
532+
File.write(file, ",\"parent\":");
533+
File.write(file, intString(parent));
534+
end if;
535+
File.write(file, ",\"section\":\"");
536+
File.write(file, section);
537+
File.write(file, "\",\"tag\":\"algorithm\",\"defines\":[\"");
538+
File.writeEscape(file,crefStr(Expression.expCref(stmt.exp1)),escape=File.Escape.JSON);
539+
File.write(file, "\"],\"uses\":[");
540+
serializeUses(file,Expression.extractUniqueCrefsFromExp(stmt.exp));
541+
File.write(file, "],\"equation\":[");
542+
serializeList(file,eq.statements,serializeStatement);
543+
File.write(file, "],\"source\":");
544+
serializeSource(file,Algorithm.getStatementSource(stmt),withOperations);
545+
File.write(file, "}");
546+
then true;
527547
case SimCode.SES_ALGORITHM(statements=stmt::_)
528548
equation
529549
File.write(file, "\n{\"eqIndex\":");

0 commit comments

Comments
 (0)