emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Lua support for etags


From: David A. Capello
Subject: Lua support for etags
Date: Fri, 20 Feb 2004 23:40:29 -0300
User-agent: Mutt/1.5.6i

This patch add support for Lua scripting language (http://www.lua.org)
in etags.

Index: etags.c
===================================================================
RCS file: /cvsroot/emacs/emacs/lib-src/etags.c,v
retrieving revision 3.37
diff -u -r3.37 etags.c
--- etags.c     3 Sep 2003 14:20:49 -0000       3.37
+++ etags.c     21 Feb 2004 02:29:12 -0000
@@ -335,6 +335,7 @@
 static void Fortran_functions __P((FILE *));
 static void HTML_labels __P((FILE *));
 static void Lisp_functions __P((FILE *));
+static void Lua_functions __P((FILE *));
 static void Makefile_targets __P((FILE *));
 static void Pascal_functions __P((FILE *));
 static void Perl_functions __P((FILE *));
@@ -639,6 +640,11 @@
 argument of any expression that starts with `(def' in column zero\n\
 is a tag.";
 
+static char *Lua_suffixes [] =
+  { "lua", "LUA", NULL };
+static char Lua_help [] =
+"In Lua scripts, any function.";
+
 static char *Makefile_filenames [] =
   { "Makefile", "makefile", "GNUMakefile", "Makefile.in", "Makefile.am", NULL};
 static char Makefile_help [] =
@@ -765,6 +771,7 @@
   { "html",      HTML_help,      HTML_labels,       HTML_suffixes      },
   { "java",      Cjava_help,     Cjava_entries,     Cjava_suffixes     },
   { "lisp",      Lisp_help,      Lisp_functions,    Lisp_suffixes      },
+  { "lua",       Lua_help,       Lua_functions,     Lua_suffixes       },
   { "makefile",  Makefile_help,Makefile_targets,NULL,Makefile_filenames},
   { "objc",      Objc_help,      plain_C_entries,   Objc_suffixes      },
   { "pascal",    Pascal_help,    Pascal_functions,  Pascal_suffixes    },
@@ -4893,6 +4900,30 @@
                }
            }
        }
+    }
+}
+
+
+/*
+ * Lua tag functions
+ *  look for function, local function.
+ */
+
+static void
+Lua_functions (inf)
+     FILE *inf;
+{
+  register char *bp;
+
+  LOOP_ON_INPUT_LINES (inf, lb, bp)
+    {
+      if (bp[0] != 'f' && bp[0] != 'l')
+       continue;
+
+      LOOKING_AT (bp, "local");
+
+      if (LOOKING_AT (bp, "function"))
+       get_tag (bp, NULL);
     }
 }
 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]