This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
+the Free Software Foundation, either version 3 of the License, or (at
+your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
static const char Objc_help [] =
"In Objective C code, tags include Objective C definitions for classes,\n\
class categories, methods and protocols. Tags for variables and\n\
-functions in classes are named 'CLASS::VARIABLE' and 'CLASS::FUNCTION'.\n\
-(Use --help --lang=c --lang=objc --lang=java for full help.)";
+functions in classes are named 'CLASS::VARIABLE' and 'CLASS::FUNCTION'.\
+\n(Use --help --lang=c --lang=objc --lang=java for full help.)";
static const char *Pascal_suffixes [] =
{ "p", "pas", NULL };
Do not create tag entries for global variables in some\n\
languages. This makes the tags file smaller.");
- if (PRINT_UNDOCUMENTED_OPTIONS_HELP)
- puts ("--no-line-directive\n\
+ puts ("--no-line-directive\n\
Ignore #line preprocessor directives in C and derived languages.");
if (CTAGS)
in some languages.");
puts ("-Q, --class-qualify\n\
- Qualify tag names with their class name in C++, ObjC, and Java.\n\
+ Qualify tag names with their class name in C++, ObjC, Java, and Perl.\n\
This produces tag names of the form \"class::member\" for C++,\n\
\"class(category)\" for Objective C, and \"class.member\" for Java.\n\
For Objective C, this also produces class methods qualified with\n\
- their arguments, as in \"foo:bar:baz:more\".");
+ their arguments, as in \"foo:bar:baz:more\".\n\
+ For Perl, this produces \"package::member\".");
puts ("-r REGEXP, --regex=REGEXP or --regex=@regexfile\n\
Make a tag for each line matching a regular expression pattern\n\
in the following files. {LANGUAGE}REGEXP uses REGEXP for LANGUAGE\n\
continue; /* nothing found */
pos = strchr (sp, ':');
if (pos && pos < cp && pos[1] == ':')
- /* The name is already qualified. */
- make_tag (sp, cp - sp, true,
- lb.buffer, cp - lb.buffer + 1, lineno, linecharno);
- else
+ {
+ /* The name is already qualified. */
+ if (!class_qualify)
+ {
+ char *q = pos + 2, *qpos;
+ while ((qpos = strchr (q, ':')) != NULL
+ && qpos < cp
+ && qpos[1] == ':')
+ q = qpos + 2;
+ sp = q;
+ }
+ make_tag (sp, cp - sp, true,
+ lb.buffer, cp - lb.buffer + 1, lineno, linecharno);
+ }
+ else if (class_qualify)
/* Qualify it. */
{
char savechar, *name;
lb.buffer, cp - lb.buffer + 1, lineno, linecharno);
free (name);
}
+ else
+ make_tag (sp, cp - sp, true,
+ lb.buffer, cp - lb.buffer + 1, lineno, linecharno);
}
else if (LOOKING_AT (cp, "use constant")
|| LOOKING_AT (cp, "use constant::defer"))