| Copyright | (c) 2024 Pierre Le Marre |
|---|---|
| Maintainer | [email protected] |
| Stability | experimental |
| Safe Haskell | None |
| Language | GHC2021 |
UCD.Parser.Common
Description
Miscellaneous bits common to various parsers
Synopsis
- readCodePoint :: ByteString -> Char
- readCodePointM :: ByteString -> Maybe Char
- data UnicodeRange a
- = SingleChar {
- _first :: !Char
- | CharRange {
- _first :: !Char
- _last :: !Char
- _rangeName :: !a
- = SingleChar {
- parseRange :: ByteString -> UnicodeRange ()
- pattern Comma :: Word8
- pattern HashTag :: Word8
- pattern NewLine :: Word8
- pattern Period :: Word8
- pattern SemiColon :: Word8
- pattern Slash :: Word8
Documentation
readCodePoint :: ByteString -> Char Source #
Parse a code point formatted as hexadecimal
Warning: raise an error on invalid input.
>>>readCodePoint "0061"'a'
Since: 0.1.0
readCodePointM :: ByteString -> Maybe Char Source #
Parse a code point formatted as hexadecimal, or return Nothing on an
empty string.
Warning: raise an error on invalid input.
>>>readCodePointM "0061"Just 'a'>>>readCodePointM ""Nothing
See also: readCodePoint.
Since: 0.1.0
data UnicodeRange a Source #
A Unicode code point range
Since: 0.1.0
Constructors
| SingleChar | |
Fields
| |
| CharRange | |
Fields
| |
Instances
| Show a => Show (UnicodeRange a) Source # | |
Defined in UCD.Parser.Common Methods showsPrec :: Int -> UnicodeRange a -> ShowS show :: UnicodeRange a -> String showList :: [UnicodeRange a] -> ShowS | |
| Eq a => Eq (UnicodeRange a) Source # | |
Defined in UCD.Parser.Common Methods (==) :: UnicodeRange a -> UnicodeRange a -> Bool (/=) :: UnicodeRange a -> UnicodeRange a -> Bool | |
parseRange :: ByteString -> UnicodeRange () Source #
Parse AAAA..BBBB range
Since: 0.1.0