Added a special type for marking the type of numeric literals to be inferred later

This commit is contained in:
Neil Brown 2008-05-14 11:59:33 +00:00
parent ed9c92878a
commit 962c1477b9
2 changed files with 5 additions and 1 deletions

View File

@ -226,7 +226,7 @@ instance ShowOccam A.Type where
showOccamM (A.Timer _) = tell ["TIMER"]
showOccamM A.Time = tell ["TIME"]
showOccamM A.Infer = tell ["(inferred type)"]
showOccamM (A.InferNum n) = tell ["(inferred numeric type: ",show n,")"]
showOccamM (A.Mobile t) = tell ["MOBILE "] >> showOccamM t
showOccamM (A.Array ds t)
= (sequence dims) >> showOccamM t
@ -268,6 +268,7 @@ instance ShowRain A.Type where
showRainM (A.Mobile t) = showRainM t
showRainM (A.List t) = tell ["["] >> showRainM t >> tell ["]"]
showRainM A.Infer = tell ["(inferred type)"]
showRainM (A.InferNum n) = tell ["(inferred numeric type: ",show n,")"]
showRainM x = tell ["<invalid Rain type: ", show x, ">"]
instance ShowOccam A.DyadicOp where

View File

@ -144,6 +144,9 @@ data Type =
| Mobile Type
-- | A type that will be inferred automatically by a pass.
| Infer
-- | A numeric type to be inferred later, that must be able to hold the given
-- value
| InferNum Integer
deriving (Show, Eq, Typeable, Data)
-- | An array dimension.