diff options
-rw-r--r-- | lisp/progmodes/cc-menus.el | 49 |
1 files changed, 36 insertions, 13 deletions
diff --git a/lisp/progmodes/cc-menus.el b/lisp/progmodes/cc-menus.el index b151bd0244f..02636c02787 100644 --- a/lisp/progmodes/cc-menus.el +++ b/lisp/progmodes/cc-menus.el @@ -149,22 +149,45 @@ A sample value might look like: `\\(_P\\|_PROTO\\)'.") (defvar cc-imenu-java-generic-expression `((nil ,(concat - "[" c-alpha "_][\]\[." c-alnum "_]+[ \t\n\r]+" ; type spec + "[" c-alpha "_][\]\[." c-alnum "_<> ]+[ \t\n\r]+" ; type spec "\\([" c-alpha "_][" c-alnum "_]+\\)" ; method name "[ \t\n\r]*" - ;; An argument list that is either empty or contains at least - ;; two identifiers with only space between them. This avoids - ;; matching e.g. "else if (foo)". - (concat "([ \t\n\r]*" - "\\([\]\[.," c-alnum "_]+" - "[ \t\n\r]+" - "[\]\[.," c-alnum "_]" - "[\]\[.," c-alnum "_ \t\n\r]*" - "\\)?)") - "[.," c-alnum "_ \t\n\r]*" + ;; An argument list htat is either empty or contains any number + ;; of arguments. An argument is any number of annotations + ;; followed by a type spec followed by a word. A word is an + ;; identifier. A type spec is an identifier, possibly followed + ;; by < typespec > possibly followed by []. + (concat "(" + "\\(" + "[ \t\n\r]*" + "\\(" + "@" + "[" c-alpha "_]" + "[" c-alnum "._]""*" + "[ \t\n\r]+" + "\\)*" + "\\(" + "[" c-alpha "_]" + "[\]\[" c-alnum "_.]*" + "\\(" + "<" + "[ \t\n\r]*" + "[\]\[.," c-alnum "_<> \t\n\r]*" + ">" + "\\)?" + "\\(\\[\\]\\)?" + "[ \t\n\r]+" + "\\)" + "[" c-alpha "_]" + "[" c-alnum "_]*" + "[ \t\n\r,]*" + "\\)*" + ")" + "[ \t\n\r]*" "{" - ) 1)) - "Imenu generic expression for Java mode. See `imenu-generic-expression'.") + )) 1)) + "Imenu generic expression for Java mode. See +`imenu-generic-expression'.") ;; *Warning for cc-mode developers* ;; |