! Copyright (C) 2007, 2009 Slava Pestov, Daniel Ehrenberg.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors arrays combinators combinators.short-circuit
-io.directories io.files io.files.info io.pathnames kernel locals
+io.directories io.files io.files.info io.pathnames kernel
make peg.ebnf regexp regexp.combinators sequences strings system
unicode multiline ;
IN: globs
: not-path-separator ( -- sep )
- os windows? R/ [^\\/\\]/ R/ [^\\/]/ ? ; foldable
+ os windows? R/ [^\/\\]/ R/ [^\/]/ ? ; foldable
: wild-path-separator ( -- sep )
- os windows? R/ [^\\/\\][\\/\\]|[^\\/\\]/ R/ [^\\/][\\/]|[^\\/]/ ? ; foldable
+ os windows? R/ [^\/\\][\/\\]|[^\/\\]/ R/ [^\/][\/]|[^\/]/ ? ; foldable
EBNF: <glob> [=[
:: glob-literal% ( root globs -- )
globs unclip :> ( remaining glob )
- root glob append-path dup exists? [
+ root glob append-path dup file-exists? [
remaining over file-info ?glob%
] [
drop