]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/sequences/parser/parser.factor
factor: trim using lists
[factor.git] / basis / sequences / parser / parser.factor
index c1494fed09fdb97ff24f27aff71b9aea83268f5d..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,7 +62,7 @@ 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-unsafe> ] if ; inline