Changeset 6109 for src/Pugs/Prim/Match.hs
- Timestamp:
- 08/07/05 20:12:10 (3 years ago)
- Files:
-
- 1 modified
-
src/Pugs/Prim/Match.hs (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Pugs/Prim/Match.hs
r6010 r6109 144 144 else return (VList rv) 145 145 where 146 hasSubpatterns = case rx of 147 MkRulePGE{} -> True -- bogus 148 MkRulePCRE{rxNumSubs=n} -> not (n == 0) 146 149 matchOnce :: String -> Eval [Val] 147 150 matchOnce str = do … … 149 152 if not (matchOk match) then return [] else do 150 153 rest <- matchOnce (genericDrop (matchTo match) str) 151 return $ matchSubPos match ++ rest 154 return $ if hasSubpatterns 155 then (matchSubPos match) ++ rest 156 else (VMatch match):rest 152 157 153 158 op2Match x (VRule rx) = do
