packages feed

regex-tdfa 0.97.1 → 0.97.3

raw patch · 3 files changed

+25/−2 lines, 3 files

Files

Text/Regex/TDFA/CorePattern.hs view
@@ -151,6 +151,17 @@   (test,tags') <- nv   return (test,tags `mappend` tags') +-- For PStar, need to put in the orbit TagTasks+orbitWrapNullView :: Maybe Tag -> [Tag] -> NullView -> NullView+orbitWrapNullView mOrbit orbitResets oldNV =+  case (mOrbit,orbitResets) of+    (Nothing,[]) -> oldNV+    (Nothing,_) -> do (oldTests,oldTasks) <- oldNV+                      return (oldTests,prepend oldTasks)+    (Just o,_) -> do (oldTests,oldTasks) <- oldNV+                     return (oldTests,prepend $ [(o,PreUpdate EnterOrbitTask)] ++ oldTasks ++ [(o,PreUpdate LeaveOrbitTask)])+  where prepend = foldr (\h t -> (h:).t) id . map (\tag->(tag,PreUpdate ResetOrbitTask)) $ orbitResets+ -- For PGroup, need to prepend reset tasks before others in nullView addResetsToNullView :: [Tag]-> NullView -> NullView addResetsToNullView resetTags nv = [ (test, prepend tags) | (test,tags) <- nv ]@@ -387,7 +398,13 @@            b <- if noTag m2 && needsTags then uniq Maximize else return m2            c <- if needsOrbit then makeOrbit else return Nothing -- any Orbit tag is created after the pre and post tags            (q,resetTags) <- withOrbit (go p NoTag NoTag)-           let nullView = emptyNull (winTags (apply a) (apply b)) -- chosen to represent skipping sub-pattern+-- 2009-02-09 eliminate because this breaks (()*)* and ((.?)*)*+--           let nullView = emptyNull (winTags (apply a) (apply b)) -- chosen to represent skipping sub-pattern+           let nullView | mayFirstBeNull = cleanNullView $ childViews ++ skipView+                        | otherwise = skipView+                 where childViews = addTagsToNullView (winTags (apply a) (apply b)) +                                  . orbitWrapNullView c resetTags $ nullQ q+                       skipView = emptyNull (winTags (apply a) (apply b))            return $ Q nullView                       (0,if accepts then Nothing else (Just 0))                       [] (apply a) (apply b)
Text/Regex/TDFA/RunMutState.hs view
@@ -332,6 +332,10 @@       postTag = succ preTag   if n==0     then do+      -- new change with 0.97.3: clear these 3 fields as we are stealing the allocated data!+      unsafeWrite (m_pos s1) i1 Nothing+      unsafeWrite (m_flag s1) i1 Nothing+      unsafeWrite (m_orbit s1) i1 mempty       mapM_ (\(tag,v) -> unsafeWrite pos1 tag (val v)) (newPos ins)       mapM_ (\(tag,f) -> unsafeWrite flag1 tag (f)) (newFlags ins)       case mw of
regex-tdfa.cabal view
@@ -1,6 +1,8 @@ Name:                   regex-tdfa-Version:                0.97.1+Version:                0.97.3 -- 0.97.1: Bug Fix: Use PGroup Nothing when expanding PBound+-- 0.97.2: Bug Fix: Use more complex null view in PStar when mayFirstBeNull, fix (()*)* and ((.?)*)*+-- 0.97.3: Bug Fix: RunMutState.updateWinning was borking the input state (.*)*...?()|. on 123456 Cabal-Version:          >=1.2.3 License:                BSD3 License-File:           LICENSE