]> gitweb.factorcode.org Git - factor.git/commitdiff
Merge branch 'master' of git://factorcode.org/git/factor
authorDaniel Ehrenberg <littledan@Macintosh-122.local>
Wed, 11 Mar 2009 19:47:05 +0000 (14:47 -0500)
committerDaniel Ehrenberg <littledan@Macintosh-122.local>
Wed, 11 Mar 2009 19:47:05 +0000 (14:47 -0500)
Conflicts:

basis/regexp/regexp.factor

1  2 
basis/regexp/regexp.factor

index df253184c30894c1179eaeab34e8083a60edef06,791b0b838b4a9030ea574be458e330609c48f003..7f27a13104a011f67505e454273f5dcbbdc9536a
@@@ -65,24 -66,13 +65,24 @@@ TUPLE: match { i read-only } { j read-o
  : search-range ( i string reverse? -- seq )
      [ drop 0 [a,b] ] [ length [a,b) ] if ; inline
  
 -:: next-match ( i string quot reverse? -- i slice/f )
 +: match>result ( match reverse? -- i start end string )
 +    over [
 +        [ [ i>> ] [ j>> tuck ] [ seq>> ] tri ] dip
 +        [ [ swap [ 1+ ] bi@ ] dip ] when
 +    ] [ 2drop f f f f ] if ; inline
 +
 +:: next-match ( i string quot reverse? -- i start end string )
      i string reverse? search-range
      [ string quot match-slice ] map-find drop
 -    [ dup [ reverse? [ from>> ] [ to>> ] if ] when ] keep ; inline
 +    reverse? match>result ; inline
 +
 +: do-next-match ( i string regexp -- i start end string )
 +    dup next-match>>
-     execute( i string regexp -- i start end string ) ;
++    execute-unsafe( i string regexp -- i start end string ) ;
  
 -: do-next-match ( i string regexp -- i match/f )
 -    dup next-match>> execute-unsafe( i string regexp -- i match/f ) ; inline
 +: next-slice ( i string regexp -- i/f slice/f )
 +    do-next-match
 +    [ slice boa ] [ drop ] if* ; inline
  
  PRIVATE>