]> git.lizzy.rs Git - rust.git/commitdiff
new targets, TAGS.emacs and TAGS.vi. they must be manually made.
authorNiko Matsakis <niko@alum.mit.edu>
Wed, 12 Oct 2011 19:10:21 +0000 (12:10 -0700)
committerBrian Anderson <banderson@mozilla.com>
Wed, 12 Oct 2011 20:57:32 +0000 (13:57 -0700)
Makefile.in
mk/ctags.mk [new file with mode: 0644]
mk/ctags.rust [new file with mode: 0644]

index 4b6c48779eb4d37e50af0773eaa78a2508b4d98e..a2b1a86cef5db19a929e0498b4f92e6308d2abf1 100644 (file)
@@ -332,7 +332,6 @@ include $(CFG_SRC_DIR)/mk/autodep.mk
 include $(CFG_SRC_DIR)/mk/tools.mk
 include $(CFG_SRC_DIR)/mk/docs.mk
 
-
 ######################################################################
 # Secondary makefiles, conditionalized for speed
 ######################################################################
@@ -378,4 +377,10 @@ endif
 ifneq ($(findstring install,$(MAKECMDGOALS)),)
   CFG_INFO := $(info cfg: including install rules)
   include $(CFG_SRC_DIR)/mk/install.mk
-endif
\ No newline at end of file
+endif
+
+ifneq ($(strip $(findstring TAGS.emacs,$(MAKECMDGOALS)) \
+               $(findstring TAGS.vi,$(MAKECMDGOALS))),)
+  CFG_INFO := $(info cfg: including ctags rules)
+  include $(CFG_SRC_DIR)/mk/ctags.mk
+endif
diff --git a/mk/ctags.mk b/mk/ctags.mk
new file mode 100644 (file)
index 0000000..8f4aa6b
--- /dev/null
@@ -0,0 +1,12 @@
+######################################################################
+# TAGS file creation.  No dependency tracking, just do it on demand.
+# Requires Exuberant Ctags: http://ctags.sourceforge.net/index.html
+######################################################################
+
+CTAGS_OPTS=--options=${CFG_SRC_DIR}/mk/ctags.rust -R ${CFG_SRC_DIR}/src
+
+TAGS.emacs:
+       ctags -e -f $@ ${CTAGS_OPTS}
+
+TAGS.vi:
+       ctags -f $@ ${CTAGS_OPTS}
diff --git a/mk/ctags.rust b/mk/ctags.rust
new file mode 100644 (file)
index 0000000..3f9bbca
--- /dev/null
@@ -0,0 +1,7 @@
+--langdef=rust
+--langmap=rust:.rs
+--regex-rust=/[ \t]*fn[ \t]+([a-zA-Z0-9_]+)/\1/f,function/
+--regex-rust=/[ \t]*type[ \t]+([a-zA-Z0-9_]+)/\1/T,types/
+--regex-rust=/[ \t]*tag[ \t]+([a-zA-Z0-9_]+)/\1/T,types/
+--regex-rust=/[ \t]*resource[ \t]+([a-zA-Z0-9_]+)/\1/T,types/
+--regex-rust=/[ \t]*mod[ \t]+([a-zA-Z0-9_]+)/\1/m,modules/