GHC.Parser.String

ghc-lib-parser-9.14.1.20251220: The GHC API, decoupled from GHC versions

Safe Haskell | Ignore
Language | GHC2021

GHC.Parser.String

Contents

- Unicode smart quote helpers

Synopsis

- data StringLexError = StringLexError LexErr BufPos
- lexString :: Int -> StringBuffer -> Either StringLexError String
- lexMultilineString :: Int -> StringBuffer -> Either StringLexError String
- isDoubleSmartQuote :: Char -> Bool
- isSingleSmartQuote :: Char -> Bool

# Documentation

data StringLexError #

Constructors

StringLexError LexErr BufPos |

#### Instances

Instances details

Show StringLexError # |
Instance details Defined in GHC.Parser.String Methods showsPrec :: Int -> StringLexError -> ShowS # show :: StringLexError -> String # showList :: [StringLexError] -> ShowS #
Eq StringLexError # |
Instance details Defined in GHC.Parser.String Methods (==) :: StringLexError -> StringLexError -> Bool # (/=) :: StringLexError -> StringLexError -> Bool #

lexString :: Int -> StringBuffer -> Either StringLexError String #

lexMultilineString :: Int -> StringBuffer -> Either StringLexError String #

See Note [Multiline string literals]

Assumes string is lexically valid. Skips the steps about splitting and rejoining lines, and instead manually find newline characters, for performance.

# Unicode smart quote helpers

isDoubleSmartQuote :: Char -> Bool #

isSingleSmartQuote :: Char -> Bool #