X-Git-Url: https://gitweb.factorcode.org/gitweb.cgi?p=factor.git;a=blobdiff_plain;f=basis%2Fxmode%2Fmarker%2Fmarker.factor;h=4ecfa9b7963cd0fbde4d8e869d8d2e5398f48c73;hp=d29623820875d5758aaa1e940c077b9ca1c33bb1;hb=528de2849f6e31f45750b5276bec49123df03f58;hpb=ed9c49eee31abeaf966664327b14281f8f4f777e diff --git a/basis/xmode/marker/marker.factor b/basis/xmode/marker/marker.factor index d296238208..4ecfa9b796 100644 --- a/basis/xmode/marker/marker.factor +++ b/basis/xmode/marker/marker.factor @@ -102,7 +102,7 @@ M: regexp text-matches? : match-group-regexp ( regexp n -- skip-regexp match-regexp ) [ [ options>> options>string ] [ raw>> ] bi ] dip CHAR: ( pick nth-index cut CHAR: ) over index 1 + head - rot '[ _ ] bi@ ; + rot '[ H{ } [ _ ] cache ] bi@ ; : skip-first-match ( match regexp -- tailseq ) first-match [ seq>> ] [ to>> ] bi tail ; @@ -123,12 +123,15 @@ M: string-matcher fixup-end [ string>> -rot update-match-groups ] [ ignore-case?>> ] bi ; -M: regexp fixup-end - [ raw>> [ -rot update-match-groups ] keep swap ] - [ options>> options>string ] bi { +MEMO: ( raw matched options -- regexp ) + { [ parse-tree>> ] [ options>> ] [ dfa>> ] [ next-match>> ] } cleave regexp boa ; +M: regexp fixup-end + [ raw>> [ -rot update-match-groups ] keep swap ] + [ options>> options>string ] bi ; + : fixup-end? ( text -- ? ) { [ regexp? ] [ #match-groups ] } 1&& ;