Skip to content

Commit

Permalink
Fix compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
emmabastas committed Jul 24, 2021
1 parent 69c4780 commit 092ebd1
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions elm-format-lib/src/Parse/ParsecAdapter.hs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ import Parse.Primitives (Row, Col)
import qualified Parse.Primitives as EP
import Parse.State (State(..))

import qualified Control.Applicative as Applicative ( Applicative(..), Alternative(..) )
import qualified Control.Applicative as Applicative
import Control.Monad (MonadPlus(..), mzero, liftM)
import qualified Control.Monad.Fail as Fail

Expand All @@ -93,9 +93,8 @@ import qualified Data.Char as C
import qualified Data.ByteString as B
import qualified Data.ByteString.Internal as B

import Foreign.Ptr (Ptr, plusPtr)
import Foreign.Storable (peek)
import Foreign.ForeignPtr (ForeignPtr, touchForeignPtr)
import Foreign.Ptr (plusPtr)
import Foreign.ForeignPtr (touchForeignPtr)
import Foreign.ForeignPtr.Unsafe (unsafeForeignPtrToPtr)


Expand Down Expand Up @@ -216,7 +215,7 @@ try (EP.Parser parser) =
-- with a single `many_` call?
many :: Parser a -> Parser [a]
many (EP.Parser p) =
EP.Parser $ \s cok eok cerr eerr ->
EP.Parser $ \s cok eok cerr _ ->
let
many_ acc x s' =
p
Expand All @@ -236,7 +235,7 @@ many (EP.Parser p) =

skipMany ::Parser a -> Parser ()
skipMany (EP.Parser p) =
EP.Parser $ \s cok eok cerr eerr ->
EP.Parser $ \s cok _ cerr _ ->
let
skipMany_ s' =
p
Expand All @@ -251,6 +250,7 @@ skipMany (EP.Parser p) =

-- Note that causing a runtime crash when using `many` or `skipMany` with a
-- parser that does not consume is the same behaviour as it was with parsec.
parserDoesNotConsumeErr :: a
parserDoesNotConsumeErr = error "Text.Parsec.Prim.many: combinator 'many' is applied to a parser that accepts an empty string."


Expand Down Expand Up @@ -336,7 +336,7 @@ getState =

updateState :: (State -> State) -> Parser ()
updateState f =
do updateParserState
do _ <- updateParserState
(\(EP.State src pos end indent row col sourceName newline) ->
let
(State newline') = f (State newline)
Expand Down Expand Up @@ -453,7 +453,7 @@ setErrorMessage msg (ParseError sourceName row col msgs)


mergeError :: ParseError -> ParseError -> ParseError
mergeError e1@(ParseError sn1 r1 c1 msgs1) e2@(ParseError sn2 r2 c2 msgs2)
mergeError e1@(ParseError sn1 r1 c1 msgs1) e2@(ParseError _ r2 c2 msgs2)
-- prefer meaningful errors
| null msgs2 && not (null msgs1) = e1
| null msgs1 && not (null msgs2) = e2
Expand Down Expand Up @@ -579,7 +579,6 @@ eof :: Parser ()
eof = notFollowedBy anyToken <?> "end of input"



-- Text.Parsec.Char


Expand Down

0 comments on commit 092ebd1

Please # to comment.