From 20f8105e32b5c8d97b67f32b751f01904252ac1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Sun, 10 Nov 2024 11:25:29 +0100 Subject: Remove ExprStatement in favor of using Expr TestBlock --- src/Parser.hs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/Parser.hs') diff --git a/src/Parser.hs b/src/Parser.hs index e63f854..4b1e69a 100644 --- a/src/Parser.hs +++ b/src/Parser.hs @@ -30,7 +30,7 @@ import Test.Builtins parseTestDefinition :: TestParser Toplevel parseTestDefinition = label "test definition" $ toplevel ToplevelTest $ do - block (\name steps -> return $ Test name $ concat steps) header testStep + block (\name steps -> return $ Test name $ mconcat steps) header testStep where header = do wsymbol "test" lexeme $ TL.toStrict <$> takeWhileP (Just "test name") (/=':') @@ -44,11 +44,10 @@ parseDefinition = label "symbol definition" $ toplevel ToplevelDefinition $ do [ do symbol ":" let finish steps = do - return $ ( name, ) $ SomeVarValue mempty $ \_ _ -> TestBlock $ - concat steps + return $ ( name, SomeExpr $ mconcat steps ) return $ L.IndentSome Nothing finish testStep ] - modify $ \s -> s { testVars = fmap someVarValueType def : testVars s } + modify $ \s -> s { testVars = fmap someExprType def : testVars s } return def parseTestModule :: FilePath -> TestParser Module -- cgit v1.2.3