From e582f5e50801a041515088078b6a9fb1743af3fe Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Wed, 17 Oct 2007 13:42:13 +0000 Subject: [PATCH] Changed the terminator in Rain source files from A.Main to A.Several (with an empty list), and updated the tests accordingly --- frontends/ParseRain.hs | 2 +- frontends/ParseRainTest.hs | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/frontends/ParseRain.hs b/frontends/ParseRain.hs index e7a906e..3d2e8d2 100644 --- a/frontends/ParseRain.hs +++ b/frontends/ParseRain.hs @@ -397,7 +397,7 @@ declaration = try $ do {t <- dataType; sColon ; ns <- name `sepBy1` sComma ; sSe foldSpec t n = A.Spec (findMeta t) $ A.Specification (findMeta t) n $ A.Declaration (findMeta t) t terminator :: A.Structured -terminator = (A.OnlyP emptyMeta $ A.Main emptyMeta) +terminator = A.Several emptyMeta [] processDecl :: RainParser A.Structured processDecl = do {m <- sProcess ; procName <- name ; params <- tupleDef ; body <- block ; diff --git a/frontends/ParseRainTest.hs b/frontends/ParseRainTest.hs index 8a01fe9..a581a0f 100644 --- a/frontends/ParseRainTest.hs +++ b/frontends/ParseRainTest.hs @@ -385,32 +385,32 @@ testTopLevelDecl = (tag3 A.Specification DontCare (simpleNamePattern "noargs") $ tag4 A.Proc DontCare A.PlainSpec ([] :: [A.Formal]) (tag2 A.Seq DontCare $ tag2 A.Several DontCare ([] :: [A.Structured])) ) - (tag2 A.OnlyP DontCare $ tag1 A.Main DontCare)] + (tag2 A.Several DontCare ([] :: [A.Structured]))] ) , pass ("process noargs() par {}", RP.topLevelDecl, assertPatternMatch "testTopLevelDecl 0b" $ tag2 A.Several DontCare [tag3 A.Spec DontCare (tag3 A.Specification DontCare (simpleNamePattern "noargs") $ tag4 A.Proc DontCare A.PlainSpec ([] :: [A.Formal]) (tag3 A.Par DontCare A.PlainPar $ tag2 A.Several DontCare ([] :: [A.Structured])) ) - (tag2 A.OnlyP DontCare $ tag1 A.Main DontCare)] + (tag2 A.Several DontCare ([] :: [A.Structured]))] ) , pass ("process onearg(int: x) {x = 0;}", RP.topLevelDecl, assertPatternMatch "testTopLevelDecl 1" $ tag2 A.Several DontCare [tag3 A.Spec DontCare (tag3 A.Specification DontCare (simpleNamePattern "onearg") $ tag4 A.Proc DontCare A.PlainSpec [tag3 A.Formal A.ValAbbrev A.Int (simpleNamePattern "x")] (tag2 A.Seq DontCare $ tag2 A.Several DontCare [tag2 A.OnlyP DontCare $ makeAssignPattern (variablePattern "x") (intLiteralPattern 0)]) ) - (tag2 A.OnlyP DontCare $ tag1 A.Main DontCare)] + (tag2 A.Several DontCare ([] :: [A.Structured]))] ) ,pass ("process noargs0() {} process noargs1 () {}", RP.topLevelDecl, assertPatternMatch "testTopLevelDecl 2" $ tag2 A.Several DontCare [ tag3 A.Spec DontCare (tag3 A.Specification DontCare (simpleNamePattern "noargs0") $ tag4 A.Proc DontCare A.PlainSpec ([] :: [A.Formal]) (tag2 A.Seq DontCare $ tag2 A.Several DontCare ([] :: [A.Structured])) - ) (tag2 A.OnlyP DontCare $ tag1 A.Main DontCare) + ) (tag2 A.Several DontCare ([] :: [A.Structured])) ,tag3 A.Spec DontCare (tag3 A.Specification DontCare (simpleNamePattern "noargs1") $ tag4 A.Proc DontCare A.PlainSpec ([] :: [A.Formal]) (tag2 A.Seq DontCare $ tag2 A.Several DontCare ([] :: [A.Structured])) - ) (tag2 A.OnlyP DontCare $ tag1 A.Main DontCare) + ) (tag2 A.Several DontCare ([] :: [A.Structured])) ] ) , fail ("process", RP.topLevelDecl) @@ -428,7 +428,7 @@ testTopLevelDecl = (tag3 A.Specification DontCare (simpleNamePattern "cons") $ tag5 A.Function DontCare A.PlainSpec [A.Byte] ([] :: [A.Formal]) $ (tag2 A.OnlyP DontCare $ tag2 A.Seq DontCare $ tag2 A.Several DontCare ([] :: [A.Structured])) - ) (tag2 A.OnlyP DontCare $ tag1 A.Main DontCare) + ) (tag2 A.Several DontCare ([] :: [A.Structured])) ] ) @@ -437,7 +437,7 @@ testTopLevelDecl = (tag3 A.Specification DontCare (simpleNamePattern "f") $ tag5 A.Function DontCare A.PlainSpec [A.Byte] [tag3 A.Formal A.ValAbbrev A.Byte (simpleNamePattern "x")] $ (tag2 A.OnlyP DontCare $ tag2 A.Seq DontCare $ tag2 A.Several DontCare ([] :: [A.Structured])) - ) (tag2 A.OnlyP DontCare $ tag1 A.Main DontCare) + ) (tag2 A.Several DontCare ([] :: [A.Structured])) ] ) @@ -446,7 +446,7 @@ testTopLevelDecl = (tag3 A.Specification DontCare (simpleNamePattern "id") $ tag5 A.Function DontCare A.PlainSpec [A.Byte] [tag3 A.Formal A.ValAbbrev A.Byte (simpleNamePattern "x")] $ (tag2 A.OnlyP DontCare $ tag2 A.Seq DontCare $ tag2 A.Several DontCare [tag2 A.OnlyEL DontCare $ tag2 A.ExpressionList DontCare [exprVariablePattern "x"]]) - ) (tag2 A.OnlyP DontCare $ tag1 A.Main DontCare) + ) (tag2 A.Several DontCare ([] :: [A.Structured])) ] ) ]