Simplify parser

This commit is contained in:
Joseph C. Sible 2020-12-28 16:32:10 -05:00
parent 35033a9f2f
commit eaccd3d02c
1 changed files with 2 additions and 2 deletions

View File

@ -392,7 +392,7 @@ unexpecting s p = try $
notFollowedBy2 = unexpecting "" notFollowedBy2 = unexpecting ""
isFollowedBy p = (lookAhead . try $ p *> return True) <|> return False isFollowedBy p = (lookAhead . try $ p $> True) <|> return False
reluctantlyTill p end = reluctantlyTill p end =
(lookAhead (void (try end) <|> eof) >> return []) <|> do (lookAhead (void (try end) <|> eof) >> return []) <|> do
@ -2715,7 +2715,7 @@ readConditionCommand = do
pos <- getPosition pos <- getPosition
hasDashAo <- isFollowedBy $ do hasDashAo <- isFollowedBy $ do
c <- choice $ map (\s -> try $ string s) ["-o", "-a", "or", "and"] c <- choice $ try . string <$> ["-o", "-a", "or", "and"]
posEnd <- getPosition posEnd <- getPosition
parseProblemAtWithEnd pos posEnd ErrorC 1139 $ parseProblemAtWithEnd pos posEnd ErrorC 1139 $
"Use " ++ alt c ++ " instead of '" ++ c ++ "' between test commands." "Use " ++ alt c ++ " instead of '" ++ c ++ "' between test commands."