diff options
| author | Eli Zaretskii | 2024-08-18 11:59:28 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2024-08-18 11:59:28 +0300 |
| commit | 754d83d981f7ba28a05b5ce37307ead4596ec95f (patch) | |
| tree | 95bfd491696c74725cbec8a71f565d60c93938a3 /lib-src | |
| parent | 135da3556bb34bb20a01e02b30bc949c1a45b6cd (diff) | |
| download | emacs-754d83d981f7ba28a05b5ce37307ead4596ec95f.tar.gz emacs-754d83d981f7ba28a05b5ce37307ead4596ec95f.zip | |
Fix finding tags by 'etags' in Java source code
* lib-src/etags.c (C_entries): A comma is not special inside class
parameters <..>. (Bug#72402)
(hash, in_word_set): Regenerated after adding "@SuppressWarnings"
to wordlist[]. This avoids missing tags preceded by
"@SuppressWarnings".
Diffstat (limited to 'lib-src')
| -rw-r--r-- | lib-src/etags.c | 76 |
1 files changed, 40 insertions, 36 deletions
diff --git a/lib-src/etags.c b/lib-src/etags.c index edadbc25901..4684ca82935 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c | |||
| @@ -2633,6 +2633,7 @@ SYSCALL, 0, st_C_gnumacro | |||
| 2633 | ENTRY, 0, st_C_gnumacro | 2633 | ENTRY, 0, st_C_gnumacro |
| 2634 | PSEUDO, 0, st_C_gnumacro | 2634 | PSEUDO, 0, st_C_gnumacro |
| 2635 | ENUM_BF, 0, st_C_enum_bf | 2635 | ENUM_BF, 0, st_C_enum_bf |
| 2636 | @SuppressWarnings, (C_JAVA & ~C_PLPL), st_C_attribute | ||
| 2636 | # These are defined inside C functions, so currently they are not met. | 2637 | # These are defined inside C functions, so currently they are not met. |
| 2637 | # EXFUN used in glibc, DEFVAR_* in emacs. | 2638 | # EXFUN used in glibc, DEFVAR_* in emacs. |
| 2638 | #EXFUN, 0, st_C_gnumacro | 2639 | #EXFUN, 0, st_C_gnumacro |
| @@ -2644,44 +2645,44 @@ and replace lines between %< and %> with its output, then: | |||
| 2644 | - make in_word_set static and not inline | 2645 | - make in_word_set static and not inline |
| 2645 | - remove any 'register' qualifications from variable decls. */ | 2646 | - remove any 'register' qualifications from variable decls. */ |
| 2646 | /*%<*/ | 2647 | /*%<*/ |
| 2647 | /* C code produced by gperf version 3.0.1 */ | 2648 | /* ANSI-C code produced by gperf version 3.1 */ |
| 2648 | /* Command-line: gperf -m 5 */ | 2649 | /* Command-line: gperf -m 5 gperf.inp */ |
| 2649 | /* Computed positions: -k'2-3' */ | 2650 | /* Computed positions: -k'2-3' */ |
| 2650 | 2651 | ||
| 2651 | struct C_stab_entry { const char *name; int c_ext; enum sym_type type; }; | 2652 | struct C_stab_entry { const char *name; int c_ext; enum sym_type type; }; |
| 2652 | /* maximum key range = 34, duplicates = 0 */ | 2653 | /* maximum key range = 36, duplicates = 0 */ |
| 2653 | 2654 | ||
| 2654 | static int | 2655 | static int |
| 2655 | hash (const char *str, int len) | 2656 | hash (const char *str, int len) |
| 2656 | { | 2657 | { |
| 2657 | static char const asso_values[] = | 2658 | static char const asso_values[] = |
| 2658 | { | 2659 | { |
| 2659 | 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, | 2660 | 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, |
| 2660 | 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, | 2661 | 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, |
| 2661 | 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, | 2662 | 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, |
| 2662 | 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, | 2663 | 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, |
| 2663 | 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, | 2664 | 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, |
| 2664 | 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, | 2665 | 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, |
| 2665 | 36, 36, 36, 36, 36, 36, 36, 36, 36, 3, | 2666 | 38, 38, 38, 38, 38, 38, 38, 38, 38, 29, |
| 2666 | 27, 36, 36, 36, 36, 36, 36, 36, 26, 36, | 2667 | 3, 38, 38, 38, 38, 38, 38, 38, 23, 38, |
| 2667 | 36, 36, 36, 25, 0, 0, 36, 36, 36, 0, | 2668 | 38, 38, 38, 0, 5, 4, 38, 38, 38, 24, |
| 2668 | 36, 36, 36, 36, 36, 1, 36, 16, 36, 6, | 2669 | 38, 38, 38, 38, 38, 1, 38, 16, 38, 6, |
| 2669 | 23, 0, 0, 36, 22, 0, 36, 36, 5, 0, | 2670 | 23, 0, 0, 38, 22, 0, 38, 38, 5, 0, |
| 2670 | 0, 15, 1, 36, 6, 36, 8, 19, 36, 16, | 2671 | 0, 15, 1, 38, 6, 38, 8, 19, 38, 16, |
| 2671 | 4, 5, 36, 36, 36, 36, 36, 36, 36, 36, | 2672 | 4, 5, 38, 38, 38, 38, 38, 38, 38, 38, |
| 2672 | 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, | 2673 | 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, |
| 2673 | 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, | 2674 | 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, |
| 2674 | 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, | 2675 | 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, |
| 2675 | 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, | 2676 | 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, |
| 2676 | 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, | 2677 | 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, |
| 2677 | 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, | 2678 | 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, |
| 2678 | 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, | 2679 | 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, |
| 2679 | 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, | 2680 | 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, |
| 2680 | 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, | 2681 | 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, |
| 2681 | 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, | 2682 | 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, |
| 2682 | 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, | 2683 | 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, |
| 2683 | 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, | 2684 | 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, |
| 2684 | 36, 36, 36, 36, 36, 36 | 2685 | 38, 38, 38, 38, 38, 38 |
| 2685 | }; | 2686 | }; |
| 2686 | int hval = len; | 2687 | int hval = len; |
| 2687 | 2688 | ||
| @@ -2702,18 +2703,18 @@ in_word_set (const char *str, ptrdiff_t len) | |||
| 2702 | { | 2703 | { |
| 2703 | enum | 2704 | enum |
| 2704 | { | 2705 | { |
| 2705 | TOTAL_KEYWORDS = 34, | 2706 | TOTAL_KEYWORDS = 35, |
| 2706 | MIN_WORD_LENGTH = 2, | 2707 | MIN_WORD_LENGTH = 2, |
| 2707 | MAX_WORD_LENGTH = 15, | 2708 | MAX_WORD_LENGTH = 17, |
| 2708 | MIN_HASH_VALUE = 2, | 2709 | MIN_HASH_VALUE = 2, |
| 2709 | MAX_HASH_VALUE = 35 | 2710 | MAX_HASH_VALUE = 37 |
| 2710 | }; | 2711 | }; |
| 2711 | 2712 | ||
| 2712 | static struct C_stab_entry wordlist[] = | 2713 | static struct C_stab_entry wordlist[] = |
| 2713 | { | 2714 | { |
| 2714 | {""}, {""}, | 2715 | {""}, {""}, |
| 2715 | {"if", 0, st_C_ignore}, | 2716 | {"if", 0, st_C_ignore}, |
| 2716 | {"GTY", 0, st_C_attribute}, | 2717 | {""}, |
| 2717 | {"@end", 0, st_C_objend}, | 2718 | {"@end", 0, st_C_objend}, |
| 2718 | {"union", 0, st_C_struct}, | 2719 | {"union", 0, st_C_struct}, |
| 2719 | {"define", 0, st_C_define}, | 2720 | {"define", 0, st_C_define}, |
| @@ -2741,10 +2742,12 @@ in_word_set (const char *str, ptrdiff_t len) | |||
| 2741 | {"undef", 0, st_C_define}, | 2742 | {"undef", 0, st_C_define}, |
| 2742 | {"package", (C_JAVA & ~C_PLPL), st_C_ignore}, | 2743 | {"package", (C_JAVA & ~C_PLPL), st_C_ignore}, |
| 2743 | {"__attribute__", 0, st_C_attribute}, | 2744 | {"__attribute__", 0, st_C_attribute}, |
| 2744 | {"ENTRY", 0, st_C_gnumacro}, | ||
| 2745 | {"SYSCALL", 0, st_C_gnumacro}, | 2745 | {"SYSCALL", 0, st_C_gnumacro}, |
| 2746 | {"GTY", 0, st_C_attribute}, | ||
| 2747 | {"ENTRY", 0, st_C_gnumacro}, | ||
| 2746 | {"ENUM_BF", 0, st_C_enum_bf}, | 2748 | {"ENUM_BF", 0, st_C_enum_bf}, |
| 2747 | {"PSEUDO", 0, st_C_gnumacro}, | 2749 | {"PSEUDO", 0, st_C_gnumacro}, |
| 2750 | {"@SuppressWarnings", (C_JAVA & ~C_PLPL), st_C_attribute}, | ||
| 2748 | {"DEFUN", 0, st_C_gnumacro} | 2751 | {"DEFUN", 0, st_C_gnumacro} |
| 2749 | }; | 2752 | }; |
| 2750 | 2753 | ||
| @@ -3012,7 +3015,6 @@ consider_token (char *str, /* IN: token pointer */ | |||
| 3012 | static ptrdiff_t structbracelev; | 3015 | static ptrdiff_t structbracelev; |
| 3013 | static enum sym_type toktype; | 3016 | static enum sym_type toktype; |
| 3014 | 3017 | ||
| 3015 | |||
| 3016 | toktype = C_symtype (str, len, *c_extp); | 3018 | toktype = C_symtype (str, len, *c_extp); |
| 3017 | 3019 | ||
| 3018 | /* | 3020 | /* |
| @@ -4016,7 +4018,9 @@ C_entries (int c_ext, /* extension of C */ | |||
| 4016 | default: | 4018 | default: |
| 4017 | fvdef = fvnone; | 4019 | fvdef = fvnone; |
| 4018 | } | 4020 | } |
| 4019 | if (structdef == stagseen) | 4021 | if (structdef == stagseen |
| 4022 | /* class Foo<K,V,T>... */ | ||
| 4023 | && !(cjava && templatelev > 0)) | ||
| 4020 | structdef = snone; | 4024 | structdef = snone; |
| 4021 | break; | 4025 | break; |
| 4022 | case ']': | 4026 | case ']': |