Skip to content

Commit

Permalink
avoid nested comments and quintuple printout of ExpressionDump
Browse files Browse the repository at this point in the history
Modelica.Fluid.Examples.IncompressibleFluidNetwork was failing to compile due to nested comments of the form:

/* algStmtTupleAssign: ... /*Real*/(sign(...)...) */


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@25590 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
rfranke committed Apr 16, 2015
1 parent ef6eda1 commit 22d069a
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions Compiler/Template/CodegenCpp.tpl
Expand Up @@ -12771,8 +12771,6 @@ case STMT_TUPLE_ASSIGN(exp=CALL(__)) then
let &afterExp = buffer "" /*BUFD*/
let crefs = (expExpLst |> e => ExpressionDump.printExpStr(e) ;separator=", ")
let marker = '(<%crefs%>) = <%ExpressionDump.printExpStr(exp)%>'
let &preExp += '/* algStmtTupleAssign: preExp buffer created for <%marker%> */<%\n%>'
let &afterExp += '/* algStmtTupleAssign: afterExp buffer created for <%marker%> */<%\n%>'
let retStruct = daeExp(exp, context, &preExp /*BUFC*/, &varDecls /*BUFD*/, simCode , &extraFuncs , &extraFuncsDecl, extraFuncsNamespace, stateDerVectorName, useFlatArrayNotation)
//previous multi_array let rhsStr = 'boost::get<<%i1%>>(<%retStruct%>.data)'

Expand All @@ -12781,12 +12779,11 @@ case STMT_TUPLE_ASSIGN(exp=CALL(__)) then
writeLhsCref(cr, rhsStr, context, &afterExp, &varDecls, simCode , &extraFuncs , &extraFuncsDecl, extraFuncsNamespace, stateDerVectorName, useFlatArrayNotation)
;separator="\n";empty)
<<
/* algStmtTupleAssign: preExp printout <%marker%>*/

// algStmtTupleAssign: preExp printout <%marker%>
<%preExp%>
/* algStmtTupleAssign: writeLhsCref <%marker%> */
// algStmtTupleAssign: writeLhsCref
<%lhsCrefs%>
/* algStmtTupleAssign: afterExp printout <%marker%> */
// algStmtTupleAssign: afterExp
<%afterExp%>
>>

Expand Down

0 comments on commit 22d069a

Please sign in to comment.