Skip to content

Commit

Permalink
Remove unnecessary partiality from kludgeAwayQuotes
Browse files Browse the repository at this point in the history
  • Loading branch information
josephcsible committed Dec 19, 2023
1 parent c97abdb commit c1452e0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/ShellCheck/Parser.hs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import Text.Parsec.Error
import Text.Parsec.Pos
import qualified Control.Monad.Reader as Mr
import qualified Control.Monad.State as Ms
import qualified Data.List.NonEmpty as NE
import qualified Data.Map.Strict as Map

import Test.QuickCheck.All (quickCheckAll)
Expand Down Expand Up @@ -2904,8 +2905,8 @@ readLetSuffix = many1 (readIoRedirect <|> try readLetExpression <|> readCmdWord)
kludgeAwayQuotes :: String -> SourcePos -> (String, SourcePos)
kludgeAwayQuotes s p =
case s of
first:rest@(_:_) ->
let (last:backwards) = reverse rest
first:second:rest ->
let (last NE.:| backwards) = NE.reverse (second NE.:| rest)
middle = reverse backwards
in
if first `elem` "'\"" && first == last
Expand Down

0 comments on commit c1452e0

Please sign in to comment.