fix globs tests
parent
bf7371c32e
commit
9af0f8d426
|
@ -1,11 +1,11 @@
|
||||||
! Copyright (C) 2007, 2009 Slava Pestov, Daniel Ehrenberg.
|
! Copyright (C) 2007, 2009 Slava Pestov, Daniel Ehrenberg.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: sequences io.pathnames kernel regexp.combinators
|
USING: sequences io.pathnames kernel regexp.combinators
|
||||||
strings unicode.case peg.ebnf regexp arrays ;
|
strings splitting system unicode.case peg.ebnf regexp arrays ;
|
||||||
IN: globs
|
IN: globs
|
||||||
|
|
||||||
: not-path-separator ( -- sep )
|
: not-path-separator ( -- sep )
|
||||||
"[^" path-separator "]" 3append <regexp> ; foldable
|
os windows? R! [^/\\]! R! [^/]! ? ; foldable
|
||||||
|
|
||||||
EBNF: <glob>
|
EBNF: <glob>
|
||||||
|
|
||||||
|
@ -48,5 +48,5 @@ Main = Concatenation End
|
||||||
[ "\\*?[{" member? ] any? ;
|
[ "\\*?[{" member? ] any? ;
|
||||||
|
|
||||||
: glob-parent-directory ( glob -- parent-directory )
|
: glob-parent-directory ( glob -- parent-directory )
|
||||||
path-components dup [ glob-pattern? ] find drop head
|
path-separator split harvest dup [ glob-pattern? ] find drop head
|
||||||
path-separator join ;
|
path-separator join ;
|
||||||
|
|
Loading…
Reference in New Issue