diff options
| author | Eli Zaretskii <eliz@gnu.org> | 2013-09-26 10:37:16 +0300 |
|---|---|---|
| committer | Eli Zaretskii <eliz@gnu.org> | 2013-09-26 10:37:16 +0300 |
| commit | b87c4ff2817e71ca71b028792200b1e069a95e04 (patch) | |
| tree | bfe00c0655fa02078a9ab2c633ea06d90c4a2064 /lisp/progmodes/cc-langs.el | |
| parent | bbc108377873aa6ed7cf21c731770103096eea39 (diff) | |
| parent | ba355de014b75ed104da4777f909db70d62f2357 (diff) | |
| download | emacs-b87c4ff2817e71ca71b028792200b1e069a95e04.tar.gz | |
Merge from trunk.
Diffstat (limited to 'lisp/progmodes/cc-langs.el')
| -rw-r--r-- | lisp/progmodes/cc-langs.el | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el index 0116e9ec3dd..c1e8a1524dc 100644 --- a/lisp/progmodes/cc-langs.el +++ b/lisp/progmodes/cc-langs.el @@ -2587,6 +2587,15 @@ Note that Java specific rules are currently applied to tell this from ;;; Additional constants for parser-level constructs. +(c-lang-defconst c-decl-start-colon-kwd-re + "Regexp matching a keyword that is followed by a colon, where + the whole construct can precede a declaration. + E.g. \"public:\" in C++." + t "\\<\\>" + c++ (c-make-keywords-re t (c-lang-const c-protection-kwds))) +(c-lang-defvar c-decl-start-colon-kwd-re + (c-lang-const c-decl-start-colon-kwd-re)) + (c-lang-defconst c-decl-prefix-re "Regexp matching something that might precede a declaration, cast or label, such as the last token of a preceding statement or declaration. @@ -2626,8 +2635,11 @@ more info." java "\\([\{\}\(;,<]+\\)" ;; Match "<" in C++ to get the first argument in a template arglist. ;; In that case there's an additional check in `c-find-decl-spots' - ;; that it got open paren syntax. - c++ "\\([\{\}\(\);,<]+\\)" + ;; that it got open paren syntax. Match ":" to aid in picking up + ;; "public:", etc. This involves additional checks in + ;; `c-find-decl-prefix-search' to prevent a match of identifiers + ;; or labels. + c++ "\\([\{\}\(\);:,<]+\\)" ;; Additionally match the protection directives in Objective-C. ;; Note that this doesn't cope with the longer directives, which we ;; would have to match from start to end since they don't end with @@ -2816,7 +2828,8 @@ is in effect when this is matched (see `c-identifier-syntax-table')." "\\>") "") "\\)") - (java idl) "\\([\[\(]\\)") + java "\\([\[\(\)]\\)" + idl "\\([\[\(]\\)") (c-lang-defvar c-type-decl-suffix-key (c-lang-const c-type-decl-suffix-key) 'dont-doc) @@ -2937,7 +2950,7 @@ calls before a brace block. This setting does not affect declarations that are preceded by a declaration starting keyword, so e.g. `c-typeless-decl-kwds' may still be used when it's set to nil." t nil - (c c++ objc) t) + (c c++ objc java) t) (c-lang-defvar c-recognize-typeless-decls (c-lang-const c-recognize-typeless-decls)) |
