Skip to content

Commit fd0d73b

Browse files
committed
Don't print empty dimensions list
1 parent fff5d10 commit fd0d73b

File tree

1 file changed

+17
-37
lines changed

1 file changed

+17
-37
lines changed

Compiler/BackEnd/BackendDump.mo

Lines changed: 17 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1959,21 +1959,21 @@ algorithm
19591959
local
19601960
String s1,s2,str;
19611961
list<String> l;
1962-
case DAE.T_INTEGER() then "Integer ";
1963-
case DAE.T_REAL() then "Real ";
1964-
case DAE.T_BOOL() then "Boolean ";
1965-
case DAE.T_STRING() then "String ";
1966-
case DAE.T_CLOCK() then "Clock ";
1962+
case DAE.T_INTEGER() then "Integer";
1963+
case DAE.T_REAL() then "Real";
1964+
case DAE.T_BOOL() then "Boolean";
1965+
case DAE.T_STRING() then "String";
1966+
case DAE.T_CLOCK() then "Clock";
19671967
case DAE.T_ENUMERATION(names = l)
19681968
equation
19691969
s1 = stringDelimitList(l, ", ");
19701970
s2 = stringAppend("enumeration(", s1);
19711971
str = stringAppend(s2, ")");
19721972
then
19731973
str;
1974-
case DAE.T_COMPLEX(complexClassType = ClassInf.EXTERNAL_OBJ(_)) then "ExternalObject ";
1975-
case DAE.T_COMPLEX(complexClassType = ClassInf.RECORD(_)) then "Record ";
1976-
case DAE.T_ARRAY() then "Array ";
1974+
case DAE.T_COMPLEX(complexClassType = ClassInf.EXTERNAL_OBJ(_)) then "ExternalObject";
1975+
case DAE.T_COMPLEX(complexClassType = ClassInf.RECORD(_)) then "Record";
1976+
case DAE.T_ARRAY() then "Array";
19771977
end match;
19781978
end dumpTypeStr;
19791979

@@ -2291,40 +2291,20 @@ public function varString "Helper function to printVarList."
22912291
input BackendDAE.Var inVar;
22922292
output String outStr;
22932293
protected
2294-
DAE.ComponentRef cr;
2295-
BackendDAE.VarKind kind;
2296-
DAE.VarDirection dir;
2297-
BackendDAE.Type var_type;
2298-
DAE.InstDims arrayDim;
2299-
Option<DAE.Exp> bindExp;
2300-
DAE.ElementSource source;
2301-
Option<DAE.VariableAttributes> dae_var_attr;
2302-
Option<SCode.Comment> comment;
2303-
DAE.ConnectorType ct;
23042294
list<Absyn.Path> paths;
23052295
list<String> paths_lst;
2306-
String path_str;
2307-
Boolean unreplaceable;
23082296
String unreplaceableStr;
2297+
String dimensions;
23092298
algorithm
2310-
BackendDAE.VAR(varName=cr,
2311-
varKind=kind,
2312-
varDirection=dir,
2313-
varType=var_type,
2314-
arryDim=arrayDim,
2315-
bindExp=bindExp,
2316-
source=source,
2317-
values=dae_var_attr,
2318-
comment=comment,
2319-
connectorType=ct,
2320-
unreplaceable=unreplaceable) := inVar;
2321-
paths := DAEUtil.getElementSourceTypes(source);
2299+
paths := DAEUtil.getElementSourceTypes(inVar.source);
23222300
paths_lst := List.map(paths, Absyn.pathString);
2323-
unreplaceableStr := if unreplaceable then " unreplaceable" else "";
2324-
outStr := DAEDump.dumpDirectionStr(dir) + ComponentReference.printComponentRefStr(cr) + ":"
2325-
+ kindString(kind) + "(" + connectorTypeString(ct) + attributesString(dae_var_attr)
2326-
+ ") " + optExpressionString(bindExp,"") + DAEDump.dumpCommentAnnotationStr(comment)
2327-
+ stringDelimitList(paths_lst, ", ") + " type: " + dumpTypeStr(var_type) + "["+ExpressionDump.dimensionsString(arrayDim) + "]" + unreplaceableStr;
2301+
unreplaceableStr := if inVar.unreplaceable then " unreplaceable" else "";
2302+
dimensions := ExpressionDump.dimensionsString(inVar.arryDim);
2303+
dimensions := if dimensions <> "" then " [" + dimensions + "]" else "";
2304+
outStr := DAEDump.dumpDirectionStr(inVar.varDirection) + ComponentReference.printComponentRefStr(inVar.varName) + ":"
2305+
+ kindString(inVar.varKind) + "(" + connectorTypeString(inVar.connectorType) + attributesString(inVar.values)
2306+
+ ") " + optExpressionString(inVar.bindExp, "") + DAEDump.dumpCommentAnnotationStr(inVar.comment)
2307+
+ stringDelimitList(paths_lst, ", ") + " type: " + dumpTypeStr(inVar.varType) + dimensions + unreplaceableStr;
23282308
end varString;
23292309

23302310
public function dumpKind

0 commit comments

Comments
 (0)