From e52b51b050c7667beb2c770c16a9a7e1406931d0 Mon Sep 17 00:00:00 2001 From: Adam Sampson Date: Fri, 4 Apr 2008 12:09:33 +0000 Subject: [PATCH] Add an Infer type to mark types that should be inferred. We can then check it's been removed using a property later. --- common/ShowCode.hs | 2 ++ data/AST.hs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/common/ShowCode.hs b/common/ShowCode.hs index 1f6819e..f805251 100644 --- a/common/ShowCode.hs +++ b/common/ShowCode.hs @@ -225,6 +225,7 @@ instance ShowOccam A.Type where showOccamM A.Any = tell ["ANY"] showOccamM (A.Timer _) = tell ["TIMER"] showOccamM A.Time = tell ["TIME"] + showOccamM A.Infer = tell ["(inferred type)"] showOccamM (A.Mobile t) = tell ["MOBILE "] >> showOccamM t showOccamM (A.Array ds t) @@ -266,6 +267,7 @@ instance ShowRain A.Type where -- Mobility is not explicit in Rain: showRainM (A.Mobile t) = showRainM t showRainM (A.List t) = tell ["["] >> showRainM t >> tell ["]"] + showRainM A.Infer = tell ["(inferred type)"] showRainM x = tell [""] instance ShowOccam A.DyadicOp where diff --git a/data/AST.hs b/data/AST.hs index 2cbc22c..a369810 100644 --- a/data/AST.hs +++ b/data/AST.hs @@ -143,6 +143,8 @@ data Type = | Time | Port Type | Mobile Type + -- | A type that will be inferred automatically by a pass. + | Infer deriving (Show, Eq, Typeable, Data) -- | An array dimension.