Changeset 13939
- Timestamp:
- 2012-11-17T18:57:08+01:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Compiler/FrontEnd/Inst.mo
r13937 r13939 15195 15195 // split into inner, inner outer and other elements 15196 15196 (innerElts, innerouterElts, otherElts) = splitInnerAndOtherTplLstElementMod(inTplLstElementMod); 15197 // sort the inners to put Modelica types first! 15198 innerElts = sortInnerPutModelicaFirst(innerElts, {}); 15197 15199 // put the inner elements first 15198 15200 sorted = listAppend(innerElts, innerouterElts); … … 15204 15206 end sortInnerFirstTplLstElementMod; 15205 15207 15206 15208 protected 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; 15215 algorithm 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; 15242 end sortInnerPutModelicaFirst; 15207 15243 15208 15244 public function splitInnerAndOtherTplLstElementMod
Note: See TracChangeset
for help on using the changeset viewer.