Try and fix stuff by generalizing a signature to ease debugging and add parenthesis which I think should have been here all along
This commit is contained in:
parent
3b59fd0c61
commit
32efdcdd6b
1 changed files with 4 additions and 4 deletions
|
@ -1,8 +1,8 @@
|
||||||
{-# LANGUAGE OverloadedStrings #-}
|
{-# LANGUAGE OverloadedStrings #-}
|
||||||
module PDF.Text (
|
module PDF.Text {-(
|
||||||
PageContents(..)
|
PageContents(..)
|
||||||
, pageContents
|
, pageContents
|
||||||
) where
|
)-} where
|
||||||
|
|
||||||
import Control.Applicative ((<|>))
|
import Control.Applicative ((<|>))
|
||||||
import Control.Monad (foldM, join)
|
import Control.Monad (foldM, join)
|
||||||
|
@ -61,7 +61,7 @@ textOperator Tf = (,) Tf <$> sequence [Typed . NameObject <$> name, argument] <*
|
||||||
textOperator Tr = (,) Tr <$> count 1 argument <* string "Tr"
|
textOperator Tr = (,) Tr <$> count 1 argument <* string "Tr"
|
||||||
textOperator Ts = (,) Ts <$> count 1 argument <* string "Ts"
|
textOperator Ts = (,) Ts <$> count 1 argument <* string "Ts"
|
||||||
|
|
||||||
a :: (Bounded o, Enum o) => (o -> ParserWithFont (Call o)) -> ParserWithFont (Call o)
|
a :: (Bounded o, Enum o, MonadParser m) => (o -> m (Call o)) -> m (Call o)
|
||||||
a parserGenerator = choice $ parserGenerator <$> [minBound .. maxBound]
|
a parserGenerator = choice $ parserGenerator <$> [minBound .. maxBound]
|
||||||
|
|
||||||
argument :: MonadParser m => m Argument
|
argument :: MonadParser m => m Argument
|
||||||
|
@ -84,7 +84,7 @@ graphicState :: ParserWithFont [ByteString]
|
||||||
graphicState =
|
graphicState =
|
||||||
string "q" *> blank *> insideQ <* string "Q"
|
string "q" *> blank *> insideQ <* string "Q"
|
||||||
where
|
where
|
||||||
insideQ = join <$> (command <|> page `sepBy` blank )
|
insideQ = join <$> ((command <|> page) `sepBy` blank )
|
||||||
command = a stateOperator *> return []
|
command = a stateOperator *> return []
|
||||||
|
|
||||||
text :: ParserWithFont [ByteString]
|
text :: ParserWithFont [ByteString]
|
||||||
|
|
Loading…
Reference in a new issue