From 69d7bc64555af8ab216d40531ceae832bc0df23d Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Mon, 23 Mar 2009 15:54:24 +0000 Subject: [PATCH] Fixed recursive channel bundle types to work properly --- frontends/ParseOccam.hs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/frontends/ParseOccam.hs b/frontends/ParseOccam.hs index 549bc48..2311b7f 100644 --- a/frontends/ParseOccam.hs +++ b/frontends/ParseOccam.hs @@ -422,6 +422,7 @@ scopeInSpec (spec@(A.Specification m n st), nt) where isRecursive (A.Function _ (_, A.Recursive) _ _ _) = True isRecursive (A.Proc _ (_, A.Recursive) _ _) = True + isRecursive (A.ChanBundleType _ A.Recursive _) = True isRecursive _ = False scopeOutSpec :: A.Specification -> OccParser () @@ -1109,7 +1110,7 @@ definition <|> do { n <- newRecordName; eol; indent; rec <- structuredType; outdent; sColon; eol; return (A.Specification m n rec, RecordName) } <|> do m <- md - rec <- recMode sCHAN >>* fst + rm <- recMode sCHAN >>* fst sTYPE n <- newChanBundleName eol @@ -1118,12 +1119,16 @@ definition sRECORD eol indent + n' <- if rm == A.Recursive + then scopeIn n ChanBundleName + (A.ChanBundleType m rm []) A.Original + else return n fs <- many1 chanInBundle outdent outdent sColon eol - return (A.Specification m n $ A.ChanBundleType m rec fs, ChanBundleName) + return (A.Specification m n' $ A.ChanBundleType m rm fs, ChanBundleName) <|> do m <- md sPROTOCOL n <- newProtocolName