Removed all uses of rec, which seems to be a reserved word these days
This commit is contained in:
parent
c0e2e9c401
commit
7b80564828
|
@ -785,8 +785,8 @@ testRetypeSizes = TestList
|
||||||
over = local $ \ops -> ops {genBytesIn = showBytesInParams, genStop = override2 at}
|
over = local $ \ops -> ops {genBytesIn = showBytesInParams, genStop = override2 at}
|
||||||
|
|
||||||
defRecord :: String -> String -> A.Type -> State CompState ()
|
defRecord :: String -> String -> A.Type -> State CompState ()
|
||||||
defRecord rec mem t = defineName (simpleName rec) $
|
defRecord record mem t = defineName (simpleName record) $
|
||||||
A.NameDef emptyMeta rec rec
|
A.NameDef emptyMeta record record
|
||||||
(A.RecordType emptyMeta (A.RecordAttr False False) [(simpleName mem,t)])
|
(A.RecordType emptyMeta (A.RecordAttr False False) [(simpleName mem,t)])
|
||||||
A.Original A.NameUser A.Unplaced
|
A.Original A.NameUser A.Unplaced
|
||||||
|
|
||||||
|
|
|
@ -102,16 +102,16 @@ instance F.Foldable ParItems where
|
||||||
instance T.Traversable ParItems where
|
instance T.Traversable ParItems where
|
||||||
-- traverse :: Applicative f => (a -> f b) -> ParItems a -> f (ParItems b)
|
-- traverse :: Applicative f => (a -> f b) -> ParItems a -> f (ParItems b)
|
||||||
-- <*> :: Applicative f => f (a -> b) -> f a -> f b
|
-- <*> :: Applicative f => f (a -> b) -> f a -> f b
|
||||||
traverse f (ParItems ps) = liftA ParItems $ rec ps
|
traverse f (ParItems ps) = liftA ParItems $ g ps
|
||||||
where
|
where
|
||||||
-- rec :: Applicative f => [ParItems a] -> f [ParItems b]
|
-- g :: Applicative f => [ParItems a] -> f [ParItems b]
|
||||||
rec [] = pure []
|
g [] = pure []
|
||||||
rec (p:ps) = liftA2 (:) (T.traverse f p) (rec ps)
|
g (p:ps) = liftA2 (:) (T.traverse f p) (g ps)
|
||||||
traverse f (RepParItem nr p) = liftA (RepParItem nr) $ T.traverse f p
|
traverse f (RepParItem nr p) = liftA (RepParItem nr) $ T.traverse f p
|
||||||
traverse f (SeqItems ss) = liftA SeqItems $ rec ss
|
traverse f (SeqItems ss) = liftA SeqItems $ g ss
|
||||||
where
|
where
|
||||||
rec [] = pure []
|
g [] = pure []
|
||||||
rec (s:ss) = liftA2 (:) (f s) (rec ss)
|
g (s:ss) = liftA2 (:) (f s) (g ss)
|
||||||
|
|
||||||
-- Gets all the items inside a ParItems and returns them in a flat list.
|
-- Gets all the items inside a ParItems and returns them in a flat list.
|
||||||
flattenParItems :: ParItems a -> [a]
|
flattenParItems :: ParItems a -> [a]
|
||||||
|
|
|
@ -136,8 +136,8 @@ typeOfSpec = liftM (fmap fst) . typeOfSpec'
|
||||||
--{{{ identifying types
|
--{{{ identifying types
|
||||||
-- | Get the fields of a record type.
|
-- | Get the fields of a record type.
|
||||||
recordFields :: (CSMR m, Die m) => Meta -> A.Type -> m [(A.Name, A.Type)]
|
recordFields :: (CSMR m, Die m) => Meta -> A.Type -> m [(A.Name, A.Type)]
|
||||||
recordFields m (A.Record rec)
|
recordFields m (A.Record record)
|
||||||
= do st <- specTypeOfName rec
|
= do st <- specTypeOfName record
|
||||||
case st of
|
case st of
|
||||||
A.RecordType _ _ fs -> return fs
|
A.RecordType _ _ fs -> return fs
|
||||||
_ -> dieP m "not record type"
|
_ -> dieP m "not record type"
|
||||||
|
@ -159,8 +159,8 @@ recordFields m (A.ChanDataType A.DirOutput _ n)
|
||||||
recordFields m _ = dieP m "not record type"
|
recordFields m _ = dieP m "not record type"
|
||||||
|
|
||||||
recordAttr :: (CSMR m, Die m) => Meta -> A.Type -> m A.RecordAttr
|
recordAttr :: (CSMR m, Die m) => Meta -> A.Type -> m A.RecordAttr
|
||||||
recordAttr m (A.Record rec)
|
recordAttr m (A.Record record)
|
||||||
= do st <- specTypeOfName rec
|
= do st <- specTypeOfName record
|
||||||
case st of
|
case st of
|
||||||
A.RecordType _ attr _ -> return attr
|
A.RecordType _ attr _ -> return attr
|
||||||
_ -> dieP m "not record type"
|
_ -> dieP m "not record type"
|
||||||
|
|
|
@ -1210,8 +1210,8 @@ definition
|
||||||
sTYPE
|
sTYPE
|
||||||
do { n <- tryVX newDataTypeName sIS; t <- dataType; sColon; eol;
|
do { n <- tryVX newDataTypeName sIS; t <- dataType; sColon; eol;
|
||||||
return (A.Specification m n (A.DataType m t), DataTypeName, normalName) }
|
return (A.Specification m n (A.DataType m t), DataTypeName, normalName) }
|
||||||
<|> do { n <- newRecordName; eol; indent; rec <- structuredType; outdent; sColon; eol;
|
<|> do { n <- newRecordName; eol; indent; record <- structuredType; outdent; sColon; eol;
|
||||||
return (A.Specification m n rec, RecordName, normalName) }
|
return (A.Specification m n record, RecordName, normalName) }
|
||||||
<|> do m <- md
|
<|> do m <- md
|
||||||
rm <- tryVX (recMode sCHAN) sTYPE >>* fst
|
rm <- tryVX (recMode sCHAN) sTYPE >>* fst
|
||||||
n <- newChanBundleName
|
n <- newChanBundleName
|
||||||
|
|
Loading…
Reference in New Issue
Block a user