Changeset b212460 in OpenModelica


Ignore:
Timestamp:
2013-12-16T17:12:10+01:00 (10 years ago)
Author:
Per Östlund <per.ostlund@…>
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, master, omlib-staging
Children:
5e7849a0
Parents:
f67dc27f
Message:

Fix for #2503:

  • Propagate visibility prefix to components of structured components.

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@18496 f25d12d1-65f4-0310-ae8a-bbce733d8d8e

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Compiler/FrontEnd/InstUtil.mo

    r421c1e8 rb212460  
    42864286      SCode.Ident ident;
    42874287      list<DAE.Element> el;
     4288      SCode.Visibility vis;
    42884289
    42894290    // Just return the element if nothing needs to be changed.
     
    42954296          direction = Absyn.BIDIR()),
    42964297        SCode.PREFIXES(
     4298          visibility = SCode.PUBLIC(),
    42974299          finalPrefix = SCode.NOT_FINAL(),
    42984300          innerOuter = Absyn.NOT_INNER_OUTER()), _)
     
    43214323          direction = dir),
    43224324        SCode.PREFIXES(
     4325          visibility = vis,
    43234326          finalPrefix = fp,
    43244327          innerOuter = io1), _)
     
    43274330        vk = propagateVariability(vk, var);
    43284331        vprl = propagateParallelism(vprl,sprl,cr,inInfo);
     4332        vvis = propagateVisibility(vvis, vis);
    43294333        var_attrs = propagateFinal(var_attrs, fp);
    43304334        io2 = propagateInnerOuter(io2, io1);
     
    44334437  end matchcontinue;
    44344438end propagateParallelism;
     4439
     4440protected function propagateVisibility
     4441  "Helper function to propagateAttributes. Propagates the visibility (public or
     4442   protected) attribute to variables of a structured component."
     4443  input DAE.VarVisibility inVarVisibility;
     4444  input SCode.Visibility inVisibility;
     4445  output DAE.VarVisibility outVarVisibility;
     4446algorithm
     4447  outVarVisibility := match(inVarVisibility, inVisibility)
     4448    case (_, SCode.PROTECTED()) then DAE.PROTECTED();
     4449    else inVarVisibility;
     4450  end match;
     4451end propagateVisibility;
    44354452
    44364453protected function propagateVariability
Note: See TracChangeset for help on using the changeset viewer.