Show
Ignore:
Timestamp:
09/30/06 11:25:30 (2 years ago)
Author:
audreyt
Message:

* In m:g/(1)|(2)/, only return the successfully matched subcaptures,

not the unsuccessful ones. This is such that "1212" matched against
the regex will evaluate to ('1', '2', '1', '2'), instead of
('1', , , '2', '1', , , '2').

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/Prim/Match.hs

    r13718 r13744  
    201201        if not (matchOk match) then return [] else do 
    202202        let ret x = return $ if hasSubpatterns 
    203                         then (matchSubPos match) ++ x 
     203                        then [ m | m@(VMatch MkMatch{ matchOk = True }) <- matchSubPos match ] ++ x 
    204204                        else (VMatch match):x 
    205205        case (matchTo match, matchFrom match) of