1 ! Copyright (C) 2008 Alfredo Beaumont
2 ! See http://factorcode.org/license.txt for BSD license.
4 ! Simple Ctags generator
5 ! Alfredo Beaumont <alfredo.beaumont@gmail.com>
7 USING: arrays kernel sequences io io.files io.backend
8 io.encodings.ascii math.parser vocabs definitions
9 namespaces make words sorting ;
12 : ctag-word ( ctag -- word )
15 : ctag-path ( ctag -- path )
18 : ctag-lineno ( ctag -- n )
23 dup ctag-word ?word-name %
25 dup ctag-path normalize-path %
27 ctag-lineno number>string %
30 : ctag-strings ( seq1 -- seq2 )
33 : ctags-write ( seq path -- )
34 [ ctag-strings ] dip ascii set-file-lines ;
41 ] map [ sequence? ] filter ;
44 (ctags) sort-keys swap ctags-write ;