]> gitweb.factorcode.org Git - factor.git/commitdiff
Added some helper functions that may be used both in ctags and etags
authorAlfredo Beaumont <alfredo.beaumont@gmail.com>
Sun, 13 Jul 2008 15:05:41 +0000 (17:05 +0200)
committerAlfredo Beaumont <alfredo.beaumont@gmail.com>
Sun, 13 Jul 2008 15:05:41 +0000 (17:05 +0200)
extra/ctags/ctags.factor

index 2ec1208df9774957f003235d6308d4c4e2c6cccb..e8c5608375cb9e569658ce1c5f64399a429c3513 100644 (file)
@@ -9,13 +9,22 @@ io.encodings.ascii math.parser vocabs definitions
 namespaces words sorting ;
 IN: ctags
 
+: ctag-word ( ctag -- word )
+  first ;
+
+: ctag-path ( ctag -- path )
+  second first ;
+
+: ctag-lineno ( ctag -- n )
+  second second ;
+
 : ctag ( seq -- str )
   [
-    dup first ?word-name %
+    dup ctag-word ?word-name %
     "\t" %
-    second dup first normalize-path %
+    dup ctag-path normalize-path %
     "\t" %
-    second number>string %
+    ctag-lineno number>string %
   ] "" make ;
 
 : ctag-strings ( seq1 -- seq2 )