From c071c53a8fbbed9e5a66ba3e939909bf45296128 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Sat, 22 Aug 2026 23:53:57 +0200 Subject: Fix parsing statements using innerBlock without new variables Changelog: Fixed parsing of disconnect and packet loss commands. --- src/Parser/Statement.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/Parser/Statement.hs') 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 -- cgit v1.2.3