git.iko.soy/typeable/pandoc
on master help sign in
Avoid incomplete pattern patch.
1e04397John MacFarlane
src/Text/Pandoc/Parsing.hs+8−5
@@ -518,11 +518,14 @@ charsInBalanced open close parser = try $ do
518romanNumeral :: Stream s m Char => Bool -- ^ Uppercase if true
518romanNumeral :: Stream s m Char => Bool -- ^ Uppercase if true
519 -> ParserT s st m Int
519 -> ParserT s st m Int
520romanNumeral upperCase = do
520romanNumeral upperCase = do
521− let [one, five, ten, fifty, hundred, fivehundred, thousand] =
522− map char $
523− if upperCase
521+ let rchar uc = char $ if upperCase then uc else toLower uc
524− then ['I','V','X','L','C','D','M']
522+ let one = rchar 'I'
525− else ['i','v','x','l','c','d','m']
523+ let five = rchar 'V'
524+ let ten = rchar 'X'
525+ let fifty = rchar 'L'
526+ let hundred = rchar 'C'
527+ let fivehundred = rchar 'D'
528+ let thousand = rchar 'M'
526 lookAhead $ choice [one, five, ten, fifty, hundred, fivehundred, thousand]
529 lookAhead $ choice [one, five, ten, fifty, hundred, fivehundred, thousand]
527 thousands <- ((1000 *) . length) <$> many thousand
530 thousands <- ((1000 *) . length) <$> many thousand
528 ninehundreds <- option 0 $ try $ hundred >> thousand >> return 900
531 ninehundreds <- option 0 $ try $ hundred >> thousand >> return 900