diff --git a/basis/regexp/regexp.factor b/basis/regexp/regexp.factor index 22c7e2474f..29f7e3e84e 100644 --- a/basis/regexp/regexp.factor +++ b/basis/regexp/regexp.factor @@ -51,8 +51,8 @@ PRIVATE> : search-range ( i string reverse? -- seq ) [ drop dup 1+ -1 ] [ length 1 ] if range boa ; inline -:: next-match ( i string regexp word reverse? -- i start end ? ) +:: next-match ( i string regexp quot: ( i string regexp -- j ) reverse? -- i start end ? ) f f f f i string reverse? search-range - [ [ 2drop 2drop ] dip string regexp word reverse? (next-match) dup ] find 2drop ; inline + [ [ 2drop 2drop ] dip string regexp quot reverse? (next-match) dup ] find 2drop ; inline : do-next-match ( i string regexp -- i start end ? ) dup next-match>> @@ -151,7 +151,7 @@ DEFER: compile-next-match : compile-next-match ( regexp -- regexp ) dup '[ dup \ next-initial-word = [ - drop _ [ compile-regexp dfa>> ] [ reverse-regexp? ] bi + drop _ [ compile-regexp dfa>> def>> ] [ reverse-regexp? ] bi '[ { array-capacity string regexp } declare _ _ next-match ] (( i string regexp -- i start end string )) simple-define-temp ] when