]> gitweb.factorcode.org Git - factor.git/commitdiff
left-trim -> trim-left
authorDoug Coleman <doug.coleman@gmail.com>
Fri, 5 Sep 2008 23:56:35 +0000 (18:56 -0500)
committerDoug Coleman <doug.coleman@gmail.com>
Fri, 5 Sep 2008 23:56:35 +0000 (18:56 -0500)
basis/checksums/sha1/sha1.factor
basis/compiler/tree/normalization/normalization.factor
basis/http/client/client.factor
basis/http/server/static/static.factor
basis/io/monitors/monitors-tests.factor
basis/io/windows/nt/files/files-tests.factor
basis/io/windows/nt/files/files.factor
basis/peg/peg.factor
basis/unicode/collation/collation.factor

index 6427e0e8ebe244d7aee794504a042c7c57f0422c..ab813d529b227ab1453f0f19e72e1a05fe006d5c 100755 (executable)
@@ -114,7 +114,7 @@ M: sha1 checksum-stream ( stream -- sha1 )
     drop [ initialize-sha1 stream>sha1 get-sha1 ] with-input-stream ;
 
 : sha1-interleave ( string -- seq )
-    [ zero? ] left-trim
+    [ zero? ] trim-left
     dup length odd? [ rest ] when
     seq>2seq [ sha1 checksum-bytes ] bi@
     2seq>seq ;
index 12c7a60ec8ae01274bb1e8abea410b76432b1ddf..08481726dcdf74f7e98c569e4c1414d34a316cd6 100644 (file)
@@ -151,7 +151,7 @@ M: #branch normalize*
 : eliminate-phi-introductions ( introductions seq terminated -- seq' )
     [
         [ nip ] [
-            dup [ +bottom+ eq? ] left-trim
+            dup [ +bottom+ eq? ] trim-left
             [ [ length ] bi@ - tail* ] keep append
         ] if
     ] 3map ;
index ea1cfd9a4b036acc3dd67c1e56b0747fb623300e..8dc1924a12163d3c2650cc40e340d961b66aec5f 100755 (executable)
@@ -113,7 +113,7 @@ SYMBOL: redirects
 PRIVATE>
 
 : read-chunk-size ( -- n )
-    read-crlf ";" split1 drop [ blank? ] right-trim
+    read-crlf ";" split1 drop [ blank? ] trim-right
     hex> [ "Bad chunk size" throw ] unless* ;
 
 : read-chunks ( -- )
index 98510e45fd5e455d24e85a85800d4d5f0b9dfc6c..dfbe93d86d7af82d74e2b9022448e892c95c6b60 100755 (executable)
@@ -45,9 +45,9 @@ TUPLE: file-responder root hook special allow-listings ;
     [ file-responder get hook>> call ] [ 2drop <304> ] if ;\r
 \r
 : serving-path ( filename -- filename )\r
-    file-responder get root>> right-trim-separators\r
+    file-responder get root>> trim-right-separators\r
     "/"\r
-    rot "" or left-trim-separators 3append ;\r
+    rot "" or trim-left-separators 3append ;\r
 \r
 : serve-file ( filename -- response )\r
     dup mime-type\r
index 63381811d1d5c7260c3fcb9710e795b604ba802f..1cc97753b715a8e067f06a472d25c2aa6089da13 100755 (executable)
@@ -54,7 +54,7 @@ os { winnt linux macosx } member? [
                     "m" get next-change drop
                     dup print flush
                     dup parent-directory
-                    [ right-trim-separators "xyz" tail? ] either? not
+                    [ trim-right-separators "xyz" tail? ] either? not
                 ] loop
 
                 "c1" get count-down
@@ -63,7 +63,7 @@ os { winnt linux macosx } member? [
                     "m" get next-change drop
                     dup print flush
                     dup parent-directory
-                    [ right-trim-separators "yxy" tail? ] either? not
+                    [ trim-right-separators "yxy" tail? ] either? not
                 ] loop
 
                 "c2" get count-down
index 0fa4b4151c5c51e4f86c5fa812478e321e144ced..830861eba095ddcbb8b54893d93c785dc94001a3 100755 (executable)
@@ -21,8 +21,8 @@ IN: io.windows.nt.files.tests
 [ t ] [ "\\\\" root-directory? ] unit-test
 [ t ] [ "/" root-directory? ] unit-test
 [ t ] [ "//" root-directory? ] unit-test
-[ t ] [ "c:\\" right-trim-separators root-directory? ] unit-test
-[ t ] [ "Z:\\" right-trim-separators root-directory? ] unit-test
+[ t ] [ "c:\\" trim-right-separators root-directory? ] unit-test
+[ t ] [ "Z:\\" trim-right-separators root-directory? ] unit-test
 [ f ] [ "c:\\foo" root-directory? ] unit-test
 [ f ] [ "." root-directory? ] unit-test
 [ f ] [ ".." root-directory? ] unit-test
index 6a890f63922b57a33b212d94ec4e86fd061dc6f1..5fbacfa325efa4517fc7f6328e8a76d15a6a4c7d 100755 (executable)
@@ -22,7 +22,7 @@ M: winnt root-directory? ( path -- ? )
     {
         { [ dup empty? ] [ f ] }
         { [ dup [ path-separator? ] all? ] [ t ] }
-        { [ dup right-trim-separators { [ length 2 = ] [ second CHAR: : = ] } 1&& ] [ t ] }
+        { [ dup trim-right-separators { [ length 2 = ] [ second CHAR: : = ] } 1&& ] [ t ] }
         [ f ]
     } cond nip ;
 
index 0cf0382ee2086228fc9426a8eaae4ac1b1de6624..dbb3a04a09ed5b3140fe03ee5c488154e4ba9654 100755 (executable)
@@ -513,18 +513,11 @@ TUPLE: action-parser p1 quot ;
 M: action-parser (compile) ( peg -- quot )
   [ p1>> compile-parser 1quotation ] [ quot>> ] bi '[ @ , check-action ] ;
 
-: left-trim-slice ( string -- string )
-  #! Return a new string without any leading whitespace
-  #! from the original string.
-  dup empty? [
-    dup first blank? [ rest-slice left-trim-slice ] when
-  ] unless ;
-
 TUPLE: sp-parser p1 ;
 
 M: sp-parser (compile) ( peg -- quot )
   p1>> compile-parser 1quotation '[ 
-    input-slice left-trim-slice input-from pos set @ 
+    input-slice trim-left-slice input-from pos set @ 
   ] ;
 
 TUPLE: delay-parser quot ;
index b5c7665b8ba773b991826e7c340409e5885af0e0..d71fffaaabea8f1675a1c1a551e35e401fad3cc0 100755 (executable)
@@ -136,7 +136,7 @@ PRIVATE>
 : insensitive= ( str1 str2 levels-removed -- ? )\r
     [\r
         swap collation-key swap\r
-        [ [ 0 = not ] right-trim but-last ] times\r
+        [ [ 0 = not ] trim-right but-last ] times\r
     ] curry bi@ = ;\r
 PRIVATE>\r
 \r