-- | Common supports the Lazy Parsec backend.  It defines all the data
-- types except Pattern and exports everything but the contructors of
-- Pattern.
module Text.Regex.DFA.Common where

import Data.IntMap(IntMap)

-- | 'RegexOption' control whether the pattern is multiline or
-- case-sensitive like Text.Regex and whether to capture the subgroups
-- (\1, \2, etc).
data CompOption = CompOption {caseSensitive :: Bool,multiline :: Bool}
data ExecOption = ExecOption
{-
-- | This is a convenience value of RegexOption with multiline,
-- caseSensitive, and captureGroups all True and longestMatch False.
defaultRegexOption :: RegexOption
defaultRegexOption = RegexOption {multiline = True
                                 ,caseSensitive = True
                                 ,captureGroups = True
                                 ,strategy = Find_LongestMatch
                                 }
-}

-- | 'MatchedStrings' is an IntMap where the keys are PatternIndex
-- numbers and the values are completed substring captures.
--
-- This has now been augmented to also remember the offset and length
-- of the matched string.
type MatchedStrings = IntMap (String,(Int,Int))

type BoolMultiline = Bool
type BoolCaseSensitive = Bool
type StringInput = String
type StringBeforeMatch = String
type StringOfMatch = String
type StringAfterMatch = String
type StringSubgroups = String
type StringSubPattern = String
type AboutMatch = (StringBeforeMatch,StringOfMatch,StringAfterMatch,[StringSubgroups])