Add nginx
This commit is contained in:
@ -54,9 +54,9 @@ data PackageOwner = PackageOwner
|
||||
} deriving (Eq, Show)
|
||||
|
||||
data MatchState = MatchState
|
||||
{ ignoring :: Bool
|
||||
, matched :: Text
|
||||
, pattern' :: [MatchToken]
|
||||
{ ignoring :: !Bool
|
||||
, matched :: !Text
|
||||
, pattern' :: ![MatchToken]
|
||||
} deriving (Eq, Show)
|
||||
|
||||
data MatchToken
|
||||
@ -68,7 +68,7 @@ data MatchToken
|
||||
deriving (Eq, Show)
|
||||
|
||||
-- | Matches a string (for example a version name or CVS tag) against a pattern.
|
||||
-- Returns the matched part of the string or 'Nothing' if there is no match.
|
||||
-- Returns the matched part of the string or 'Nothing' if there is not match.
|
||||
--
|
||||
-- The pattern is just a list of characters with some special characters and
|
||||
-- sequences.
|
||||
@ -79,6 +79,8 @@ data MatchToken
|
||||
-- * \\. - Matches zero or more digits or dots.
|
||||
-- * \\\\ - Matches a back slash.
|
||||
-- * * - Matches everything.
|
||||
-- * [ ] - Match one of the characters inbetween. The characters are
|
||||
-- matched verbatim.
|
||||
--
|
||||
-- For example the following expression matches tags like @v1.2.3@, but returns
|
||||
-- only @1.2.3@.
|
||||
@ -112,6 +114,11 @@ match fullPattern input =
|
||||
Just ('\\', remaining') -> SymbolMatchToken '\\'
|
||||
: parsePattern remaining'
|
||||
Just (_, remaining') -> parsePattern remaining'
|
||||
| Just (firstChar, remaining) <- Text.uncons input'
|
||||
, firstChar == '['
|
||||
, Just lastBracket <- Text.findIndex (== ']') remaining
|
||||
= OneOfMatchToken (Text.unpack $ Text.take lastBracket remaining)
|
||||
: parsePattern (Text.drop (succ lastBracket) remaining)
|
||||
| Just (firstChar, remaining) <- Text.uncons input' =
|
||||
let token =
|
||||
case firstChar of
|
||||
|
Reference in New Issue
Block a user