From 08d319f0105ed4b2fd217e0a9e96333e4c786095 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Sat, 28 Sep 2024 09:30:36 +0200 Subject: Require parentheses around complex command arguments --- 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 6434a53..2d45a21 100644 --- a/src/Parser/Statement.hs +++ b/src/Parser/Statement.hs @@ -91,7 +91,10 @@ instance ExprType a => ParamType (TypedVarName a) where showParamType _ = "" instance ExprType a => ParamType (Expr a) where - parseParam _ = typedExpr + parseParam _ = do + off <- stateOffset <$> getParserState + SomeExpr e <- literal <|> variable <|> between (symbol "(") (symbol ")") someExpr + unifyExpr off Proxy e showParamType _ = "<" ++ T.unpack (textExprType @a Proxy) ++ ">" instance ParamType a => ParamType [a] where -- cgit v1.2.3