vocabs.loader: better fix for append-vocab-dir.

db4
John Benediktsson 2012-08-10 15:01:37 -07:00
parent 98f4ec7c43
commit 344b89fe5f
3 changed files with 10 additions and 5 deletions

View File

@ -5,7 +5,7 @@ sequences vocabs vocabs.loader ;
IN: vocabs.files
: vocab-tests-path ( vocab -- path )
vocab-name* dup "-tests.factor" append-vocab-dir vocab-append-path ;
dup "-tests.factor" append-vocab-dir vocab-append-path ;
: vocab-tests-file ( vocab -- path/f )
vocab-tests-path dup

View File

@ -38,7 +38,12 @@ ERROR: vocab-root-required root ;
: (child-vocabs) ( root prefix -- vocabs )
check-vocab-name
[ vocab-dir append-path dup exists? [ vocab-subdirs ] [ drop { } ] if ]
[
dup ".private" tail? [ 2drop { } ] [
vocab-dir append-path dup exists?
[ vocab-subdirs ] [ drop { } ] if
] if
]
[ nip [ "." append '[ _ prepend ] map! ] unless-empty ]
[ drop '[ _ over vocab-dir? [ >vocab-link ] [ <vocab-prefix> ] if ] map! ]
2tri ;

View File

@ -45,7 +45,7 @@ PRIVATE>
vocab-name* H{ { CHAR: . CHAR: / } } substitute ;
: append-vocab-dir ( vocab str/f -- path )
[ vocab-name "." split ] dip
[ vocab-name* "." split ] dip
[ [ dup last ] dip append suffix ] when*
"/" join ;
@ -57,10 +57,10 @@ PRIVATE>
swap find-vocab-root dup [ prepend-path ] [ 2drop f ] if ;
: vocab-source-path ( vocab -- path/f )
vocab-name* dup ".factor" append-vocab-dir vocab-append-path ;
dup ".factor" append-vocab-dir vocab-append-path ;
: vocab-docs-path ( vocab -- path/f )
vocab-name* dup "-docs.factor" append-vocab-dir vocab-append-path ;
dup "-docs.factor" append-vocab-dir vocab-append-path ;
SYMBOL: load-help?