Rain: corrected the pass transforming the each loops so that it records the nonce names properly in the state

This commit is contained in:
Neil Brown 2007-08-22 11:12:57 +00:00
parent 289b1c79a7
commit d681cd5d95

View File

@ -98,12 +98,13 @@ transformEach = everywhereM (mkM transformEach')
--spec is a function A.Structured -> A.Structured, var is an A.Variable --spec is a function A.Structured -> A.Structured, var is an A.Variable
loopVarType <- typeOfName loopVar loopVarType <- typeOfName loopVar
loopIndex <- makeNonce "loopIndex" A.Specification _ loopIndexName _ <- makeNonceVariable "loopIndex" m' A.Int64 A.VariableName A.Original
let newRep = A.For m' (simpleName loopIndex) (intLiteral 0) (A.SizeVariable m' var)
let newRep = A.For m' loopIndexName (intLiteral 0) (A.SizeVariable m' var)
let s' = A.Spec m' let s' = A.Spec m'
(A.Specification m' loopVar (A.Specification m' loopVar
(A.Is m' A.Abbrev loopVarType (A.Is m' A.Abbrev loopVarType
(A.SubscriptedVariable m' (A.Subscript m' (A.ExprVariable m' (variable loopIndex))) var) (A.SubscriptedVariable m' (A.Subscript m' (A.ExprVariable m' (A.Variable m' loopIndexName))) var)
) )
) )
s s