Changeset 13939


Ignore:
Timestamp:
2012-11-17T18:57:08+01:00 (11 years ago)
Author:
adrpo
Message:
  • sort inners again to put inner Modelica.* component; first.
  • some tests might need changes, I'll do that next
File:
1 edited

Legend:

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

    r13937 r13939  
    1519515195        // split into inner, inner outer and other elements
    1519615196        (innerElts, innerouterElts, otherElts) = splitInnerAndOtherTplLstElementMod(inTplLstElementMod);
     15197        // sort the inners to put Modelica types first! 
     15198        innerElts = sortInnerPutModelicaFirst(innerElts, {});
    1519715199        // put the inner elements first
    1519815200        sorted = listAppend(innerElts, innerouterElts);
     
    1520415206end sortInnerFirstTplLstElementMod;
    1520515207
    15206 
     15208protected function sortInnerPutModelicaFirst
     15209"@author: adrpo
     15210  This function will move all the *inner* Modelica.*
     15211  elements first in the given list of elements"
     15212  input list<tuple<SCode.Element, DAE.Mod>> inTplLstElementMod;
     15213  input list<tuple<SCode.Element, DAE.Mod>> inAcc;
     15214  output list<tuple<SCode.Element, DAE.Mod>> outTplLstElementMod;
     15215algorithm
     15216  outTplLstElementMod := matchcontinue(inTplLstElementMod, inAcc)
     15217    local
     15218      list<tuple<SCode.Element, DAE.Mod>> rest, acc;
     15219      SCode.Element e;
     15220      DAE.Mod m;
     15221      tuple<SCode.Element, DAE.Mod> em;
     15222      Absyn.Path p;
     15223
     15224    case ({}, _)
     15225      then listReverse(inAcc);
     15226
     15227    case (em::rest, _)
     15228      equation
     15229        e = Util.tuple21(em);
     15230        Absyn.TPATH(p, _) = SCode.getComponentTypeSpec(e);
     15231        true = stringEq("Modelica", Absyn.pathFirstIdent(p));
     15232        acc = sortInnerPutModelicaFirst(rest, listAppend(inAcc, {em}));
     15233      then
     15234        acc;
     15235   
     15236    case ((em as (e, m))::rest, _)
     15237      equation
     15238        acc = sortInnerPutModelicaFirst(rest, em::inAcc);
     15239      then
     15240        acc;
     15241  end matchcontinue;
     15242end sortInnerPutModelicaFirst;
    1520715243
    1520815244public function splitInnerAndOtherTplLstElementMod
Note: See TracChangeset for help on using the changeset viewer.