]> code.delx.au - gnu-emacs/commitdiff
Fix Lua tags when a function name includes '.' or ':'
authorEli Zaretskii <eliz@gnu.org>
Sat, 28 Nov 2015 10:29:18 +0000 (12:29 +0200)
committerEli Zaretskii <eliz@gnu.org>
Sat, 28 Nov 2015 10:29:18 +0000 (12:29 +0200)
* 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

index 8b980d365efafeb4d8a212a787a100a4df7fa614..5f985b027b22ce5e0b93b46a1e673d8c85bd21bf 100644 (file)
@@ -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);
+           }
+       }
     }
 }