summaryrefslogtreecommitdiff
path: root/lib/Graphics/Fountainhead/Parser.hs
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2024-02-06 12:14:07 +0100
committerEugen Wissner <belka@caraus.de>2024-02-06 12:14:07 +0100
commit23271d6f6cf033230106f07ae14985f3b85f906a (patch)
tree4299eb1ccae58f52a450bf86497b311e1f31ccad /lib/Graphics/Fountainhead/Parser.hs
parent3160ceab080fca8fef0cf2cf196b46284d15c19f (diff)
downloadfountainhead-23271d6f6cf033230106f07ae14985f3b85f906a.tar.gz
Add an option for dumping a single table
Diffstat (limited to 'lib/Graphics/Fountainhead/Parser.hs')
-rw-r--r--lib/Graphics/Fountainhead/Parser.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Graphics/Fountainhead/Parser.hs b/lib/Graphics/Fountainhead/Parser.hs
index 31dcd0e..672f9fc 100644
--- a/lib/Graphics/Fountainhead/Parser.hs
+++ b/lib/Graphics/Fountainhead/Parser.hs
@@ -13,6 +13,7 @@
module Graphics.Fountainhead.Parser
( Parser
, ParseErrorBundle
+ , ParseState
, cmapTableP
, cvTableP
, f2Dot14P
@@ -154,6 +155,7 @@ import qualified Text.Megaparsec.Byte.Binary as Megaparsec.Binary
type Parser = Megaparsec.Parsec Void ByteString
type ParseErrorBundle = Megaparsec.ParseErrorBundle ByteString Void
+type ParseState = Megaparsec.State ByteString Void
-- * Font directory
@@ -953,7 +955,7 @@ fixedP = Fixed32 . fromIntegral <$> Megaparsec.Binary.word32be
parseTable
:: TableDirectory
-> Parser a
- -> Megaparsec.State ByteString Void
+ -> ParseState
-> Either ParseErrorBundle a
parseTable TableDirectory{ offset, length = length' } parser state = snd
$ Megaparsec.runParser' parser