Changeset 3c1d34e in OpenModelica


Ignore:
Timestamp:
2019-01-14T11:26:28+01:00 (5 years ago)
Author:
hudson <openmodelica@…>
Branches:
Added-citation-metadata, maintenance/v1.14, maintenance/v1.15, maintenance/v1.16, maintenance/v1.17, maintenance/v1.18, maintenance/v1.19, maintenance/v1.20, maintenance/v1.21, maintenance/v1.22, maintenance/v1.23, master, omlib-staging
Children:
8481cc5
Parents:
0fb5b980
git-author:
Per Östlund <per.ostlund@…> (01/14/19 11:26:28)
git-committer:
hudson <openmodelica@…> (01/14/19 11:26:28)
Message:

[NF] Collect functions in builtin attributes.

Belonging to [master]:

  • OpenModelica/OMCompiler#2869
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Compiler/NFFrontEnd/NFFlatten.mo

    r0fb5b980 r3c1d34e  
    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)
    1249       algorithm
    1250         // TODO: Collect functions from the component's type attributes.
    1251 
    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;
     1243    case Variable.VARIABLE()
     1244      algorithm
     1245        funcs := collectTypeFuncs(var.ty, funcs);
     1246        funcs := collectBindingFuncs(var.binding, funcs);
     1247
     1248        for attr in var.typeAttributes loop
     1249          funcs := collectBindingFuncs(Util.tuple22(attr), funcs);
     1250        end for;
    12581251      then
    12591252        ();
     
    12611254  end match;
    12621255end collectComponentFuncs;
     1256
     1257function collectBindingFuncs
     1258  input Binding binding;
     1259  input output FunctionTree funcs;
     1260algorithm
     1261  if Binding.isExplicitlyBound(binding) then
     1262    funcs := collectExpFuncs(Binding.getTypedExp(binding), funcs);
     1263  end if;
     1264end collectBindingFuncs;
    12631265
    12641266function collectTypeFuncs
Note: See TracChangeset for help on using the changeset viewer.