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(..)
|
, Structure(..), XRefEntry(..), XRefSection, XRefSubSection(..)
|
||||||
, blank, dictionary, directObject, integer, line
|
, 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 {
|
data UserState = UserState {
|
||||||
input :: ByteString
|
input :: ByteString
|
||||||
|
@ -110,7 +110,8 @@ indirectObjCoordinates = do
|
||||||
return coordinates
|
return coordinates
|
||||||
|
|
||||||
occurrence :: SParser Occurrence
|
occurrence :: SParser Occurrence
|
||||||
occurrence = Comment <$> comment <|> Indirect <$> indirectObjCoordinates
|
occurrence =
|
||||||
|
Comment <$> comment <|> Indirect <$> indirectObjCoordinates <?> "comment or object"
|
||||||
|
|
||||||
populate :: ByteString -> InputStructure -> Content
|
populate :: ByteString -> InputStructure -> Content
|
||||||
populate input structure =
|
populate input structure =
|
||||||
|
|
|
@ -46,7 +46,7 @@ import PDF.Parser (
|
||||||
import Text.Printf (printf)
|
import Text.Printf (printf)
|
||||||
|
|
||||||
line :: String -> Parser u ()
|
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 :: ByteString
|
||||||
magicNumber = "%PDF-"
|
magicNumber = "%PDF-"
|
||||||
|
|
Loading…
Reference in a new issue