From cab4ec2113e000d50edc9e43f6766a6be3b15b84 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Thu, 23 Aug 2007 11:41:53 +0000 Subject: [PATCH] Rain: added parsing of variable declarations --- RainParse.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/RainParse.hs b/RainParse.hs index a123fe5..762036b 100644 --- a/RainParse.hs +++ b/RainParse.hs @@ -246,7 +246,8 @@ tupleDef = do {sLeftR ; tm <- sepBy tupleDefMember sComma ; sRightR ; return tm} tupleDefMember = do {t <- dataType ; sColon ; n <- name ; return (n,t)} declaration :: RainParser (A.Structured -> A.Structured) -declaration = return id +declaration = do {t <- dataType; sColon ; n <- name ; sSemiColon ; + return $ A.Spec (findMeta t) $ A.Specification (findMeta t) n $ A.Declaration (findMeta t) t } topLevelDecl :: RainParser A.Structured topLevelDecl = do {m <- sProcess ; procName <- name ; params <- tupleDef ; body <- block ;