File tree Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -426,10 +426,14 @@ peekWord8' = T.Parser $ \t pos more lose succ ->
426426 in ensureSuspended 1 t pos more lose succ'
427427{-# INLINE peekWord8' #-}
428428
429- -- | Match either a single newline character @\'\\n\'@, or a carriage
430- -- return followed by a newline character @\"\\r\\n\"@.
429+ -- | Match a carriage return followed by a newline character @\"\\r\\n\"@,
430+ -- a single newline character @\'\\n\'@, or a single carriage return
431+ -- @\'\\r\'@.
431432endOfLine :: Parser ()
432- endOfLine = (word8 10 >> return () ) <|> (string " \r\n " >> return () )
433+ endOfLine =
434+ (string " \r\n " >> return () )
435+ <|> (word8 10 >> return () )
436+ <|> (word8 13 >> return () )
433437
434438-- | Terminal failure continuation.
435439failK :: Failure a
Original file line number Diff line number Diff line change @@ -428,10 +428,14 @@ peekChar' = do
428428 return $! T. unsafeHead s
429429{-# INLINE peekChar' #-}
430430
431- -- | Match either a single newline character @\'\\n\'@, or a carriage
432- -- return followed by a newline character @\"\\r\\n\"@.
431+ -- | Match a carriage return followed by a newline character @\"\\r\\n\"@,
432+ -- a single newline character @\'\\n\'@, or a single carriage return
433+ -- @\'\\r\'@.
433434endOfLine :: Parser ()
434- endOfLine = (char ' \n ' >> return () ) <|> (string " \r\n " >> return () )
435+ endOfLine =
436+ (string " \r\n " >> return () )
437+ <|> (char ' \n ' >> return () )
438+ <|> (char ' \r ' >> return () )
435439
436440-- | Terminal failure continuation.
437441failK :: Failure a
You can’t perform that action at this time.
0 commit comments