diff options
Diffstat (limited to 'lisp/progmodes/cc-langs.el')
-rw-r--r-- | lisp/progmodes/cc-langs.el | 63 |
1 files changed, 54 insertions, 9 deletions
diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el index 8c148e5e53d..50f8b8473be 100644 --- a/lisp/progmodes/cc-langs.el +++ b/lisp/progmodes/cc-langs.el @@ -1,6 +1,6 @@ ;;; cc-langs.el --- language specific settings for CC Mode -*- coding: utf-8 -*- -;; Copyright (C) 1985, 1987, 1992-2018 Free Software Foundation, Inc. +;; Copyright (C) 1985, 1987, 1992-2019 Free Software Foundation, Inc. ;; Authors: 2002- Alan Mackenzie ;; 1998- Martin Stjernholm @@ -497,25 +497,25 @@ parameters \(point-min) and \(point-max).") ;; For documentation see the following c-lang-defvar of the same name. ;; The value here may be a list of functions or a single function. t '(c-depropertize-new-text - c-after-change-re-mark-unbalanced-strings + c-after-change-mark-abnormal-strings c-change-expand-fl-region) (c objc) '(c-depropertize-new-text c-parse-quotes-after-change - c-after-change-re-mark-unbalanced-strings + c-after-change-mark-abnormal-strings c-extend-font-lock-region-for-macros c-neutralize-syntax-in-CPP c-change-expand-fl-region) c++ '(c-depropertize-new-text + c-after-change-unmark-raw-strings c-parse-quotes-after-change - c-after-change-re-mark-unbalanced-strings + c-after-change-mark-abnormal-strings c-extend-font-lock-region-for-macros - c-after-change-re-mark-raw-strings c-neutralize-syntax-in-CPP c-restore-<>-properties c-change-expand-fl-region) java '(c-depropertize-new-text c-parse-quotes-after-change - c-after-change-re-mark-unbalanced-strings + c-after-change-mark-abnormal-strings c-restore-<>-properties c-change-expand-fl-region) awk '(c-depropertize-new-text @@ -599,13 +599,21 @@ EOL terminated statements." (c-lang-defvar c-has-bitfields (c-lang-const c-has-bitfields)) (c-lang-defconst c-single-quotes-quote-strings - "Whether the language uses single quotes for multi-char strings." + "Whether the language uses single quotes for multi-char strings. + +Note that to set up a language to use this, additionally: +\(i) the syntax of \"'\" must be \"string quote\" (7); +\(ii) the language's value of `c-has-quoted-numbers' must be nil; +\(iii) the language's value of `c-get-state-before-change-functions' may not + contain `c-parse-quotes-before-change'; +\(iv) the language's value of `c-before-font-lock-functions' may not contain + `c-parse-quotes-after-change'." t nil) (c-lang-defvar c-single-quotes-quote-strings (c-lang-const c-single-quotes-quote-strings)) (c-lang-defconst c-string-delims - "A list of characters which can delimit arbitrary length strings" +;; A list of characters which can delimit arbitrary length strings. t (if (c-lang-const c-single-quotes-quote-strings) '(?\" ?\') '(?\"))) @@ -927,6 +935,19 @@ file name in angle brackets or quotes." '("include")) objc '("include" "import")) +(c-lang-defconst c-cpp-include-key + ;; Matches an include directive anchored at BOL including any trailing + ;; whitespace, e.g. " # include " + t (if (and (c-lang-const c-anchored-cpp-prefix) + (c-lang-const c-cpp-include-directives)) + (concat + (c-lang-const c-anchored-cpp-prefix) + (c-make-keywords-re 'appendable + (c-lang-const c-cpp-include-directives)) + "[ \t]*") + "a\\`")) ; Doesn't match anything +(c-lang-defvar c-cpp-include-key (c-lang-const c-cpp-include-key)) + (c-lang-defconst c-opt-cpp-macro-define "Cpp directive (without the prefix) that is followed by a macro definition, or nil if the language doesn't have any." @@ -1529,6 +1550,17 @@ properly." (c-lang-defvar c-block-comment-ender-regexp (c-lang-const c-block-comment-ender-regexp)) +(c-lang-defconst c-font-lock-comment-end-skip + ;; Regexp which matches whitespace followed by the end of a block comment + ;; (if such exists in the language). This is used by font lock to determine + ;; the portion of the end of a comment to fontify with + ;; `font-lock-comment-delimiter-face'. + t (if (c-lang-const c-block-comment-ender) + (concat "[ \t]*" (c-lang-const c-block-comment-ender-regexp)) + "a\\`")) ; Doesn't match anything. +(c-lang-setvar font-lock-comment-end-skip + (c-lang-const c-font-lock-comment-end-skip)) + (c-lang-defconst c-comment-start-regexp ;; Regexp to match the start of any type of comment. t (let ((re (c-make-keywords-re nil @@ -2017,6 +2049,19 @@ effect in the declaration, but are syntactically like whitespace." (c-lang-defvar c-type-decl-suffix-ws-ids-key (c-lang-const c-type-decl-suffix-ws-ids-key)) +(c-lang-defconst c-class-id-suffix-ws-ids-kwds + "\"Identifiers\" that when immediately following the identifier +of a class declaration have semantic effect in the declaration, +but are syntactically like whitespace." + t nil + c++ '("final")) + +(c-lang-defconst c-class-id-suffix-ws-ids-key + ;; An adorned regexp matching `c-class-id-suffix-ws-ids-kwds'. + t (c-make-keywords-re t (c-lang-const c-class-id-suffix-ws-ids-kwds))) +(c-lang-defvar c-class-id-suffix-ws-ids-key + (c-lang-const c-class-id-suffix-ws-ids-key)) + (c-lang-defconst c-class-decl-kwds "Keywords introducing declarations where the following block (if any) contains another declaration level that should be considered a class. @@ -3234,7 +3279,7 @@ Identifier syntax is in effect when this is matched \(see "\\|" "\\.\\.\\." "\\|" - "[*(&]" + "[*(&~]" "\\|" (c-lang-const c-type-decl-prefix-key) "\\|" |