summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2026-08-22 23:53:57 +0200
committerRoman Smrž <roman.smrz@seznam.cz>2026-08-23 00:16:38 +0200
commitc071c53a8fbbed9e5a66ba3e939909bf45296128 (patch)
tree5b0c4f1fd4816bd3ab0b92de08a27949be29e70e /src
parent7a0c86835b8bd34c5bbaa0194e298c431d8b2c05 (diff)
Fix parsing statements using innerBlock without new variablesHEADmaster
Changelog: Fixed parsing of disconnect and packet loss commands.
Diffstat (limited to 'src')
-rw-r--r--src/Parser/Statement.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Parser/Statement.hs b/src/Parser/Statement.hs
index 67f2f88..1c1b805 100644
--- a/src/Parser/Statement.hs
+++ b/src/Parser/Statement.hs
@@ -295,7 +295,7 @@ instance ExprType a => ParamType (InnerBlock a) where
combine _ [] = error "inner block parameter count mismatch"
innerBlock :: CommandDef (TestStep ())
-innerBlock = ($ ([] :: [ Void ])) <$> innerBlockFun
+innerBlock = ($ ([] :: [ Void ])) <$> innerBlockFunList
innerBlockFun :: ExprType a => CommandDef (a -> TestStep ())
innerBlockFun = (\f x -> f [ x ]) <$> innerBlockFunList
@@ -336,6 +336,9 @@ command name (CommandDef types ctor) = do
, Just (Refl :: p :~: InnerBlock a) <- eqT
-> SomeParam p . Identity . ( vars, ) <$> restOfParts cmdi partials
+ | Just (Refl :: p :~: InnerBlock Void) <- eqT
+ -> SomeParam p . Identity . ( [], ) <$> restOfParts cmdi partials
+
(sym, SomeParam p Nothing) -> choice
[ SomeParam p . Identity <$> paramDefault p
, fail $ "missing " ++ (if null sym then "" else "'" ++ sym ++ "' ") ++ showParamType p