diff options
| author | Alan Mackenzie | 2019-04-13 13:29:58 +0000 |
|---|---|---|
| committer | Alan Mackenzie | 2019-04-13 13:29:58 +0000 |
| commit | f9694a713824d402bcba01064ac2f95156bf4161 (patch) | |
| tree | dc202523afc5e6d9b191a3e46444d5ce2350b7d5 | |
| parent | c2c9ef2c1e509f1a01ffaefd7475004854162a10 (diff) | |
| download | emacs-f9694a713824d402bcba01064ac2f95156bf4161.tar.gz emacs-f9694a713824d402bcba01064ac2f95156bf4161.zip | |
Implement "final" before C++ class inheritance lists.
* lisp/progmodes/cc-langs.el (c-class-id-suffix-ws-ids-kwds)
(c-class-id-suffix-ws-ids-key): New lang const/var.
* lisp/progmodes/cc-engine.el (c-guess-basic-syntax CASE 5D.4): Check for and
skip over any matches for c-class-id-suffix-ws-ids-key (i.e. "final") before
":".
| -rw-r--r-- | lisp/progmodes/cc-engine.el | 7 | ||||
| -rw-r--r-- | lisp/progmodes/cc-langs.el | 13 |
2 files changed, 20 insertions, 0 deletions
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index fc8c377f277..f0b44d2183d 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el | |||
| @@ -12734,6 +12734,13 @@ comment at the start of cc-engine.el for more info." | |||
| 12734 | (if (eq (char-after) ?<) | 12734 | (if (eq (char-after) ?<) |
| 12735 | (zerop (c-forward-token-2 1 t indent-point)) | 12735 | (zerop (c-forward-token-2 1 t indent-point)) |
| 12736 | t) | 12736 | t) |
| 12737 | (progn | ||
| 12738 | (while | ||
| 12739 | (and | ||
| 12740 | (< (point) indent-point) | ||
| 12741 | (looking-at c-class-id-suffix-ws-ids-key) | ||
| 12742 | (zerop (c-forward-token-2 1 nil indent-point)))) | ||
| 12743 | t) | ||
| 12737 | (eq (char-after) ?:)))) | 12744 | (eq (char-after) ?:)))) |
| 12738 | (goto-char placeholder) | 12745 | (goto-char placeholder) |
| 12739 | (c-add-syntax 'inher-cont (c-point 'boi))) | 12746 | (c-add-syntax 'inher-cont (c-point 'boi))) |
diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el index 2dff5cf83c8..b5c3ff33352 100644 --- a/lisp/progmodes/cc-langs.el +++ b/lisp/progmodes/cc-langs.el | |||
| @@ -2049,6 +2049,19 @@ effect in the declaration, but are syntactically like whitespace." | |||
| 2049 | (c-lang-defvar c-type-decl-suffix-ws-ids-key | 2049 | (c-lang-defvar c-type-decl-suffix-ws-ids-key |
| 2050 | (c-lang-const c-type-decl-suffix-ws-ids-key)) | 2050 | (c-lang-const c-type-decl-suffix-ws-ids-key)) |
| 2051 | 2051 | ||
| 2052 | (c-lang-defconst c-class-id-suffix-ws-ids-kwds | ||
| 2053 | "\"Identifiers\" that when immediately following the identifier | ||
| 2054 | of a class declaration have semantic effect in the declaration, | ||
| 2055 | but are syntactially like whitespace." | ||
| 2056 | t nil | ||
| 2057 | c++ '("final")) | ||
| 2058 | |||
| 2059 | (c-lang-defconst c-class-id-suffix-ws-ids-key | ||
| 2060 | ;; An adorned regexp matching `c-class-id-suffix-ws-ids-kwds'. | ||
| 2061 | t (c-make-keywords-re t (c-lang-const c-class-id-suffix-ws-ids-kwds))) | ||
| 2062 | (c-lang-defvar c-class-id-suffix-ws-ids-key | ||
| 2063 | (c-lang-const c-class-id-suffix-ws-ids-key)) | ||
| 2064 | |||
| 2052 | (c-lang-defconst c-class-decl-kwds | 2065 | (c-lang-defconst c-class-decl-kwds |
| 2053 | "Keywords introducing declarations where the following block (if any) | 2066 | "Keywords introducing declarations where the following block (if any) |
| 2054 | contains another declaration level that should be considered a class. | 2067 | contains another declaration level that should be considered a class. |