Fix bypassed error message for lines + add one for occurrences
This commit is contained in:
parent
11cb6504d7
commit
85e4eb9273
2 changed files with 4 additions and 3 deletions
|
@ -17,7 +17,7 @@ import PDF.Object (
|
|||
, Structure(..), XRefEntry(..), XRefSection, XRefSubSection(..)
|
||||
, blank, dictionary, directObject, integer, line
|
||||
)
|
||||
import PDF.Parser (Parser, block, char, on, runParser, takeAll)
|
||||
import PDF.Parser (Parser, (<?>), block, char, on, option, runParser, takeAll)
|
||||
|
||||
data UserState = UserState {
|
||||
input :: ByteString
|
||||
|
@ -110,7 +110,8 @@ indirectObjCoordinates = do
|
|||
return coordinates
|
||||
|
||||
occurrence :: SParser Occurrence
|
||||
occurrence = Comment <$> comment <|> Indirect <$> indirectObjCoordinates
|
||||
occurrence =
|
||||
Comment <$> comment <|> Indirect <$> indirectObjCoordinates <?> "comment or object"
|
||||
|
||||
populate :: ByteString -> InputStructure -> Content
|
||||
populate input structure =
|
||||
|
|
|
@ -46,7 +46,7 @@ import PDF.Parser (
|
|||
import Text.Printf (printf)
|
||||
|
||||
line :: String -> Parser u ()
|
||||
line l = string (BS.pack l) *> EOL.parser *> return () <?> printf "line «%s»" l
|
||||
line l = (string (BS.pack l) *> EOL.parser *> return ()) <?> printf "line «%s»" l
|
||||
|
||||
magicNumber :: ByteString
|
||||
magicNumber = "%PDF-"
|
||||
|
|
Loading…
Reference in a new issue