Changeset 13967


Ignore:
Timestamp:
2012-11-19T17:01:04+01:00 (11 years ago)
Author:
perost
Message:
  • Removed some dead code from SCodeDependency.
  • Updated fluid tests.
Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Compiler/FrontEnd/SCodeDependency.mo

    r13963 r13967  
    888888end markAsUsedOnRestriction2;
    889889
    890 protected function checkNotExtendsDependent
    891   "Wrapper function for checkNotExtendsDependent2 which adds the error message
    892   count to the function arguments."
    893   input Absyn.Path inBaseClass;
    894   input Env inEnv;
    895   input Absyn.Info inInfo;
    896   output Boolean outResult;
    897 algorithm
    898   outResult := checkNotExtendsDependent2(inBaseClass, inEnv, inInfo,
    899     Error.getNumErrorMessages());
    900 end checkNotExtendsDependent;
    901 
    902 protected function checkNotExtendsDependent2
    903   "The Modelica specification 3.2 says (section 5.6.1): 'The lookup of the names
    904   of extended classes should give the same result before and after flattening
    905   the extends. One should not find any element used during this flattening by
    906   lookup through the extends-clauses.' This means that it's not allowed to have
    907   a name in an extends-clause that's inherited from another extends-clause. This
    908   function checks this, and returns true if an extends doesn't depend on an
    909   extend in the local scope."
    910   input Absyn.Path inBaseClass;
    911   input Env inEnv;
    912   input Absyn.Info inInfo;
    913   input Integer inErrorCount;
    914   output Boolean outResult;
    915 algorithm
    916   outResult := matchcontinue(inBaseClass, inEnv, inInfo, inErrorCount)
    917     local
    918       Absyn.Path bc;
    919       Absyn.Ident id;
    920       String bc_name;
    921 
    922     case (_, _, _, _)
    923       equation
    924         id = Absyn.pathFirstIdent(inBaseClass);
    925         bc :: _ = SCodeLookup.lookupBaseClasses(id, inEnv);
    926         bc_name = Absyn.pathString(bc);
    927         Error.addSourceMessage(Error.EXTENDS_INHERITED_FROM_LOCAL_EXTENDS,
    928           {bc_name, id}, inInfo);
    929       then
    930         false;
    931 
    932     else
    933       equation
    934         true = intEq(inErrorCount, Error.getNumErrorMessages());
    935       then
    936         true;
    937 
    938   end matchcontinue;
    939 end checkNotExtendsDependent2;
    940 
    941890protected function analyseExtends
    942891  "Analyses an extends-clause."
  • trunk/testsuite/flattening/libraries/msl31/fluid/Modelica.Fluid.Examples.AST_BatchPlant.BaseClasses.TankWithTopPorts.mos

    r13930 r13967  
    7575//   Continuing flattening by only considering the 'outer' component declaration.
    7676//
    77 // Class Modelica.Fluid.Examples.AST_BatchPlant.BaseClasses.TankWithTopPorts has 22 equation(s) and 23 variable(s).
    78 // 13 of these are trivial equation(s).
     77// Class Modelica.Fluid.Examples.AST_BatchPlant.BaseClasses.TankWithTopPorts has 20 equation(s) and 23 variable(s).
     78// 11 of these are trivial equation(s).
    7979// "
    8080// ""
  • trunk/testsuite/flattening/libraries/msl31/fluid/Modelica.Fluid.Fittings.MultiPort.mos

    r13930 r13967  
    1818//   output Real y;
    1919// algorithm
    20 //   y := max(x, 1e-10);
     20//   y := max(x, 0.0000000001);
    2121// end Modelica.Fluid.Fittings.MultiPort.positiveMax;
    2222//
     
    4444//   port_a.h_outflow = 1.0;
    4545//   port_a.m_flow = 0.0;
    46 //   ports_b[0].m_flow = 0.0;
    4746// end Modelica.Fluid.Fittings.MultiPort;
    4847// "
     
    5150//
    5251//
    53 // Class Modelica.Fluid.Fittings.MultiPort has 4 equation(s) and 3 variable(s).
    54 // 4 of these are trivial equation(s).
     52// Class Modelica.Fluid.Fittings.MultiPort has 3 equation(s) and 3 variable(s).
     53// 3 of these are trivial equation(s).
    5554// "
    5655// ""
Note: See TracChangeset for help on using the changeset viewer.