Parsing: use safeRead instead of read.

This commit is contained in:
John MacFarlane
2018-12-17 10:21:30 -08:00
parent 15d3cf8070
commit 90c820dc4e
+1 -1
View File
@@ -736,7 +736,7 @@ lowerRoman = do
decimal :: Stream s m Char => ParserT s st m (ListNumberStyle, Int)
decimal = do
num <- many1 digit
return (Decimal, read num)
return (Decimal, fromMaybe 1 $ safeRead num)
-- | Parses a '@' and optional label and
-- returns (DefaultStyle, [next example number]). The next