make parts of scaffold private, fix help. for single use

db4
Doug Coleman 2008-09-04 01:29:46 -05:00
parent 56dec43eb3
commit 6e8f5f50f1
1 changed files with 11 additions and 9 deletions

View File

@ -4,19 +4,20 @@ USING: assocs io.files hashtables kernel namespaces sequences
vocabs.loader io combinators io.encodings.utf8 calendar accessors vocabs.loader io combinators io.encodings.utf8 calendar accessors
math.parser io.streams.string ui.tools.operations quotations math.parser io.streams.string ui.tools.operations quotations
strings arrays prettyprint words vocabs sorting sets cords strings arrays prettyprint words vocabs sorting sets cords
sequences.lib combinators.lib ; classes sequences.lib combinators.lib ;
IN: tools.scaffold IN: tools.scaffold
SYMBOL: developer-name SYMBOL: developer-name
SYMBOL: using SYMBOL: using
ERROR: not-a-vocab-root string ; ERROR: not-a-vocab-root string ;
ERROR: vocab-name-contains-separator path ;
ERROR: vocab-name-contains-dot path ;
: root? ( string -- ? ) : root? ( string -- ? )
vocab-roots get member? ; vocab-roots get member? ;
ERROR: vocab-name-contains-separator path ; <PRIVATE
ERROR: vocab-name-contains-dot path ;
: check-vocab-name ( string -- string ) : check-vocab-name ( string -- string )
dup dup [ CHAR: . = ] trim [ length ] bi@ = dup dup [ CHAR: . = ] trim [ length ] bi@ =
[ vocab-name-contains-dot ] unless [ vocab-name-contains-dot ] unless
@ -109,7 +110,7 @@ ERROR: vocab-name-contains-dot path ;
} at* ; } at* ;
: add-using ( object -- ) : add-using ( object -- )
vocabulary>> using get conjoin ; vocabulary>> using get [ conjoin ] [ drop ] if* ;
: ($values.) ( array -- ) : ($values.) ( array -- )
[ [
@ -144,10 +145,12 @@ ERROR: vocab-name-contains-dot path ;
: help-header. ( word -- ) : help-header. ( word -- )
"HELP: " write name>> print ; "HELP: " write name>> print ;
PRIVATE>
: help. ( word -- ) : help. ( word -- )
[ help-header. ] [ $values. ] [ $description. ] tri ; [ help-header. ] [ $values. ] [ $description. ] tri ;
<PRIVATE
: help-file-string ( str1 -- str2 ) : help-file-string ( str1 -- str2 )
[ [
[ "IN: " write print nl ] [ "IN: " write print nl ]
@ -180,6 +183,7 @@ ERROR: vocab-name-contains-dot path ;
: with-scaffold ( quot -- ) : with-scaffold ( quot -- )
[ H{ } clone using ] dip with-variable ; inline [ H{ } clone using ] dip with-variable ; inline
PRIVATE>
: scaffold-help ( vocab-root string -- ) : scaffold-help ( vocab-root string -- )
[ [
@ -189,11 +193,9 @@ ERROR: vocab-name-contains-dot path ;
] with-scaffold ; ] with-scaffold ;
: scaffold-undocumented ( string -- ) : scaffold-undocumented ( string -- )
[ words
words [ [ "help" word-prop ] [ predicate? ] bi or not ] filter
[ "help" word-prop not ] filter natural-sort [ help. nl ] each ;
natural-sort [ help. nl ] each
] with-scaffold ;
: scaffold-vocab ( vocab-root string -- ) : scaffold-vocab ( vocab-root string -- )
prepare-scaffold prepare-scaffold