Skip to content
This repository has been archived by the owner on May 18, 2019. It is now read-only.

Commit

Permalink
[NF] Fix subscripting of ranges.
Browse files Browse the repository at this point in the history
Belonging to [master]:
  - #2799
  • Loading branch information
perost authored and OpenModelica-Hudson committed Nov 25, 2018
1 parent eeb0df6 commit 83bdb3d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Compiler/NFFrontEnd/NFExpression.mo
Expand Up @@ -1117,13 +1117,13 @@ public
algorithm
subscriptedExp := match (startExp, stepExp)
case (Expression.INTEGER(), SOME(Expression.INTEGER(iidx)))
then Expression.INTEGER(startExp.value + index * iidx - 1);
then Expression.INTEGER(startExp.value + (index - 1) * iidx);

case (Expression.INTEGER(), _)
then Expression.INTEGER(startExp.value + index - 1);

case (Expression.REAL(), SOME(Expression.REAL(ridx)))
then Expression.REAL(startExp.value + index * ridx - 1);
then Expression.REAL(startExp.value + (index - 1) * ridx);

case (Expression.REAL(), _)
then Expression.REAL(startExp.value + index - 1.0);
Expand Down

0 comments on commit 83bdb3d

Please sign in to comment.