Commit fe660ddf authored by Chaitanya Koparkar's avatar Chaitanya Koparkar

Fix a -Wincomplete-uni-patterns warning

This warning will soon be enabled by -Wall.

Reviewers: bgamari

GHC Trac Issues: #15656

Differential Revision: https://phabricator.haskell.org/D5442
parent 26780988
......@@ -51,13 +51,18 @@ instance Show HpcPos where
instance Read HpcPos where
readsPrec _i pos = [(toHpcPos (read l1,read c1,read l2,read c2),after)]
where
(before,after) = span (/= ',') pos
(before,after) = span (/= ',') pos
parseError a = error $ "Read HpcPos: Could not parse: " ++ show a
(lhs0,rhs0) = case span (/= '-') before of
(lhs,'-':rhs) -> (lhs,rhs)
(lhs,"") -> (lhs,lhs)
_ -> error "bad parse"
(l1,':':c1) = span (/= ':') lhs0
(l2,':':c2) = span (/= ':') rhs0
_ -> parseError before
(l1,c1) = case span (/= ':') lhs0 of
(l,':':c) -> (l,c)
_ -> parseError lhs0
(l2,c2) = case span (/= ':') rhs0 of
(l,':':c) -> (l,c)
_ -> parseError rhs0
------------------------------------------------------------------------------
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment