]> gitweb.factorcode.org Git - factor.git/commitdiff
xmode.marker: cache fixup regexp
authorJohn Benediktsson <mrjbq7@gmail.com>
Sun, 7 Aug 2022 19:38:45 +0000 (12:38 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Sun, 7 Aug 2022 19:38:45 +0000 (12:38 -0700)
basis/xmode/marker/marker.factor

index d29623820875d5758aaa1e940c077b9ca1c33bb1..05e93b61548447f417e21c6a99e6a8d1837e2acf 100644 (file)
@@ -123,12 +123,15 @@ M: string-matcher fixup-end
     [ string>> -rot update-match-groups ]
     [ ignore-case?>> ] bi <string-matcher> ;
 
-M: regexp fixup-end
-    [ raw>> [ -rot update-match-groups ] keep swap ]
-    [ options>> options>string ] bi <optioned-regexp> {
+MEMO: <fixup-regexp> ( raw matched options -- regexp )
+    <optioned-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-regexp> ;
+
 : fixup-end? ( text -- ? )
     { [ regexp? ] [ #match-groups ] } 1&& ;