ghc-lib-parser-9.12.2.20250421: 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 Source #

Constructors

StringLexError LexErr BufPos |

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

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

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 Source #

isSingleSmartQuote :: Char -> Bool Source #