Skip to content

Commit

Permalink
Dump empty arrays {} as fill(0,0)
Browse files Browse the repository at this point in the history
  • Loading branch information
fbergero authored and OpenModelica-Hudson committed Nov 25, 2015
1 parent 945d450 commit fe52534
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Compiler/Template/ExpressionDumpTpl.tpl
Expand Up @@ -61,9 +61,16 @@ match exp
let func_str = AbsynDumpTpl.dumpPathNoQual(path)
let argl = dumpExpList(expList, stringDelimiter, ", ")
'function <%func_str%>(<%argl%>)'
case ARRAY(array={}) then
if (Flags.getConfigBool(Flags.MODELICA_OUTPUT)) then
'fill(0,0)'
else
let expl = dumpExpList(array, stringDelimiter, ", ")
'<%if typeinfo() then (if scalar then '/* scalar <%unparseType(ty)%>*/' else '/* non-scalar <%unparseType(ty)%> */ ')%>{<%expl%>}'
case ARRAY(__) then
let expl = dumpExpList(array, stringDelimiter, ", ")
'<%if typeinfo() then (if scalar then '/* scalar <%unparseType(ty)%>*/' else '/* non-scalar <%unparseType(ty)%> */ ')%>{<%expl%>}'

case MATRIX(__) then
let mat_str = (matrix |> row => dumpExpList(row, stringDelimiter, ", ") ;separator="}, {")
'<%if typeinfo() then '/* matrix <%unparseType(ty) %> */ '%>{{<%mat_str%>}}'
Expand Down

0 comments on commit fe52534

Please sign in to comment.