summaryrefslogtreecommitdiff
path: root/src/Parser/Statement.hs
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2024-09-28 09:30:36 +0200
committerRoman Smrž <roman.smrz@seznam.cz>2024-09-28 10:17:39 +0200
commit08d319f0105ed4b2fd217e0a9e96333e4c786095 (patch)
treed0f87ec3b495d21dd0f0ef32a03682f7f9f3a4ca /src/Parser/Statement.hs
parentafd550dc8245e61ab6b148c72cdf133e6b7836d1 (diff)
Require parentheses around complex command arguments
Diffstat (limited to 'src/Parser/Statement.hs')
-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 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 _ = "<variable>"
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