1 USING: help.syntax help.markup kernel prettyprint sequences strings words math ;
4 ARTICLE: "ctags" "Ctags file"
5 { $emphasis "ctags" } " generates a index file of every factor word in ctags format as supported by vi and other editors. More information can be found at " { $url "http://en.wikipedia.org/wiki/Ctags" } "."
7 { $subsection ctags-write }
8 { $subsection ctag-strings }
10 { $subsection ctag-word }
11 { $subsection ctag-path }
12 { $subsection ctag-lineno } ;
14 HELP: ctags ( path -- )
15 { $values { "path" "a pathname string" } }
16 { $description "Generates a index file in ctags format and stores in " { $snippet "path" } "." }
25 HELP: ctags-write ( seq path -- )
26 { $values { "seq" sequence }
27 { "path" "a pathname string" } }
28 { $description "Stores a " { $snippet "alist" } " in " { $snippet "path" } ". " { $snippet "alist" } " must be an association list with ctags format: key must be a valid word and value a sequence whose first element is a resource name and second element is a line number" }
31 "USING: kernel ctags ;"
32 "{ { if { \"resource:extra/unix/unix.factor\" 91 } } } \"tags\" ctags-write"
37 { $snippet "tags" } " file will contain a single line: if\\t/path/to/factor/extra/unix/unix.factor\\t91" } ;
40 { $values { "alist" "an association list" }
42 { $description "Converts an " { $snippet "alist" } " with ctag format (a word as key and a sequence whose first element is a resource name and a second element is a line number as value) in a " { $snippet "seq" } " of ctag strings." }
45 "USING: kernel ctags prettyprint ;"
46 "{ { if { \"resource:extra/unix/unix.factor\" 91 } } } ctag-strings ."
47 "{ \"if\\t/path/to/factor/extra/unix/unix.factor\\t91\" }"
51 HELP: ctag ( seq -- str )
52 { $values { "seq" sequence }
54 { $description "Outputs a string " { $snippet "str" } " in ctag format for sequence with two elements, first one must be a valid word and second one a sequence whose first element is a resource name and second element is a line number" }
57 "USING: kernel ctags prettyprint ;"
58 "{ if { \"resource:extra/unix/unix.factor\" 91 } } ctag ."
59 "\"if\\t/path/to/factor/extra/unix/unix.factor\\t91\""
63 HELP: ctag-lineno ( ctag -- n )
64 { $values { "ctag" sequence }
66 { $description "Provides de line number " { $snippet "n" } " from a sequence in ctag format " }
69 "USING: kernel ctags prettyprint ;"
70 "{ if { \"resource:extra/unix/unix.factor\" 91 } } ctag-lineno ."
75 HELP: ctag-path ( ctag -- path )
76 { $values { "ctag" sequence }
78 { $description "Provides a path string " { $snippet "path" } " from a sequence in ctag format" }
81 "USING: kernel ctags prettyprint ;"
82 "{ if { \"resource:extra/unix/unix.factor\" 91 } } ctag-path ."
83 "\"resource:extra/unix/unix.factor\""
87 HELP: ctag-word ( ctag -- word )
88 { $values { "ctag" sequence }
90 { $description "Provides the " { $snippet "word" } " from a sequence in ctag format " }
93 "USING: kernel ctags prettyprint ;"
94 "{ if { \"resource:extra/unix/unix.factor\" 91 } } ctag-word ."