Safe Haskell | None |
---|---|
Language | Haskell2010 |
Unicode character database parsers
Synopsis
- parseCodePointValue :: Parser CodePoint
- parseCodePoint :: Parser CodePoint
- parseCodePointRange :: Parser CodePointRange
- parseCodePointValueOrRange :: Parser (Either CodePoint CodePointRange)
- parseCommentLine :: Parser String
- skipCommentLines :: Parser a -> Parser [a]
- parseFile :: Lift a => FilePath -> Parser a -> ExpQ
- stripComments :: Parser [String]
- parseBlocks :: Parser [(CodePointRange, String)]
- parseDerivedName :: Parser [(Either CodePoint CodePointRange, String)]
Documentation
parseCodePointValue :: Parser CodePoint Source #
Parse a code-point value without the "U+" prefix
>>>
runParser parseCodePointValue "" "1234"
Right U+1234
parseCodePoint :: Parser CodePoint Source #
Parse a code-point value with the "U+" prefix
>>>
runParser parseCodePoint "" "U+1234"
Right U+1234
parseCodePointRange :: Parser CodePointRange Source #
Parse a range of code-points separated by ".."
>>>
runParser parseCodePointRange "" "1234..5678"
Right U+1234..U+5678
parseCodePointValueOrRange :: Parser (Either CodePoint CodePointRange) Source #
Parse either a range of code-points or a single code-point
>>>
runParser parseCodePointValueOrRange "" "1234..5678"
Right (Right U+1234..U+5678)
>>>
runParser parseCodePointValueOrRange "" "1234"
Right (Left U+1234)
parseCommentLine :: Parser String Source #
Parse a comment line ("^# ...eol")
>>>
runParser parseCommentLine "" "# comment"
Right " comment"
skipCommentLines :: Parser a -> Parser [a] Source #
Parse valid line with the given parser, skipping comment lines
parseFile :: Lift a => FilePath -> Parser a -> ExpQ Source #
Parse a file and lift the result into a TH expression
stripComments :: Parser [String] Source #
Strip comments
File specific
parseBlocks :: Parser [(CodePointRange, String)] Source #
Parse Blocks.txt file
parseDerivedName :: Parser [(Either CodePoint CodePointRange, String)] Source #
Parse DerivedName.txt file