diff options
author | Roman Smrž <roman.smrz@seznam.cz> | 2025-05-14 18:51:26 +0200 |
---|---|---|
committer | Roman Smrž <roman.smrz@seznam.cz> | 2025-05-14 18:51:26 +0200 |
commit | be0e2017b46e981060b1f9f5fd764571ad2dc2a1 (patch) | |
tree | 1897c90e2d72fe495976850deb71ca27541dc8ac /src/Parser/Statement.hs | |
parent | 077cfa3e35330ec982c0b4c9047c0956d04d1103 (diff) |
Diffstat (limited to 'src/Parser/Statement.hs')
-rw-r--r-- | src/Parser/Statement.hs | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/Parser/Statement.hs b/src/Parser/Statement.hs index 812c559..d843fc8 100644 --- a/src/Parser/Statement.hs +++ b/src/Parser/Statement.hs @@ -98,12 +98,6 @@ shellStatement = do , do off <- stateOffset <$> getParserState symbol ":" - pname <- case mbpname of - Just pname -> return pname - Nothing -> do - registerParseError $ FancyError off $ S.singleton $ ErrorFail $ - "missing parameter with keyword ‘as’" - return $ TypedVarName (VarName "") node <- case mbnode of Just node -> return node Nothing -> do @@ -115,8 +109,10 @@ shellStatement = do void $ L.indentGuard scn GT ref script <- shellScript cont <- testBlock ref + let expr | Just pname <- mbpname = LambdaAbstraction pname cont + | otherwise = const <$> cont return $ TestBlockStep EmptyTestBlock <$> - (SpawnShell pname <$> node <*> script <*> LambdaAbstraction pname cont) + (SpawnShell mbpname <$> node <*> script <*> expr) ] exprStatement :: TestParser (Expr (TestBlock ())) |