@@ -1238,29 +1238,31 @@ end evaluateEquationsConnOp;
12381238function collectComponentFuncs
12391239 input Variable var ;
12401240 input output FunctionTree funcs;
1241- protected
1242- Binding binding;
1243- ComponentRef cref;
1244- InstNode node;
1245- Type ty;
12461241algorithm
12471242 () := match var
1248- case Variable . VARIABLE (ty = ty, binding = binding )
1243+ case Variable . VARIABLE ()
12491244 algorithm
1250- // TODO: Collect functions from the component's type attributes.
1245+ funcs := collectTypeFuncs(var . ty, funcs);
1246+ funcs := collectBindingFuncs(var . binding, funcs);
12511247
1252- funcs := collectTypeFuncs(ty, funcs);
1253-
1254- // Collect functions used in the component's binding, if it has one.
1255- if Binding . isExplicitlyBound(binding) then
1256- funcs := collectExpFuncs(Binding . getTypedExp(binding), funcs);
1257- end if ;
1248+ for attr in var . typeAttributes loop
1249+ funcs := collectBindingFuncs(Util . tuple22(attr), funcs);
1250+ end for ;
12581251 then
12591252 ();
12601253
12611254 end match;
12621255end collectComponentFuncs;
12631256
1257+ function collectBindingFuncs
1258+ input Binding binding;
1259+ input output FunctionTree funcs;
1260+ algorithm
1261+ if Binding . isExplicitlyBound(binding) then
1262+ funcs := collectExpFuncs(Binding . getTypedExp(binding), funcs);
1263+ end if ;
1264+ end collectBindingFuncs;
1265+
12641266function collectTypeFuncs
12651267 input Type ty;
12661268 input output FunctionTree funcs;
0 commit comments