@@ -197,6 +197,9 @@ function convertVarAttributes
197197 output Option < DAE . VariableAttributes > attributes;
198198protected
199199 Option < Boolean > is_final;
200+ Type elTy;
201+ Option < Type > arrayTy = NONE ();
202+ Boolean is_array = false ;
200203algorithm
201204 if listEmpty(attrs) and not compAttrs. isFinal then
202205 attributes := NONE ();
@@ -205,19 +208,26 @@ algorithm
205208
206209 is_final := SOME (compAttrs. isFinal);
207210
208- attributes := match ty
209- case Type . REAL () then convertRealVarAttributes(attrs, is_final);
210- case Type . INTEGER () then convertIntVarAttributes(attrs, is_final);
211- case Type . BOOLEAN () then convertBoolVarAttributes(attrs, is_final);
212- case Type . STRING () then convertStringVarAttributes(attrs, is_final);
213- case Type . ENUMERATION () then convertEnumVarAttributes(attrs, is_final);
211+ elTy := ty;
212+ if Type . isArray(ty) then
213+ elTy := Type . arrayElementType(ty);
214+ arrayTy := SOME (ty);
215+ end if ;
216+
217+ attributes := match elTy
218+ case Type . REAL () then convertRealVarAttributes(attrs, is_final, arrayTy);
219+ case Type . INTEGER () then convertIntVarAttributes(attrs, is_final, arrayTy);
220+ case Type . BOOLEAN () then convertBoolVarAttributes(attrs, is_final, arrayTy);
221+ case Type . STRING () then convertStringVarAttributes(attrs, is_final, arrayTy);
222+ case Type . ENUMERATION () then convertEnumVarAttributes(attrs, is_final, arrayTy);
214223 else NONE ();
215224 end match;
216225end convertVarAttributes;
217226
218227function convertRealVarAttributes
219228 input list< tuple< String , Binding >> attrs;
220229 input Option < Boolean > isFinal;
230+ input Option < Type > arrayTy;
221231 output Option < DAE . VariableAttributes > attributes;
222232protected
223233 String name;
@@ -260,6 +270,7 @@ end convertRealVarAttributes;
260270function convertIntVarAttributes
261271 input list< tuple< String , Binding >> attrs;
262272 input Option < Boolean > isFinal;
273+ input Option < Type > arrayTy;
263274 output Option < DAE . VariableAttributes > attributes;
264275protected
265276 String name;
@@ -295,6 +306,7 @@ end convertIntVarAttributes;
295306function convertBoolVarAttributes
296307 input list< tuple< String , Binding >> attrs;
297308 input Option < Boolean > isFinal;
309+ input Option < Type > arrayTy;
298310 output Option < DAE . VariableAttributes > attributes;
299311protected
300312 String name;
@@ -326,6 +338,7 @@ end convertBoolVarAttributes;
326338function convertStringVarAttributes
327339 input list< tuple< String , Binding >> attrs;
328340 input Option < Boolean > isFinal;
341+ input Option < Type > arrayTy;
329342 output Option < DAE . VariableAttributes > attributes;
330343protected
331344 String name;
@@ -357,6 +370,7 @@ end convertStringVarAttributes;
357370function convertEnumVarAttributes
358371 input list< tuple< String , Binding >> attrs;
359372 input Option < Boolean > isFinal;
373+ input Option < Type > arrayTy;
360374 output Option < DAE . VariableAttributes > attributes;
361375protected
362376 String name;
0 commit comments