Skip to content

Commit

Permalink
- Fixed Lookup.expandWholeDimSubScript so that it doesn't drop for-it…
Browse files Browse the repository at this point in the history
…erators from

the subscripts, which caused the testcase mofiles/VectorTest to fail.
- Changed the testcase mofiles/VectorTest, since it previously expected the wrong result.


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@5168 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
perost committed Mar 18, 2010
1 parent 2b4d698 commit e6fbe8b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Compiler/Lookup.mo
Expand Up @@ -2793,6 +2793,16 @@ algorithm
local
DAE.Subscript sub1,sub2;
list<DAE.Subscript> subs1,subs2;
// If a for-iterator is used as subscript we get a cref subscript in inSubs,
// but nothing in inSlice because it only contains integers (see
// addArrayDimensions above). This case makes sure that for-iterators are
// not lost here.
case (((sub1 as DAE.INDEX(exp = DAE.CREF(componentRef = _))) :: subs1),
subs2)
equation
subs2 = expandWholeDimSubScript(subs1, subs2);
then
(sub1 :: subs2);
case(_,{}) then {};
case({},subs2) then subs2;
case(((sub1 as DAE.WHOLEDIM())::subs1), (sub2::subs2))
Expand Down

0 comments on commit e6fbe8b

Please sign in to comment.