]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/sequences/parser/parser.factor
factor: trim using lists
[factor.git] / basis / sequences / parser / parser.factor
index 8e1b1f540cc771d7fd4f73e35b3a32cc6c58ae8a..b9fd4dd1d4cc3929ba6a3b2d7264fb3f476133f8 100644 (file)
@@ -1,8 +1,8 @@
 ! Copyright (C) 2005, 2009 Daniel Ehrenberg, Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors circular combinators.short-circuit fry io
-kernel locals math math.order sequences sorting.functor
-sorting.slots unicode.categories ;
+USING: accessors circular combinators.short-circuit io kernel
+math math.order sequences sequences.parser sequences.private
+sorting.functor sorting.slots unicode ;
 IN: sequences.parser
 
 TUPLE: sequence-parser sequence n ;
@@ -62,9 +62,9 @@ TUPLE: sequence-parser sequence n ;
 : <safe-slice> ( from to seq -- slice/f )
     3dup {
         [ 2drop 0 < ]
-        [ [ drop ] 2dip length > ]
+        [ nipd length > ]
         [ drop > ]
-    } 3|| [ 3drop f ] [ slice boa ] if ; inline
+    } 3|| [ 3drop f ] [ <slice-unsafe> ] if ; inline
 
 :: take-sequence ( sequence-parser sequence -- obj/f )
     sequence-parser [ n>> dup sequence length + ] [ sequence>> ] bi