From be0e2017b46e981060b1f9f5fd764571ad2dc2a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Wed, 14 May 2025 18:51:26 +0200 Subject: Make shell process name optional --- src/Parser/Statement.hs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/Parser/Statement.hs') 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 ())) -- cgit v1.2.3