summaryrefslogtreecommitdiff
path: root/src/Parser.hs
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2024-11-10 11:25:29 +0100
committerRoman Smrž <roman.smrz@seznam.cz>2024-11-12 22:45:56 +0100
commit20f8105e32b5c8d97b67f32b751f01904252ac1f (patch)
treeaff5500ef7567835715922e3f176abb7b3419eea /src/Parser.hs
parent6447095bcffd101507afb65854da22bd4ee6fcaa (diff)
Remove ExprStatement in favor of using Expr TestBlock
Diffstat (limited to 'src/Parser.hs')
-rw-r--r--src/Parser.hs7
1 files changed, 3 insertions, 4 deletions
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