Changeset 3004

Show
Ignore:
Timestamp:
05/12/05 03:50:34 (4 years ago)
Author:
autrijus
svk:copy_cache_prev:
4536
Message:

* deal with PCRE's like of negative indexes.

Files:
1 modified

Legend:

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

    r2992 r3004  
    4747    if isNothing rv then return mkMatchFail else do 
    4848    let ((fromBytes, lenBytes):subs) = Array.elems (fromJust rv) 
    49         substr str from len = genericTake len (genericDrop from str) 
     49        substr str from len = take len (drop from str) 
    5050        subsMatch = [ 
    5151            VMatch $ mkMatchOk 
     
    5454                [] Map.empty 
    5555            | (fBytes, lBytes) <- subs 
    56             , let fChars = chars $ genericTake fBytes csBytes 
     56            , let fChars = chars $ take fBytes csBytes 
    5757            , let lChars = chars $ substr csBytes fBytes lBytes 
    5858            ] 
    59         fromChars = chars $ genericTake fromBytes csBytes 
     59        fromChars = chars $ take fromBytes csBytes 
    6060        lenChars  = chars $ substr csBytes fromBytes lenBytes 
    6161        chars = genericLength . decodeUTF8