]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/regexp/regexp.factor
Delete empty unit tests files, remove 1- and 1+, reorder IN: lines in a lot of places...
[factor.git] / basis / regexp / regexp.factor
index 21439640fe18f6934606946006062c301265ab14..4318986813d5eeaf3b9eca90b163112e823ac0cd 100644 (file)
@@ -25,7 +25,7 @@ M: lookahead question>quot ! Returns ( index string -- ? )
 M: lookbehind question>quot ! Returns ( index string -- ? )
     term>> <reversed-option>
     ast>dfa dfa>reverse-shortest-word
-    '[ [ 1- ] dip f _ execute ] ;
+    '[ [ 1 - ] dip f _ execute ] ;
 
 : check-string ( string -- string )
     ! Make this configurable
@@ -53,12 +53,12 @@ PRIVATE>
 :: (next-match) ( i string regexp quot: ( i string regexp -- j ) reverse? -- i start end ? )
     i string regexp quot call dup [| j |
         j i j
-        reverse? [ swap [ 1+ ] bi@ ] when
+        reverse? [ swap [ 1 + ] bi@ ] when
         string
     ] [ drop f f f f ] if ; inline
 
 : search-range ( i string reverse? -- seq )
-    [ drop dup 1+ -1 ] [ length 1 ] if range boa ; inline
+    [ drop dup 1 + -1 ] [ length 1 ] if range boa ; inline
 
 :: next-match ( i string regexp quot: ( i string regexp -- j ) reverse? -- i start end ? )
     f f f f
@@ -93,7 +93,7 @@ PRIVATE>
     [ subseq ] map-matches ;
 
 : count-matches ( string regexp -- n )
-    [ 0 ] 2dip [ 3drop 1+ ] each-match ;
+    [ 0 ] 2dip [ 3drop 1 + ] each-match ;
 
 <PRIVATE
 
@@ -192,7 +192,7 @@ PRIVATE>
     dup skip-blank [
         [ index-from ] 2keep
         [ swapd subseq ]
-        [ 2drop 1+ ] 3bi
+        [ 2drop 1 + ] 3bi
     ] change-lexer-column ;
 
 : parse-noblank-token ( lexer -- str/f )
@@ -220,4 +220,4 @@ USING: vocabs vocabs.loader ;
 
 "prettyprint" vocab [
     "regexp.prettyprint" require
-] when
\ No newline at end of file
+] when