Some improvements both in elegance and performance in ctags vocab

db4
Alfredo Beaumont 2008-07-11 16:16:01 +02:00
parent 4cb68c4a4d
commit 5a1ab1edae
1 changed files with 5 additions and 7 deletions

View File

@ -19,19 +19,17 @@ IN: ctags
] "" make ; ] "" make ;
: ctag-strings ( seq1 -- seq2 ) : ctag-strings ( seq1 -- seq2 )
{ } swap [ ctag suffix ] each ; [ ctag ] map ;
: ctags-write ( seq path -- ) : ctags-write ( seq path -- )
[ ctag-strings ] dip ascii set-file-lines ; [ ctag-strings ] dip ascii set-file-lines ;
: (ctags) ( -- seq ) : (ctags) ( -- seq )
{ } all-words [ all-words [
dup where [ dup where [
2array suffix 2array
] [ ] when*
drop ] map [ sequence? ] filter ;
] if*
] each ;
: ctags ( path -- ) : ctags ( path -- )
(ctags) sort-keys swap ctags-write ; (ctags) sort-keys swap ctags-write ;