summaryrefslogtreecommitdiff
path: root/src/Parser/Expr.hs
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2025-01-26 22:31:20 +0100
committerRoman Smrž <roman.smrz@seznam.cz>2025-01-28 21:40:27 +0100
commit9251a72e7876b61ede972136570e2b81c6a8d767 (patch)
tree16bff970448ef8a172b82239fd4b078fa8f80ef5 /src/Parser/Expr.hs
parent340d408024980bddac83971dbef7d6a17c407382 (diff)
Do not accept plain variable as the last keywordless parameter
Diffstat (limited to 'src/Parser/Expr.hs')
-rw-r--r--src/Parser/Expr.hs20
1 files changed, 4 insertions, 16 deletions
diff --git a/src/Parser/Expr.hs b/src/Parser/Expr.hs
index 5ff3f15..d8d96eb 100644
--- a/src/Parser/Expr.hs
+++ b/src/Parser/Expr.hs
@@ -415,22 +415,10 @@ functionArguments check param lit promote = do
[ T.pack "multiple unnamed parameters" ]
parseArgs False
- ,do off <- stateOffset <$> getParserState
- x <- identifier
- choice
- [do off' <- stateOffset <$> getParserState
- y <- pparam <|> (promote off' =<< identifier)
- checkAndInsert off' (Just (ArgumentKeyword x)) y $ parseArgs allowUnnamed
-
- ,if allowUnnamed
- then do
- y <- promote off x
- checkAndInsert off Nothing y $ return M.empty
- else do
- registerParseError $ FancyError off $ S.singleton $ ErrorFail $ T.unpack $ T.concat
- [ T.pack "multiple unnamed parameters" ]
- return M.empty
- ]
+ ,do x <- identifier
+ off <- stateOffset <$> getParserState
+ y <- pparam <|> (promote off =<< identifier)
+ checkAndInsert off (Just (ArgumentKeyword x)) y $ parseArgs allowUnnamed
,do return M.empty
]