From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "David A. Capello" Newsgroups: gmane.emacs.devel Subject: Lua support for etags Date: Fri, 20 Feb 2004 23:40:29 -0300 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <20040221024029.GA5864@killerpc> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1077331568 8051 80.91.224.253 (21 Feb 2004 02:46:08 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 21 Feb 2004 02:46:08 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Sat Feb 21 03:46:04 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AuN9Y-00049U-00 for ; Sat, 21 Feb 2004 03:46:04 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1AuN9Y-0005Ko-00 for ; Sat, 21 Feb 2004 03:46:04 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1AuN5D-0006r1-VD for emacs-devel@quimby.gnus.org; Fri, 20 Feb 2004 21:41:35 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1AuN4U-0006ZT-AT for emacs-devel@gnu.org; Fri, 20 Feb 2004 21:40:50 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1AuN3w-0006Ap-VW for emacs-devel@gnu.org; Fri, 20 Feb 2004 21:40:48 -0500 Original-Received: from [38.113.3.61] (helo=babyruth.hotpop.com) by monty-python.gnu.org with esmtp (Exim 4.30) id 1AuN3w-00068U-GR for emacs-devel@gnu.org; Fri, 20 Feb 2004 21:40:16 -0500 Original-Received: from hotpop.com (kubrick.hotpop.com [38.113.3.103]) by babyruth.hotpop.com (Postfix) with SMTP id E509A11C369 for ; Sat, 21 Feb 2004 02:35:51 +0000 (UTC) Original-Received: from killerpc (200-70-88-3.mrse.com.ar [200.70.88.3]) by smtp-2.hotpop.com (Postfix) with ESMTP id B6EB011C2B0 for ; Sat, 21 Feb 2004 02:35:50 +0000 (UTC) Original-Received: from dacap by killerpc with local (Exim 3.35 #1 (Debian)) id 1AuN49-0001Xz-00 for ; Fri, 20 Feb 2004 23:40:29 -0300 Original-To: emacs-devel@gnu.org Mail-Followup-To: "David A. Capello" , emacs-devel@gnu.org Content-Disposition: inline User-Agent: Mutt/1.5.6i X-HotPOP: ----------------------------------------------- Sent By HotPOP.com FREE Email Get your FREE POP email at www.HotPOP.com ----------------------------------------------- X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:20089 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:20089 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); } }