Added documentation and tests for new words
parent
f05aabdf28
commit
a10fc1e00e
|
@ -1,4 +1,4 @@
|
||||||
USING: help.syntax help.markup kernel prettyprint sequences strings ;
|
USING: help.syntax help.markup kernel prettyprint sequences strings words math ;
|
||||||
IN: ctags
|
IN: ctags
|
||||||
|
|
||||||
ARTICLE: "ctags" "Ctags file"
|
ARTICLE: "ctags" "Ctags file"
|
||||||
|
@ -6,7 +6,10 @@ ARTICLE: "ctags" "Ctags file"
|
||||||
{ $subsection ctags }
|
{ $subsection ctags }
|
||||||
{ $subsection ctags-write }
|
{ $subsection ctags-write }
|
||||||
{ $subsection ctag-strings }
|
{ $subsection ctag-strings }
|
||||||
{ $subsection ctag } ;
|
{ $subsection ctag }
|
||||||
|
{ $subsection ctag-word }
|
||||||
|
{ $subsection ctag-path }
|
||||||
|
{ $subsection ctag-lineno } ;
|
||||||
|
|
||||||
HELP: ctags ( path -- )
|
HELP: ctags ( path -- )
|
||||||
{ $values { "path" "a pathname string" } }
|
{ $values { "path" "a pathname string" } }
|
||||||
|
@ -57,4 +60,41 @@ HELP: ctag ( seq -- str )
|
||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
HELP: ctag-lineno ( ctag -- n )
|
||||||
|
{ $values { "ctag" sequence }
|
||||||
|
{ "n" integer } }
|
||||||
|
{ $description "Provides de line number " { $snippet "n" } " from a sequence in ctag format " }
|
||||||
|
{ $examples
|
||||||
|
{ $example
|
||||||
|
"USING: kernel ctags prettyprint ;"
|
||||||
|
"{ if { \"resource:extra/unix/unix.factor\" 91 } } ctag-lineno ."
|
||||||
|
"91"
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
HELP: ctag-path ( ctag -- path )
|
||||||
|
{ $values { "ctag" sequence }
|
||||||
|
{ "path" string } }
|
||||||
|
{ $description "Provides a path string " { $snippet "path" } " from a sequence in ctag format" }
|
||||||
|
{ $examples
|
||||||
|
{ $example
|
||||||
|
"USING: kernel ctags prettyprint ;"
|
||||||
|
"{ if { \"resource:extra/unix/unix.factor\" 91 } } ctag-path ."
|
||||||
|
"\"resource:extra/unix/unix.factor\""
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
HELP: ctag-word ( ctag -- word )
|
||||||
|
{ $values { "ctag" sequence }
|
||||||
|
{ "word" word } }
|
||||||
|
{ $description "Provides the " { $snippet "word" } " from a sequence in ctag format " }
|
||||||
|
{ $examples
|
||||||
|
{ $example
|
||||||
|
"USING: kernel ctags prettyprint ;"
|
||||||
|
"{ if { \"resource:extra/unix/unix.factor\" 91 } } ctag-word ."
|
||||||
|
"if"
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
ABOUT: "ctags"
|
ABOUT: "ctags"
|
|
@ -1,6 +1,21 @@
|
||||||
USING: kernel ctags tools.test io.backend sequences arrays prettyprint ;
|
USING: kernel ctags tools.test io.backend sequences arrays prettyprint ;
|
||||||
IN: ctags.tests
|
IN: ctags.tests
|
||||||
|
|
||||||
|
[ t ] [
|
||||||
|
91
|
||||||
|
{ { if { "resource:extra/unix/unix.factor" 91 } } } ctag-lineno =
|
||||||
|
] unit-test
|
||||||
|
|
||||||
|
[ t ] [
|
||||||
|
"resource:extra/unix/unix.factor"
|
||||||
|
{ { if { "resource:extra/unix/unix.factor" 91 } } } ctag-path =
|
||||||
|
] unit-test
|
||||||
|
|
||||||
|
[ t ] [
|
||||||
|
if
|
||||||
|
{ { if { "resource:extra/unix/unix.factor" 91 } } } ctag-word =
|
||||||
|
] unit-test
|
||||||
|
|
||||||
[ t ] [
|
[ t ] [
|
||||||
"if\t" "resource:extra/unix/unix.factor" normalize-path "\t91" 3append
|
"if\t" "resource:extra/unix/unix.factor" normalize-path "\t91" 3append
|
||||||
{ if { "resource:extra/unix/unix.factor" 91 } } ctag =
|
{ if { "resource:extra/unix/unix.factor" 91 } } ctag =
|
||||||
|
@ -9,4 +24,5 @@ IN: ctags.tests
|
||||||
[ t ] [
|
[ t ] [
|
||||||
"if\t" "resource:extra/unix/unix.factor" normalize-path "\t91" 3append 1array
|
"if\t" "resource:extra/unix/unix.factor" normalize-path "\t91" 3append 1array
|
||||||
{ { if { "resource:extra/unix/unix.factor" 91 } } } ctag-strings =
|
{ { if { "resource:extra/unix/unix.factor" 91 } } } ctag-strings =
|
||||||
] unit-test
|
] unit-test
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue