Add an Infer type to mark types that should be inferred.
We can then check it's been removed using a property later.
This commit is contained in:
parent
17702401fa
commit
e52b51b050
|
@ -225,6 +225,7 @@ instance ShowOccam A.Type where
|
||||||
showOccamM A.Any = tell ["ANY"]
|
showOccamM A.Any = tell ["ANY"]
|
||||||
showOccamM (A.Timer _) = tell ["TIMER"]
|
showOccamM (A.Timer _) = tell ["TIMER"]
|
||||||
showOccamM A.Time = tell ["TIME"]
|
showOccamM A.Time = tell ["TIME"]
|
||||||
|
showOccamM A.Infer = tell ["(inferred type)"]
|
||||||
|
|
||||||
showOccamM (A.Mobile t) = tell ["MOBILE "] >> showOccamM t
|
showOccamM (A.Mobile t) = tell ["MOBILE "] >> showOccamM t
|
||||||
showOccamM (A.Array ds t)
|
showOccamM (A.Array ds t)
|
||||||
|
@ -266,6 +267,7 @@ instance ShowRain A.Type where
|
||||||
-- Mobility is not explicit in Rain:
|
-- Mobility is not explicit in Rain:
|
||||||
showRainM (A.Mobile t) = showRainM t
|
showRainM (A.Mobile t) = showRainM t
|
||||||
showRainM (A.List t) = tell ["["] >> showRainM t >> tell ["]"]
|
showRainM (A.List t) = tell ["["] >> showRainM t >> tell ["]"]
|
||||||
|
showRainM A.Infer = tell ["(inferred type)"]
|
||||||
showRainM x = tell ["<invalid Rain type: ", show x, ">"]
|
showRainM x = tell ["<invalid Rain type: ", show x, ">"]
|
||||||
|
|
||||||
instance ShowOccam A.DyadicOp where
|
instance ShowOccam A.DyadicOp where
|
||||||
|
|
|
@ -143,6 +143,8 @@ data Type =
|
||||||
| Time
|
| Time
|
||||||
| Port Type
|
| Port Type
|
||||||
| Mobile Type
|
| Mobile Type
|
||||||
|
-- | A type that will be inferred automatically by a pass.
|
||||||
|
| Infer
|
||||||
deriving (Show, Eq, Typeable, Data)
|
deriving (Show, Eq, Typeable, Data)
|
||||||
|
|
||||||
-- | An array dimension.
|
-- | An array dimension.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user