Added a ShowOccam instance for A.Dimension
This commit is contained in:
parent
bf365ee41a
commit
ec1341849d
|
@ -219,6 +219,10 @@ instance ShowOccam A.Name where
|
|||
instance ShowRain A.Name where
|
||||
showRainM n = showName n
|
||||
|
||||
instance ShowOccam A.Dimension where
|
||||
showOccamM (A.Dimension n) = tell ["["] >> showOccamM n >> tell ["]"]
|
||||
showOccamM A.UnknownDimension = tell ["[]"]
|
||||
|
||||
instance ShowOccam A.Type where
|
||||
showOccamM A.Bool = tell ["BOOL"]
|
||||
showOccamM A.Byte = tell ["BYTE"]
|
||||
|
@ -244,12 +248,7 @@ instance ShowOccam A.Type where
|
|||
= tell ["(inferred numeric type: ",show m," ",show n,")"]
|
||||
showOccamM (A.Mobile t) = tell ["MOBILE "] >> showOccamM t
|
||||
showOccamM (A.Array ds t)
|
||||
= (sequence dims) >> showOccamM t
|
||||
where
|
||||
dims = [case d of
|
||||
A.Dimension n -> tell ["["] >> showOccamM n >> tell ["]"]
|
||||
A.UnknownDimension -> tell ["[]"]
|
||||
| d <- ds]
|
||||
= mapM showOccamM ds >> showOccamM t
|
||||
showOccamM (A.ChanEnd dir ca t)
|
||||
= tell [shared, "CHAN", direction, " "] >> showOccamM t
|
||||
where
|
||||
|
|
Loading…
Reference in New Issue
Block a user