regex-1.1.0.2: Toolkit for regex-base

Safe Haskell | None
Language | Haskell2010

Text.RE.REOptions

Contents

- The Options Tutorial
- `SimpleREOptions`
- `REOptions_`
- The Macro Tables

Synopsis

- data SimpleREOptions
  - = MultilineSensitive
  - | MultilineInsensitive
  - | BlockSensitive
  - | BlockInsensitive
- data REOptions_ r c e = REOptions {
  - optionsMacs :: !(Macros r)
  - optionsComp :: !c
  - optionsExec :: !e
  }
- type Macros r = HashMap MacroID r
- newtype MacroID = MacroID {
  - getMacroID :: String
  }
- emptyMacros :: Macros r

# The Options Tutorial

This API module provides the generic types used to specify the options when compiling REs for each of the backl ends.

See the tutorials at http://re-tutorial-options.regex.uk

# `SimpleREOptions`

data SimpleREOptions Source #

the default API uses these simple, universal RE options, which get auto-converted into the appropriate back-end `REOptions_`

Constructors

MultilineSensitive | case-sensitive with ^ and $ matching the start and end of a line
MultilineInsensitive | case-insensitive with ^ and $ matsh the start and end of a line
BlockSensitive | case-sensitive with ^ and $ matching the start and end of the input text
BlockInsensitive | case-insensitive with ^ and $ matching the start and end of the input text

#### Instances

Instances details

Bounded SimpleREOptions Source # |
Instance details Defined in Text.RE.REOptions Methods minBound :: SimpleREOptions Source # maxBound :: SimpleREOptions Source #
Enum SimpleREOptions Source # |

Instance details

Defined in Text.RE.REOptions

Methods

succ :: SimpleREOptions -> SimpleREOptions Source #

pred :: SimpleREOptions -> SimpleREOptions Source #

toEnum :: Int -> SimpleREOptions Source #

fromEnum :: SimpleREOptions -> Int Source #

enumFrom :: SimpleREOptions -> [SimpleREOptions] Source #

enumFromThen :: SimpleREOptions -> SimpleREOptions -> [SimpleREOptions] Source #

enumFromTo :: SimpleREOptions -> SimpleREOptions -> [SimpleREOptions] Source #

enumFromThenTo :: SimpleREOptions -> SimpleREOptions -> SimpleREOptions -> [SimpleREOptions] Source #

Show SimpleREOptions Source # |
Instance details Defined in Text.RE.REOptions Methods showsPrec :: Int -> SimpleREOptions -> ShowS Source # show :: SimpleREOptions -> String Source # showList :: [SimpleREOptions] -> ShowS Source #
Eq SimpleREOptions Source # |
Instance details Defined in Text.RE.REOptions Methods (==) :: SimpleREOptions -> SimpleREOptions -> Bool Source # (/=) :: SimpleREOptions -> SimpleREOptions -> Bool Source #
Ord SimpleREOptions Source # |

Instance details

Defined in Text.RE.REOptions

Methods

compare :: SimpleREOptions -> SimpleREOptions -> Ordering Source #

(<) :: SimpleREOptions -> SimpleREOptions -> Bool Source #

(<=) :: SimpleREOptions -> SimpleREOptions -> Bool Source #

(>) :: SimpleREOptions -> SimpleREOptions -> Bool Source #

(>=) :: SimpleREOptions -> SimpleREOptions -> Bool Source #

max :: SimpleREOptions -> SimpleREOptions -> SimpleREOptions Source #

min :: SimpleREOptions -> SimpleREOptions -> SimpleREOptions Source #

IsOption SimpleREOptions Source # |
Instance details Defined in Text.RE.ZeInternals.TDFA Methods makeREOptions :: SimpleREOptions -> REOptions Source #
Lift SimpleREOptions Source # | we need to use this in the quasi quoters to specify `SimpleREOptions` selected by the quasi quoter
Instance details Defined in Text.RE.REOptions Methods lift :: Quote m => SimpleREOptions -> m Exp Source # liftTyped :: forall (m :: Type -> Type). Quote m => SimpleREOptions -> Code m SimpleREOptions Source #

# `REOptions_`

data REOptions_ r c e Source #

the general options for an RE are dependent on which back end is being used and are parameterised over the `RE` type for the back end, and its `CompOption` and `ExecOption` types (the compile-time and execution time options, respectively); each back end will define an `REOptions` type that fills out these three type parameters with the appropriate types (see, for example, Text.RE.TDFA)

Constructors

REOptions |

Fields

- optionsMacs :: !(Macros r)

  the available TestBench RE macros

- optionsComp :: !c

  the back end compile-time options

- optionsExec :: !e

  the back end execution-time options

#### Instances

Instances details

IsOption REOptions Source # |
Instance details Defined in Text.RE.ZeInternals.TDFA Methods makeREOptions :: REOptions -> REOptions Source #
(Show r, Show c, Show e) => Show (REOptions_ r c e) Source # |
Instance details Defined in Text.RE.REOptions Methods showsPrec :: Int -> REOptions_ r c e -> ShowS Source # show :: REOptions_ r c e -> String Source # showList :: [REOptions_ r c e] -> ShowS Source #

# The Macro Tables

type Macros r = HashMap MacroID r Source #

our macro tables are parameterised over the back end `RE` type and and just associate each `MacroID` with an `RE` (which may in turn contain macros to be expanded)

newtype MacroID Source #

`MacroID` is just a wrapped `String` type with an `IsString` instance

Constructors

MacroID |

Fields

- getMacroID :: String

#### Instances

Instances details

IsString MacroID Source # |
Instance details Defined in Text.RE.REOptions Methods fromString :: String -> MacroID Source #
Show MacroID Source # |
Instance details Defined in Text.RE.REOptions Methods showsPrec :: Int -> MacroID -> ShowS Source # show :: MacroID -> String Source # showList :: [MacroID] -> ShowS Source #
Eq MacroID Source # |
Instance details Defined in Text.RE.REOptions Methods (==) :: MacroID -> MacroID -> Bool Source # (/=) :: MacroID -> MacroID -> Bool Source #
Ord MacroID Source # |
Instance details Defined in Text.RE.REOptions Methods compare :: MacroID -> MacroID -> Ordering Source # (<) :: MacroID -> MacroID -> Bool Source # (<=) :: MacroID -> MacroID -> Bool Source # (>) :: MacroID -> MacroID -> Bool Source # (>=) :: MacroID -> MacroID -> Bool Source # max :: MacroID -> MacroID -> MacroID Source # min :: MacroID -> MacroID -> MacroID Source #
Hashable MacroID Source # | `MacroID` is used with `HM.HashMap` to build macro lookup tables
Instance details Defined in Text.RE.REOptions Methods hashWithSalt :: Int -> MacroID -> Int Source # hash :: MacroID -> Int Source #
IsOption (Macros RE) Source # |
Instance details Defined in Text.RE.ZeInternals.TDFA Methods makeREOptions :: Macros RE -> REOptions Source #

emptyMacros :: Macros r Source #

a macro table containing no entries