@@ -319,10 +319,6 @@ template crefToCStr(ComponentRef cr, Boolean useFlatArrayNotation)
319319 else "CREF_NOT_IDENT_OR_QUAL"
320320end crefToCStr;
321321
322- template representationCrefDerVar(ComponentRef inCref, SimCode simCode ,Text& extraFuncs,Text& extraFuncsDecl,Text extraFuncsNamespace, Context context, Text stateDerVectorName /*=__zDot */) ::=
323- cref2simvar(inCref, simCode ) |> SIMVAR(__) =>'<%stateDerVectorName%>[<%index%>]'
324- end representationCrefDerVar;
325-
326322template daeExpCrefRhs(Exp exp, Context context, Text &preExp, Text &varDecls, SimCode simCode, Text& extraFuncs,
327323 Text& extraFuncsDecl, Text extraFuncsNamespace, Text stateDerVectorName /*=__zDot*/, Boolean useFlatArrayNotation)
328324 "Generates code for a component reference on the right hand side of an
@@ -1759,16 +1755,9 @@ template daeExpCall(Exp call, Context context, Text &preExp /*BUFP*/, Text &varD
17591755 //let &preExp += 'division_alloc_<%type%>_scalar(&<%var1%>, <%var2%>, &<%var%>, "<%var3%>");<%\n%>'
17601756 '<%var%>'
17611757
1762-
17631758 case CALL(path=IDENT(name="der"), expLst={ arg as CREF(__)} ) then
1764- representationCrefDerVar(arg.componentRef, simCode, &extraFuncs, &extraFuncsDecl, extraFuncsNamespace, context, stateDerVectorName)
1765- case CALL(path=IDENT(name="pre"), expLst={ arg as CREF(__)} ) then
1766- let retType = '<%expTypeArrayIf(arg.ty)%>'
1767- let retVar = tempDecl(retType, &varDecls /*BUFD*/)
1768- let cast = match arg.ty case T_INTEGER(__) then "(int)"
1769- case T_ENUMERATION(__) then "(int)" //else ""
1770- let &preExp += '<%retVar%> = <%cast%>pre(<%cref(arg.componentRef, useFlatArrayNotation)%>);<%\n%>'
1771- '<%retVar%>'
1759+ let var = cref2simvar(arg.componentRef, simCode) |> SIMVAR(index=i) => '__zDot[<%i%>]'
1760+ '<%var%>'
17721761
17731762 case CALL(path=IDENT(name="print"), expLst={ e1} ) then
17741763 let var1 = daeExp(e1, context, &preExp, &varDecls, simCode, &extraFuncs, &extraFuncsDecl, extraFuncsNamespace, stateDerVectorName, useFlatArrayNotation)
0 commit comments