tools.scaffold: generating docs for obj/f was broken.

db4
Doug Coleman 2015-05-05 19:12:36 -07:00
parent 52043e60d5
commit 59205b0399
2 changed files with 13 additions and 2 deletions

View File

@ -25,3 +25,8 @@ IN: tools.scaffold.tests
{ sequence t } [ "newseq" lookup-type ] unit-test
{ { $maybe sequence } t } [ "seq/f" lookup-type ] unit-test
{ f f } [ "foo" lookup-type ] unit-test
: test-maybe ( obj -- obj/f ) ;
[ ] [ \ test-maybe (help.) ] unit-test

View File

@ -146,7 +146,13 @@ ERROR: vocab-name-contains-dot path ;
{ "url" url }
} at* [ swap [ \ $maybe swap 2array ] when ] dip ;
: add-using ( object -- )
GENERIC: add-using ( object -- )
M: array add-using [ add-using ] each ;
M: string add-using drop ;
M: object add-using ( object -- )
vocabulary>> using get [ adjoin ] [ drop ] if* ;
: 4bl ( -- )
@ -160,7 +166,7 @@ ERROR: vocab-name-contains-dot path ;
dup array? [ first ] when
dup lookup-type [
[ unparse write bl ]
[ [ pprint ] [ dup string? [ drop ] [ add-using ] if ] bi ] bi*
[ [ pprint ] [ add-using ] bi ] bi*
] [
drop unparse write bl null pprint
null add-using