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}
|
||||
|
||||
defRecord :: String -> String -> A.Type -> State CompState ()
|
||||
defRecord rec mem t = defineName (simpleName rec) $
|
||||
A.NameDef emptyMeta rec rec
|
||||
defRecord record mem t = defineName (simpleName record) $
|
||||
A.NameDef emptyMeta record record
|
||||
(A.RecordType emptyMeta (A.RecordAttr False False) [(simpleName mem,t)])
|
||||
A.Original A.NameUser A.Unplaced
|
||||
|
||||
|
|
|
@ -102,16 +102,16 @@ instance F.Foldable ParItems where
|
|||
instance T.Traversable ParItems where
|
||||
-- traverse :: Applicative f => (a -> f b) -> ParItems a -> f (ParItems 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
|
||||
-- rec :: Applicative f => [ParItems a] -> f [ParItems b]
|
||||
rec [] = pure []
|
||||
rec (p:ps) = liftA2 (:) (T.traverse f p) (rec ps)
|
||||
-- g :: Applicative f => [ParItems a] -> f [ParItems b]
|
||||
g [] = pure []
|
||||
g (p:ps) = liftA2 (:) (T.traverse f p) (g ps)
|
||||
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
|
||||
rec [] = pure []
|
||||
rec (s:ss) = liftA2 (:) (f s) (rec ss)
|
||||
g [] = pure []
|
||||
g (s:ss) = liftA2 (:) (f s) (g ss)
|
||||
|
||||
-- Gets all the items inside a ParItems and returns them in a flat list.
|
||||
flattenParItems :: ParItems a -> [a]
|
||||
|
|
|
@ -136,8 +136,8 @@ typeOfSpec = liftM (fmap fst) . typeOfSpec'
|
|||
--{{{ identifying types
|
||||
-- | Get the fields of a record type.
|
||||
recordFields :: (CSMR m, Die m) => Meta -> A.Type -> m [(A.Name, A.Type)]
|
||||
recordFields m (A.Record rec)
|
||||
= do st <- specTypeOfName rec
|
||||
recordFields m (A.Record record)
|
||||
= do st <- specTypeOfName record
|
||||
case st of
|
||||
A.RecordType _ _ fs -> return fs
|
||||
_ -> dieP m "not record type"
|
||||
|
@ -159,8 +159,8 @@ recordFields m (A.ChanDataType A.DirOutput _ n)
|
|||
recordFields m _ = dieP m "not record type"
|
||||
|
||||
recordAttr :: (CSMR m, Die m) => Meta -> A.Type -> m A.RecordAttr
|
||||
recordAttr m (A.Record rec)
|
||||
= do st <- specTypeOfName rec
|
||||
recordAttr m (A.Record record)
|
||||
= do st <- specTypeOfName record
|
||||
case st of
|
||||
A.RecordType _ attr _ -> return attr
|
||||
_ -> dieP m "not record type"
|
||||
|
|
|
@ -1210,8 +1210,8 @@ definition
|
|||
sTYPE
|
||||
do { n <- tryVX newDataTypeName sIS; t <- dataType; sColon; eol;
|
||||
return (A.Specification m n (A.DataType m t), DataTypeName, normalName) }
|
||||
<|> do { n <- newRecordName; eol; indent; rec <- structuredType; outdent; sColon; eol;
|
||||
return (A.Specification m n rec, RecordName, normalName) }
|
||||
<|> do { n <- newRecordName; eol; indent; record <- structuredType; outdent; sColon; eol;
|
||||
return (A.Specification m n record, RecordName, normalName) }
|
||||
<|> do m <- md
|
||||
rm <- tryVX (recMode sCHAN) sTYPE >>* fst
|
||||
n <- newChanBundleName
|
||||
|
|
Loading…
Reference in New Issue
Block a user