Tweak orRegex
This commit is contained in:
@@ -68,18 +68,6 @@ updateCombineInventory w cfig sss =
|
|||||||
mstr = w ^? hud . hudElement . subInventory . ciSections . sssExtra . sssFilters . ix (-1) . _Just
|
mstr = w ^? hud . hudElement . subInventory . ciSections . sssExtra . sssFilters . ix (-1) . _Just
|
||||||
numfiltitems = " " ++ show (length allcombs - length filtcombs) ++ " FILTERED"
|
numfiltitems = " " ++ show (length allcombs - length filtcombs) ++ " FILTERED"
|
||||||
|
|
||||||
regexCombs :: IM.IntMap (SelectionItem ()) -> String
|
|
||||||
-> IM.IntMap (SelectionItem CombinableItem)
|
|
||||||
-> IM.IntMap (SelectionItem CombinableItem)
|
|
||||||
regexCombs inv str = case str of
|
|
||||||
'<':str' -> IM.filter (f str')
|
|
||||||
_ -> IM.filter (regexList str . _siPictures)
|
|
||||||
where
|
|
||||||
f str' si = any (g str') (_ciInvIDs $ _siPayload si)
|
|
||||||
g str' i = fromMaybe False $ do
|
|
||||||
si' <- inv ^? ix i
|
|
||||||
return $ regexList str' $ _siPictures si'
|
|
||||||
|
|
||||||
regexCombs' :: IM.IntMap (SelectionItem ()) -> SelectionItem CombinableItem -> String -> Bool
|
regexCombs' :: IM.IntMap (SelectionItem ()) -> SelectionItem CombinableItem -> String -> Bool
|
||||||
regexCombs' inv ci str = case str of
|
regexCombs' inv ci str = case str of
|
||||||
'<':str' -> f str' ci
|
'<':str' -> f str' ci
|
||||||
@@ -94,6 +82,7 @@ andOrRegex :: (a -> String -> Bool) -> a -> String -> Bool
|
|||||||
andOrRegex f x str = all (orRegex f x) (wordsBy '&' str)
|
andOrRegex f x str = all (orRegex f x) (wordsBy '&' str)
|
||||||
|
|
||||||
orRegex :: (a -> String -> Bool) -> a -> String -> Bool
|
orRegex :: (a -> String -> Bool) -> a -> String -> Bool
|
||||||
|
orRegex _ _ [] = True
|
||||||
orRegex f x str = any (f x) (words str)
|
orRegex f x str = any (f x) (words str)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user