emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs-25 690ccf0: Fix Lua tags when a function name includ


From: Eli Zaretskii
Subject: [Emacs-diffs] emacs-25 690ccf0: Fix Lua tags when a function name includes '.' or ':'
Date: Sat, 28 Nov 2015 10:31:11 +0000

branch: emacs-25
commit 690ccf0f0d9c609b809ff3d10475f259748e4773
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    Fix Lua tags when a function name includes '.' or ':'
    
    * lib-src/etags.c (Lua_functions): Add a tag for the last element
    of a function name after a dot or a colon.  (Bug#21934)
---
 lib-src/etags.c |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/lib-src/etags.c b/lib-src/etags.c
index 8b980d3..5f985b0 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -4954,7 +4954,22 @@ Lua_functions (FILE *inf)
       (void)LOOKING_AT (bp, "local"); /* skip possible "local" */
 
       if (LOOKING_AT (bp, "function"))
-       get_tag (bp, NULL);
+       {
+         char *tag_name, *tp_dot, *tp_colon;
+
+         get_tag (bp, &tag_name);
+         /* If the tag ends with ".foo" or ":foo", make an additional tag for
+            "foo".  */
+         tp_dot = strrchr (tag_name, '.');
+         tp_colon = strrchr (tag_name, ':');
+         if (tp_dot || tp_colon)
+           {
+             char *p = tp_dot > tp_colon ? tp_dot : tp_colon;
+             int len_add = p - tag_name + 1;
+
+             get_tag (bp + len_add, NULL);
+           }
+       }
     }
 }
 



reply via email to

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