Rain: added parsing of variable declarations

This commit is contained in:
Neil Brown 2007-08-23 11:41:53 +00:00
parent 1bc92b0b37
commit cab4ec2113

View File

@ -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 ;