inchworm-1.0.2.3: Inchworm Lexer Framework

Safe HaskellSafe
LanguageHaskell98

Text.Lexer.Inchworm.Char

Contents

Description

Character based scanners.

Synopsis

Documentation

Driver

scanStringIO :: String -> Scanner IO Location String a -> IO ([a], Location, String) Source #

Scan a string in the IO monad.

Locations

data Location Source #

A location in a source file.

Constructors

Location !Int !Int 
Instances
Show Location Source # 
Instance details

Defined in Text.Lexer.Inchworm.Source

bumpLocationWithChar :: Char -> Location -> Location Source #

Bump a location using the given character, updating the line and column number as appropriate.

Scanners

scanInteger :: Monad m => Scanner m loc [Char] (loc, Integer) Source #

Scan a decimal integer, with optional - and + sign specifiers.

scanHaskellChar :: Monad m => Scanner m loc [Char] (loc, Char) Source #

Scan a literal character, enclosed in single quotes.

We handle the escape codes listed in Section 2.6 of the Haskell Report.

scanHaskellString :: Monad m => Scanner m loc [Char] (loc, String) Source #

Scan a literal string, enclosed in double quotes.

We handle the escape codes listed in Section 2.6 of the Haskell Report, but not string gaps or the & terminator.

scanHaskellCommentBlock :: Monad m => Scanner m loc [Char] (loc, String) Source #

Scan a Haskell block comment.

scanHaskellCommentLine :: Monad m => Scanner m loc [Char] (loc, String) Source #

Scan a Haskell line comment.