inchworm-1.1.1.1: Simple parser combinators for lexical analysis.

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, using the IO monad to maintain internal state.

Locations

data Range loc Source #

A range of locations in a source file.

Constructors

Range !loc !loc 
Instances
Show loc => Show (Range loc) Source # 
Instance details

Defined in Text.Lexer.Inchworm.Source

Methods

showsPrec :: Int -> Range loc -> ShowS #

show :: Range loc -> String #

showList :: [Range loc] -> ShowS #

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] (Range loc, Integer) Source #

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

scanHaskellChar :: Monad m => Scanner m loc [Char] (Range 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] (Range 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.

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

Scan a Haskell block comment.

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

Scan a Haskell line comment.