X-Git-Url: https://gitweb.factorcode.org/gitweb.cgi?p=factor.git;a=blobdiff_plain;f=basis%2Fxmode%2Fmarker%2Fmarker.factor;h=a93283e29020935417bdf1faae8991ee2e4832f8;hp=2b09ffdd5536b4bb1aa2dc3a26eeb839378a9697;hb=4984d1766c441d1dc2fa74f4f1f5ec794556c045;hpb=c489cb3bd4056bf72c43052db578d52bdbc62d53 diff --git a/basis/xmode/marker/marker.factor b/basis/xmode/marker/marker.factor index 2b09ffdd55..a93283e290 100644 --- a/basis/xmode/marker/marker.factor +++ b/basis/xmode/marker/marker.factor @@ -111,12 +111,14 @@ M: regexp text-matches? match-group-regexp [ skip-first-match ] [ first-match ] bi* ; :: update-match-group ( str match regexp n -- str' ) - n H{ } [ 1 + CHAR: $ swap "" 2sequence ] cache :> x - x str subseq? [ - x match "" like regexp n nth-match str replace - ] [ str ] if ; + n H{ } [ CHAR: 1 + CHAR: $ swap "" 2sequence ] cache :> x + x str subseq-range :> ( from to ) + from [ + to str snip-slice match regexp n nth-match glue + ] [ str ] if* ; : update-match-groups ( str match regexp -- str' ) + [ >string ] dip dup #match-groups [ update-match-group ] 2with each-integer ; GENERIC: fixup-end ( match regexp end -- end' )