hxbrief: Support exact matches
parent
f4cde7248a
commit
7105c6cd95
|
@ -170,8 +170,9 @@ matchPattern pat s = case break (== '*') pat of
|
||||||
(start, '*' : rest) -> if any (== '*') rest
|
(start, '*' : rest) -> if any (== '*') rest
|
||||||
then error "only one glob supported in patterns!"
|
then error "only one glob supported in patterns!"
|
||||||
else start `isPrefixOf` s && rest `isSuffixOf` s
|
else start `isPrefixOf` s && rest `isSuffixOf` s
|
||||||
("", "") -> error "empty pattern"
|
("" , "") -> error "empty pattern"
|
||||||
_ -> undefined
|
(exact, "") -> exact == s
|
||||||
|
_ -> undefined
|
||||||
|
|
||||||
dispatchLine :: (StreamKind, String) -> StateT State IO ()
|
dispatchLine :: (StreamKind, String) -> StateT State IO ()
|
||||||
dispatchLine line@(kind, str) = do
|
dispatchLine line@(kind, str) = do
|
||||||
|
|
Loading…
Reference in New Issue