diff options
| author | Eli Zaretskii | 2016-03-10 17:27:26 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2016-03-10 17:27:26 +0200 |
| commit | a589e9aed5255fb1ebfb38fa4b3c9df5f6ef7448 (patch) | |
| tree | c48c023858e992968ce74a7cc8bd8e3aeea3ffe3 /lib-src | |
| parent | 72c7438c4c6ee0d24405636cde4b18c32034a634 (diff) | |
| download | emacs-a589e9aed5255fb1ebfb38fa4b3c9df5f6ef7448.tar.gz emacs-a589e9aed5255fb1ebfb38fa4b3c9df5f6ef7448.zip | |
By default, etags produces unqualified Perl tag names
* lib-src/etags.c (Perl_functions): Produce unqualified names,
unless -Q was specified.
(print_help): Update the description of -Q.
* doc/man/etags.1: Update the documentation of -Q.
* test/etags/ETAGS.good_1:
* test/etags/ETAGS.good_2:
* test/etags/ETAGS.good_3:
* test/etags/ETAGS.good_4:
* test/etags/ETAGS.good_5:
* test/etags/CTAGS.good: Adapt the expected test results to the
changed Perl functionality.
Diffstat (limited to 'lib-src')
| -rw-r--r-- | lib-src/etags.c | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/lib-src/etags.c b/lib-src/etags.c index 182cb4cc876..e8e15769606 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c | |||
| @@ -971,11 +971,12 @@ Relative ones are stored relative to the output file's directory.\n"); | |||
| 971 | in some languages."); | 971 | in some languages."); |
| 972 | 972 | ||
| 973 | puts ("-Q, --class-qualify\n\ | 973 | puts ("-Q, --class-qualify\n\ |
| 974 | Qualify tag names with their class name in C++, ObjC, and Java.\n\ | 974 | Qualify tag names with their class name in C++, ObjC, Java, and Perl.\n\ |
| 975 | This produces tag names of the form \"class::member\" for C++,\n\ | 975 | This produces tag names of the form \"class::member\" for C++,\n\ |
| 976 | \"class(category)\" for Objective C, and \"class.member\" for Java.\n\ | 976 | \"class(category)\" for Objective C, and \"class.member\" for Java.\n\ |
| 977 | For Objective C, this also produces class methods qualified with\n\ | 977 | For Objective C, this also produces class methods qualified with\n\ |
| 978 | their arguments, as in \"foo:bar:baz:more\"."); | 978 | their arguments, as in \"foo:bar:baz:more\".\n\ |
| 979 | For Perl, this produces \"package::member\"."); | ||
| 979 | puts ("-r REGEXP, --regex=REGEXP or --regex=@regexfile\n\ | 980 | puts ("-r REGEXP, --regex=REGEXP or --regex=@regexfile\n\ |
| 980 | Make a tag for each line matching a regular expression pattern\n\ | 981 | Make a tag for each line matching a regular expression pattern\n\ |
| 981 | in the following files. {LANGUAGE}REGEXP uses REGEXP for LANGUAGE\n\ | 982 | in the following files. {LANGUAGE}REGEXP uses REGEXP for LANGUAGE\n\ |
| @@ -4534,10 +4535,21 @@ Perl_functions (FILE *inf) | |||
| 4534 | continue; /* nothing found */ | 4535 | continue; /* nothing found */ |
| 4535 | pos = strchr (sp, ':'); | 4536 | pos = strchr (sp, ':'); |
| 4536 | if (pos && pos < cp && pos[1] == ':') | 4537 | if (pos && pos < cp && pos[1] == ':') |
| 4537 | /* The name is already qualified. */ | 4538 | { |
| 4538 | make_tag (sp, cp - sp, true, | 4539 | /* The name is already qualified. */ |
| 4539 | lb.buffer, cp - lb.buffer + 1, lineno, linecharno); | 4540 | if (!class_qualify) |
| 4540 | else | 4541 | { |
| 4542 | char *q = pos + 2, *qpos; | ||
| 4543 | while ((qpos = strchr (q, ':')) != NULL | ||
| 4544 | && qpos < cp | ||
| 4545 | && qpos[1] == ':') | ||
| 4546 | q = qpos + 2; | ||
| 4547 | sp = q; | ||
| 4548 | } | ||
| 4549 | make_tag (sp, cp - sp, true, | ||
| 4550 | lb.buffer, cp - lb.buffer + 1, lineno, linecharno); | ||
| 4551 | } | ||
| 4552 | else if (class_qualify) | ||
| 4541 | /* Qualify it. */ | 4553 | /* Qualify it. */ |
| 4542 | { | 4554 | { |
| 4543 | char savechar, *name; | 4555 | char savechar, *name; |
| @@ -4550,6 +4562,9 @@ Perl_functions (FILE *inf) | |||
| 4550 | lb.buffer, cp - lb.buffer + 1, lineno, linecharno); | 4562 | lb.buffer, cp - lb.buffer + 1, lineno, linecharno); |
| 4551 | free (name); | 4563 | free (name); |
| 4552 | } | 4564 | } |
| 4565 | else | ||
| 4566 | make_tag (sp, cp - sp, true, | ||
| 4567 | lb.buffer, cp - lb.buffer + 1, lineno, linecharno); | ||
| 4553 | } | 4568 | } |
| 4554 | else if (LOOKING_AT (cp, "use constant") | 4569 | else if (LOOKING_AT (cp, "use constant") |
| 4555 | || LOOKING_AT (cp, "use constant::defer")) | 4570 | || LOOKING_AT (cp, "use constant::defer")) |