Skip to content

Commit d3001f3

Browse files
committedDec 14, 2024·
Simplify getParseOutput
1 parent 7deb7e8 commit d3001f3

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed
 

‎src/ShellCheck/Parser.hs

+6-6
Original file line numberDiff line numberDiff line change
@@ -3451,12 +3451,12 @@ isNotOk p s = parsesCleanly p s == Nothing -- The string does not parse
34513451
-- If the parser matches the string, return Right [ParseNotes+ParseProblems]
34523452
-- If it does not match the string, return Left [ParseProblems]
34533453
getParseOutput parser string = runIdentity $ do
3454-
(res, sys) <- runParser testEnvironment
3455-
(parser >> eof >> getState) "-" string
3456-
case (res, sys) of
3457-
(Right userState, systemState) ->
3458-
return $ Right $ parseNotes userState ++ parseProblems systemState
3459-
(Left _, systemState) -> return $ Left $ parseProblems systemState
3454+
(res, systemState) <- runParser testEnvironment
3455+
(parser >> eof >> getState) "-" string
3456+
return $ case res of
3457+
Right userState ->
3458+
Right $ parseNotes userState ++ parseProblems systemState
3459+
Left _ -> Left $ parseProblems systemState
34603460

34613461
-- If the parser matches the string, return Just whether it was clean (without emitting suggestions)
34623462
-- Otherwise, Nothing

0 commit comments

Comments
 (0)
Please sign in to comment.