;;; cc-langs.el --- language specific settings for CC Mode -*- coding: utf-8 -*-
-;; Copyright (C) 1985, 1987, 1992-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1987, 1992-2016 Free Software Foundation, Inc.
;; Authors: 2002- Alan Mackenzie
;; 1998- Martin Stjernholm
;; This file is not always loaded. See note above.
-(cc-external-require 'cl)
+(cc-external-require (if (eq c--mapcan-status 'cl-mapcan) 'cl-lib 'cl))
\f
;;; Setup for the `c-lang-defvar' system.
(unless xlate
(setq xlate 'identity))
(c-with-syntax-table (c-lang-const c-mode-syntax-table)
- (delete-duplicates
- (mapcan (lambda (opgroup)
- (when (if (symbolp (car opgroup))
- (when (funcall opgroup-filter (car opgroup))
- (setq opgroup (cdr opgroup))
- t)
- t)
- (mapcan (lambda (op)
- (when (funcall op-filter op)
- (let ((res (funcall xlate op)))
- (if (listp res) res (list res)))))
- opgroup)))
- ops)
+ (c--delete-duplicates
+ (c--mapcan (lambda (opgroup)
+ (when (if (symbolp (car opgroup))
+ (when (funcall opgroup-filter (car opgroup))
+ (setq opgroup (cdr opgroup))
+ t)
+ t)
+ (c--mapcan (lambda (op)
+ (when (funcall op-filter op)
+ (let ((res (funcall xlate op)))
+ (if (listp res) res (list res)))))
+ opgroup)))
+ ops)
:test 'equal))))
\f
(defun c-populate-syntax-table (table)
"Populate the given syntax table as necessary for a C-like language.
-This includes setting ' and \" as string delimiters, and setting up
+This includes setting \\=' and \" as string delimiters, and setting up
the comment syntax to handle both line style \"//\" and block style
\"/*\" \"*/\" comments."
table)))
(c-lang-defvar c++-template-syntax-table
(and (c-lang-const c++-make-template-syntax-table)
- (funcall (c-lang-const c++-make-template-syntax-table))))
+ ;; The next eval remove a superfluous ' from '(lambda. This
+ ;; gets rid of compilation warnings.
+ (funcall (eval (c-lang-const c++-make-template-syntax-table)))))
(c-lang-defconst c-make-no-parens-syntax-table
;; A variant of the standard syntax table which is used to find matching
table))))
(c-lang-defvar c-no-parens-syntax-table
(and (c-lang-const c-make-no-parens-syntax-table)
- (funcall (c-lang-const c-make-no-parens-syntax-table))))
+ ;; See comment in `c++template-syntax-table' about the next `eval'.
+ (funcall (eval (c-lang-const c-make-no-parens-syntax-table)))))
(c-lang-defconst c-identifier-syntax-modifications
"A list that describes the modifications that should be done to the
(modify-syntax-entry (car mod) (cdr mod) table))
table)
"Syntax table built on the mode syntax table but additionally
-classifies symbol constituents like '_' and '$' as word constituents,
+classifies symbol constituents like `_' and `$' as word constituents,
so that all identifiers are recognized as words.")
(c-lang-defconst c-get-state-before-change-functions
(c-lang-defconst c-before-font-lock-functions
;; 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-change-set-fl-decl-start
- (c c++ objc) '(c-neutralize-syntax-in-and-mark-CPP
- c-change-set-fl-decl-start)
+ t 'c-change-expand-fl-region
+ (c objc) '(c-neutralize-syntax-in-and-mark-CPP
+ c-change-expand-fl-region)
+ c++ '(c-neutralize-syntax-in-and-mark-CPP
+ c-restore-<>-properties
+ c-change-expand-fl-region)
+ java '(c-restore-<>-properties
+ c-change-expand-fl-region)
awk 'c-awk-extend-and-syntax-tablify-region)
(c-lang-defvar c-before-font-lock-functions
(let ((fs (c-lang-const c-before-font-lock-functions)))
parameters \(point-min), \(point-max) and <buffer size>.")
(c-lang-defconst c-before-context-fontification-functions
- awk nil
- t 'c-context-set-fl-decl-start)
+ t 'c-context-expand-fl-region
+ awk nil)
;; 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.
(c-lang-defvar c-before-context-fontification-functions
(c-lang-defvar c-has-bitfields (c-lang-const c-has-bitfields))
(c-lang-defconst c-modified-constant
- "Regexp that matches a \"modified\" constant literal such as \"L'a'\",
-a \"long character\". In particular, this recognizes forms of constant
+ "Regexp that matches a “modified” constant literal such as \"L\\='a\\='\",
+a “long character”. In particular, this recognizes forms of constant
which `c-backward-sexp' needs to be called twice to move backwards over."
t nil
(c c++ objc) "L'\\([^\\'\t\f\n\r]\\|\\\\.\\)'")
t (if (c-lang-const c-opt-cpp-macro-define)
(concat (c-lang-const c-opt-cpp-prefix)
(c-lang-const c-opt-cpp-macro-define)
- "[ \t]+\\(\\(\\sw\\|_\\)+\\)\\(\([^\)]*\)\\)?"
+ "[ \t]+\\(\\(\\sw\\|_\\)+\\)\\(([^)]*)\\)?"
;; ^ ^ #defined name
"\\([ \t]\\|\\\\\n\\)*")))
(c-lang-defvar c-opt-cpp-macro-define-start
operator group, and the cdr is a list of the operator tokens in it.
The operator group types are:
-'prefix Unary prefix operators.
-'postfix Unary postfix operators.
-'postfix-if-paren
+`prefix' Unary prefix operators.
+`postfix' Unary postfix operators.
+`postfix-if-paren'
Unary postfix operators if and only if the chars have
parenthesis syntax.
-'left-assoc Binary left associative operators (i.e. a+b+c means (a+b)+c).
-'right-assoc Binary right associative operators (i.e. a=b=c means a=(b=c)).
-'right-assoc-sequence
+`left-assoc' Binary left associative operators (i.e. a+b+c means (a+b)+c).
+`right-assoc' Binary right associative operators (i.e. a=b=c means a=(b=c)).
+`right-assoc-sequence'
Right associative operator that constitutes of a
sequence of tokens that separate expressions. All the
tokens in the group are in this case taken as
(c-lang-defconst c-all-op-syntax-tokens
;; List of all tokens in the punctuation and parenthesis syntax
;; classes.
- t (delete-duplicates (append (c-lang-const c-other-op-syntax-tokens)
- (c-lang-const c-operator-list))
- :test 'string-equal))
+ t (c--delete-duplicates (append (c-lang-const c-other-op-syntax-tokens)
+ (c-lang-const c-operator-list))
+ :test 'string-equal))
(c-lang-defconst c-nonsymbol-token-char-list
;; List containing all chars not in the word, symbol or
t (c-make-keywords-re nil
(c-filter-ops (c-lang-const c-all-op-syntax-tokens)
t
- "\\`\\(\\s.\\|\\s\(\\|\\s\)\\)+\\'")))
+ "\\`\\(\\s.\\)+\\'")))
(c-lang-defvar c-nonsymbol-token-regexp
(c-lang-const c-nonsymbol-token-regexp))
"=\\([^=]\\|$\\)"
"\\|"
(c-make-keywords-re nil
- (set-difference (c-lang-const c-assignment-operators)
- '("=")
- :test 'string-equal)))
+ (c--set-difference (c-lang-const c-assignment-operators)
+ '("=")
+ :test 'string-equal)))
"\\<\\>"))
(c-lang-defvar c-assignment-op-regexp
(c-lang-const c-assignment-op-regexp))
;; multicharacter tokens that begin with ">" except for those beginning with
;; ">>".
t (c-make-keywords-re nil
- (set-difference
+ (c--set-difference
(c-lang-const c->-op-cont-tokens)
(c-filter-ops (c-lang-const c-all-op-syntax-tokens)
t
"\\)\\s *"))
(c-lang-setvar comment-start-skip (c-lang-const comment-start-skip))
+(c-lang-defconst comment-end-can-be-escaped
+ "When non-nil, escaped EOLs inside comments are valid.
+This works in Emacs >= 25.1."
+ t nil
+ (c c++ objc) t)
+(c-lang-setvar comment-end-can-be-escaped
+ (c-lang-const comment-end-can-be-escaped))
+
(c-lang-defconst c-syntactic-ws-start
;; Regexp matching any sequence that can start syntactic whitespace.
;; The only uncertain case is '#' when there are cpp directives.
"strong"))
(c-lang-defconst c-typedef-kwds
- "Prefix keyword\(s\) like \"typedef\" which make a type declaration out
+ "Prefix keyword(s) like \"typedef\" which make a type declaration out
of a variable declaration."
t '("typedef")
(awk idl java) nil)
(c-lang-defconst c-type-start-kwds
;; All keywords that can start a type (i.e. are either a type prefix
;; or a complete type).
- t (delete-duplicates (append (c-lang-const c-primitive-type-kwds)
- (c-lang-const c-type-prefix-kwds)
- (c-lang-const c-type-modifier-kwds))
- :test 'string-equal))
+ t (c--delete-duplicates (append (c-lang-const c-primitive-type-kwds)
+ (c-lang-const c-type-prefix-kwds)
+ (c-lang-const c-type-modifier-kwds))
+ :test 'string-equal))
(c-lang-defconst c-class-decl-kwds
"Keywords introducing declarations where the following block (if any)
;; something is a type or just some sort of macro in front of the
;; declaration. They might be ambiguous with types or type
;; prefixes.
- t (delete-duplicates (append (c-lang-const c-class-decl-kwds)
- (c-lang-const c-brace-list-decl-kwds)
- (c-lang-const c-other-block-decl-kwds)
- (c-lang-const c-typedef-decl-kwds)
- (c-lang-const c-typeless-decl-kwds)
- (c-lang-const c-modifier-kwds)
- (c-lang-const c-other-decl-kwds)
- (c-lang-const c-decl-start-kwds)
- (c-lang-const c-decl-hangon-kwds))
- :test 'string-equal))
+ t (c--delete-duplicates (append (c-lang-const c-class-decl-kwds)
+ (c-lang-const c-brace-list-decl-kwds)
+ (c-lang-const c-other-block-decl-kwds)
+ (c-lang-const c-typedef-decl-kwds)
+ (c-lang-const c-typeless-decl-kwds)
+ (c-lang-const c-modifier-kwds)
+ (c-lang-const c-other-decl-kwds)
+ (c-lang-const c-decl-start-kwds)
+ (c-lang-const c-decl-hangon-kwds))
+ :test 'string-equal))
(c-lang-defconst c-prefix-spec-kwds-re
;; Adorned regexp of `c-prefix-spec-kwds'.
;; ambiguous with types or type prefixes. These are the keywords (like
;; extern, namespace, but NOT template) that can modify a declaration.
t (c-make-keywords-re t
- (set-difference (c-lang-const c-prefix-spec-kwds)
- (append (c-lang-const c-type-start-kwds)
- (c-lang-const c-<>-arglist-kwds))
- :test 'string-equal)))
+ (c--set-difference (c-lang-const c-prefix-spec-kwds)
+ (append (c-lang-const c-type-start-kwds)
+ (c-lang-const c-<>-arglist-kwds))
+ :test 'string-equal)))
(c-lang-defvar c-specifier-key (c-lang-const c-specifier-key))
(c-lang-defconst c-postfix-spec-kwds
;; Adorned regexp matching all keywords that can't appear at the
;; start of a declaration.
t (c-make-keywords-re t
- (set-difference (c-lang-const c-keywords)
- (append (c-lang-const c-type-start-kwds)
- (c-lang-const c-prefix-spec-kwds)
- (c-lang-const c-typeof-kwds))
- :test 'string-equal)))
+ (c--set-difference (c-lang-const c-keywords)
+ (append (c-lang-const c-type-start-kwds)
+ (c-lang-const c-prefix-spec-kwds)
+ (c-lang-const c-typeof-kwds))
+ :test 'string-equal)))
(c-lang-defvar c-not-decl-init-keywords
(c-lang-const c-not-decl-init-keywords))
(c-lang-defconst c-not-primitive-type-keywords
"List of all keywords apart from primitive types (like \"int\")."
- t (set-difference (c-lang-const c-keywords)
- (c-lang-const c-primitive-type-kwds)
- :test 'string-equal)
+ t (c--set-difference (c-lang-const c-keywords)
+ (c-lang-const c-primitive-type-kwds)
+ :test 'string-equal)
;; The "more" for C++ is the QT keyword (as in "more slots:").
;; This variable is intended for use in c-beginning-of-statement-1.
c++ (append (c-lang-const c-not-primitive-type-keywords) '("more")))
"Keywords introducing declarations that can contain a block which
might be followed by variable declarations, e.g. like \"foo\" in
\"class Foo { ... } foo;\". So if there is a block in a declaration
-like that, it ends with the following ';' and not right away.
+like that, it ends with the following `;' and not right away.
The keywords on list are assumed to also be present on one of the
`*-decl-kwds' lists."
;; before the ":" that starts the inherit list after "class"
;; or "struct" in C++. (Also used as default for other
;; languages.)
- "[^\]\[{}();,/#=:]*:"))
+ "[^][{}();,/#=:]*:"))
(c-lang-defvar c-colon-type-list-re (c-lang-const c-colon-type-list-re))
(c-lang-defconst c-paren-nontype-kwds
pike '("array" "function" "int" "mapping" "multiset" "object" "program"))
(c-lang-defconst c-paren-any-kwds
- t (delete-duplicates (append (c-lang-const c-paren-nontype-kwds)
- (c-lang-const c-paren-type-kwds))
- :test 'string-equal))
+ t (c--delete-duplicates (append (c-lang-const c-paren-nontype-kwds)
+ (c-lang-const c-paren-type-kwds))
+ :test 'string-equal))
(c-lang-defconst c-<>-type-kwds
"Keywords that may be followed by an angle bracket expression
(c-lang-defconst c-<>-sexp-kwds
;; All keywords that can be followed by an angle bracket sexp.
- t (delete-duplicates (append (c-lang-const c-<>-type-kwds)
- (c-lang-const c-<>-arglist-kwds))
- :test 'string-equal))
+ t (c--delete-duplicates (append (c-lang-const c-<>-type-kwds)
+ (c-lang-const c-<>-arglist-kwds))
+ :test 'string-equal))
(c-lang-defconst c-opt-<>-sexp-key
;; Adorned regexp matching keywords that can be followed by an angle
(c-lang-defconst c-block-stmt-kwds
;; Union of `c-block-stmt-1-kwds' and `c-block-stmt-2-kwds'.
- t (delete-duplicates (append (c-lang-const c-block-stmt-1-kwds)
- (c-lang-const c-block-stmt-2-kwds))
- :test 'string-equal))
+ t (c--delete-duplicates (append (c-lang-const c-block-stmt-1-kwds)
+ (c-lang-const c-block-stmt-2-kwds))
+ :test 'string-equal))
(c-lang-defconst c-opt-block-stmt-key
;; Regexp matching the start of any statement that has a
(c-lang-defconst c-paren-stmt-kwds
"Statement keywords followed by a parenthesis expression that
-nevertheless contains a list separated with ';' and not ','."
+nevertheless contains a list separated with `;' and not `,'."
t '("for")
idl nil)
(c-lang-defvar c-opt-asm-stmt-key (c-lang-const c-opt-asm-stmt-key))
(c-lang-defconst c-case-kwds
- "The keyword\(s) which introduce a \"case\" like construct.
+ "The keyword(s) which introduce a \"case\" like construct.
This construct is \"<keyword> <expression> :\"."
t '("case")
awk nil)
"false" "true") ; Defined in C99.
c++ (append
'("nullptr")
- (c-lang-const c-constant-kwds))
+ (c-lang-const c-constant-kwds c))
objc '("nil" "Nil" "YES" "NO" "NS_DURING" "NS_HANDLER" "NS_ENDHANDLER")
idl '("TRUE" "FALSE")
java '("true" "false" "null") ; technically "literals", not keywords
(c-lang-defconst c-expr-kwds
;; Keywords that can occur anywhere in expressions. Built from
;; `c-primary-expr-kwds' and all keyword operators in `c-operators'.
- t (delete-duplicates
+ t (c--delete-duplicates
(append (c-lang-const c-primary-expr-kwds)
(c-filter-ops (c-lang-const c-operator-list)
t
t (let* ((decl-kwds (append (c-lang-const c-class-decl-kwds)
(c-lang-const c-other-block-decl-kwds)
(c-lang-const c-inexpr-class-kwds)))
- (unambiguous (set-difference decl-kwds
- (c-lang-const c-type-start-kwds)
- :test 'string-equal))
- (ambiguous (intersection decl-kwds
- (c-lang-const c-type-start-kwds)
- :test 'string-equal)))
+ (unambiguous (c--set-difference decl-kwds
+ (c-lang-const c-type-start-kwds)
+ :test 'string-equal))
+ (ambiguous (c--intersection decl-kwds
+ (c-lang-const c-type-start-kwds)
+ :test 'string-equal)))
(if ambiguous
(concat (c-make-keywords-re t unambiguous)
"\\|"
(c-lang-defconst c-keywords
;; All keywords as a list.
- t (delete-duplicates
+ t (c--delete-duplicates
(c-lang-defconst-eval-immediately
`(append ,@(mapcar (lambda (kwds-lang-const)
`(c-lang-const ,kwds-lang-const))
(setplist (intern kwd obarray)
;; Emacs has an odd bug that causes `mapcan' to fail
;; with unintelligible errors. (XEmacs works.)
+ ;; (2015-06-24): This bug has not yet been fixed.
;;(mapcan (lambda (lang-const)
;; (list lang-const t))
;; lang-const-list)
;; Adorned regexp matching all keywords that should be fontified
;; with the keywords face. I.e. that aren't types or constants.
t (c-make-keywords-re t
- (set-difference (c-lang-const c-keywords)
- (append (c-lang-const c-primitive-type-kwds)
- (c-lang-const c-constant-kwds))
- :test 'string-equal)))
+ (c--set-difference (c-lang-const c-keywords)
+ (append (c-lang-const c-primitive-type-kwds)
+ (c-lang-const c-constant-kwds))
+ :test 'string-equal)))
(c-lang-defvar c-regular-keywords-regexp
(c-lang-const c-regular-keywords-regexp))
right-assoc-sequence)
t))
- (unambiguous-prefix-ops (set-difference nonkeyword-prefix-ops
- in-or-postfix-ops
- :test 'string-equal))
- (ambiguous-prefix-ops (intersection nonkeyword-prefix-ops
- in-or-postfix-ops
- :test 'string-equal)))
+ (unambiguous-prefix-ops (c--set-difference nonkeyword-prefix-ops
+ in-or-postfix-ops
+ :test 'string-equal))
+ (ambiguous-prefix-ops (c--intersection nonkeyword-prefix-ops
+ in-or-postfix-ops
+ :test 'string-equal)))
(concat
"\\("
;; first submatch from them together with `c-primary-expr-kwds'.
(c-make-keywords-re t
(append (c-lang-const c-primary-expr-kwds)
- (set-difference prefix-ops nonkeyword-prefix-ops
- :test 'string-equal)))
+ (c--set-difference prefix-ops nonkeyword-prefix-ops
+ :test 'string-equal)))
"\\|"
;; Match all ambiguous operators.
(c-make-keywords-re nil
- (intersection nonkeyword-prefix-ops in-or-postfix-ops
- :test 'string-equal))
+ (c--intersection nonkeyword-prefix-ops in-or-postfix-ops
+ :test 'string-equal))
"\\)"
"\\|"
"\\|"
;; The unambiguous operators from `prefix-ops'.
(c-make-keywords-re nil
- (set-difference nonkeyword-prefix-ops in-or-postfix-ops
- :test 'string-equal))
+ (c--set-difference nonkeyword-prefix-ops in-or-postfix-ops
+ :test 'string-equal))
"\\|"
;; Match string and character literals.
;; more quickly. We match ")" in C for K&R region declarations, and
;; in all languages except Java for when a cpp macro definition
;; begins with a declaration.
- t "\\([\{\}\(\);,]+\\)"
- java "\\([\{\}\(;,<]+\\)"
+ t "\\([{}();,]+\\)"
+ 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. 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++ "\\([\{\}\(\);:,<]+\\)"
+ 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
;; any easily recognized characters.
- objc (concat "\\([\{\}\(\);,]+\\|"
+ objc (concat "\\([{}();,]+\\|"
(c-make-keywords-re nil (c-lang-const c-protection-kwds))
"\\)")
;; Pike is like C but we also match "[" for multiple value
;; assignments and type casts.
- pike "\\([\{\}\(\)\[;,]+\\)")
+ pike "\\([{}()[;,]+\\)")
(c-lang-defvar c-decl-prefix-re (c-lang-const c-decl-prefix-re)
'dont-doc)
;; languages without casts.
t (c-filter-ops (c-lang-const c-operators)
'(prefix)
- "\\`\\s\(\\'"
+ "\\`\\s(\\'"
(lambda (op) (elt op 0))))
(c-lang-defvar c-cast-parens (c-lang-const c-cast-parens))
If parens can occur, the chars inside those aren't filtered with this
list.
-'<' and '>' should be disallowed even if angle bracket arglists can
+`<' and `>' should be disallowed even if angle bracket arglists can
occur. That since the search function needs to stop at them anyway to
ensure they are given paren syntax.
;; Default to all chars that only occurs in nonsymbol tokens outside
;; identifiers.
- t (set-difference
+ t (c--set-difference
(c-lang-const c-nonsymbol-token-char-list)
(c-filter-ops (append (c-lang-const c-identifier-ops)
(list (cons nil
;; Allow cpp operations (where applicable).
t (if (c-lang-const c-opt-cpp-prefix)
- (set-difference (c-lang-const c-block-prefix-disallowed-chars)
- '(?#))
+ (c--set-difference (c-lang-const c-block-prefix-disallowed-chars)
+ '(?#))
(c-lang-const c-block-prefix-disallowed-chars))
;; Allow ':' for inherit list starters.
- (c++ objc idl) (set-difference (c-lang-const c-block-prefix-disallowed-chars)
- '(?:))
+ (c++ objc idl) (c--set-difference (c-lang-const c-block-prefix-disallowed-chars)
+ '(?:))
;; Allow ',' for multiple inherits.
- (c++ java) (set-difference (c-lang-const c-block-prefix-disallowed-chars)
- '(?,))
+ (c++ java) (c--set-difference (c-lang-const c-block-prefix-disallowed-chars)
+ '(?,))
;; Allow parentheses for anonymous inner classes in Java and class
;; initializer lists in Pike.
- (java pike) (set-difference (c-lang-const c-block-prefix-disallowed-chars)
- '(?\( ?\)))
+ (java pike) (c--set-difference (c-lang-const c-block-prefix-disallowed-chars)
+ '(?\( ?\)))
;; Allow '"' for extern clauses (e.g. extern "C" {...}).
- (c c++ objc) (set-difference (c-lang-const c-block-prefix-disallowed-chars)
- '(?\" ?')))
+ (c c++ objc) (c--set-difference (c-lang-const c-block-prefix-disallowed-chars)
+ '(?\" ?')))
(c-lang-defconst c-block-prefix-charset
;; `c-block-prefix-disallowed-chars' as an inverted charset suitable
;; Check that there's no "=" afterwards to avoid matching tokens
;; like "*=".
(c objc) (concat "\\("
- "[*\(]"
+ "[*(]"
"\\|"
(c-lang-const c-type-decl-prefix-key)
"\\)"
"\\([^=]\\|$\\)")
c++ (concat "\\("
- "[*\(&]"
+ "[*(&]"
"\\|"
(c-lang-const c-type-decl-prefix-key)
"\\|"
;; Default to a regexp that matches `c-type-modifier-kwds' and a
;; function argument list parenthesis.
t (if (c-lang-const c-type-modifier-kwds)
- (concat "\\(\(\\|"
+ (concat "\\((\\|"
(regexp-opt (c-lang-const c-type-modifier-kwds) t) "\\>"
"\\)")
- "\\(\(\\)")
+ "\\((\\)")
(c c++ objc) (concat
"\\("
- "[\)\[\(]"
+ "[)[(]"
(if (c-lang-const c-type-modifier-kwds)
(concat
"\\|"
"\\>")
"")
"\\)")
- java "\\([\[\(\)]\\)"
- idl "\\([\[\(]\\)")
+ java "\\([[()]\\)"
+ idl "\\([[(]\\)")
(c-lang-defvar c-type-decl-suffix-key (c-lang-const c-type-decl-suffix-key)
'dont-doc)
t (if (c-lang-const c-opt-<>-arglist-start)
(concat "\\("
(c-lang-const c-opt-<>-arglist-start)
- "\\)\\|\\s\)")))
+ "\\)\\|\\s)")))
(c-lang-defvar c-opt-<>-arglist-start-in-paren
(c-lang-const c-opt-<>-arglist-start-in-paren))
t (concat
;; All keywords except `c-label-kwds' and `c-protection-kwds'.
(c-make-keywords-re t
- (set-difference (c-lang-const c-keywords)
- (append (c-lang-const c-label-kwds)
- (c-lang-const c-protection-kwds))
- :test 'string-equal)))
+ (c--set-difference (c-lang-const c-keywords)
+ (append (c-lang-const c-label-kwds)
+ (c-lang-const c-protection-kwds))
+ :test 'string-equal)))
;; Don't allow string literals, except in AWK. Character constants are OK.
(c objc java pike idl) (concat "\"\\|"
(c-lang-const c-nonlabel-token-key))
;; Also check for open parens in C++, to catch member init lists in
;; constructors. We normally allow it so that macros with arguments
;; work in labels.
- c++ (concat "\\s\(\\|\"\\|" (c-lang-const c-nonlabel-token-key)))
+ c++ (concat "\\s(\\|\"\\|" (c-lang-const c-nonlabel-token-key)))
(c-lang-defvar c-nonlabel-token-key (c-lang-const c-nonlabel-token-key))
(c-lang-defconst c-nonlabel-token-2-key
"\\([+-]\\)"
(c-lang-const c-simple-ws) "*"
(concat "\\(" ; Return type.
- "([^\)]*)"
+ "([^)]*)"
(c-lang-const c-simple-ws) "*"
"\\)?")
"\\(" (c-lang-const c-symbol-key) "\\)"))
;; `c-lang-const' will expand to the evaluated
;; constant immediately in `c--macroexpand-all'
;; below.
- (mapcan
+ (c--mapcan
(lambda (init)
`(current-var ',(car init)
- ,(car init) ,(c--macroexpand-all
- (elt init 1))))
+ ,(car init) ,(c--macroexpand-all
+ (elt init 1))))
;; Note: The following `append' copies the
;; first argument. That list is small, so
;; this doesn't matter too much.
- (append (cdr c-emacs-variable-inits)
- (cdr c-lang-variable-inits)))))
+ (append (cdr c-emacs-variable-inits)
+ (cdr c-lang-variable-inits)))))
;; This diagnostic message isn't useful for end
;; users, so it's disabled.
(setq source-eval t)
(let ((init ',(append (cdr c-emacs-variable-inits)
(cdr c-lang-variable-inits))))
- (while init
- (setq current-var (caar init))
- (set (caar init) (eval (cadar init)))
- (setq init (cdr init)))))
+ (dolist (var-init init)
+ (setq current-var (car var-init))
+ (set (car var-init) (eval (cadr var-init))))))
(error
(if current-var
(c-make-emacs-variables-local)
(condition-case err
- (while init
- (setq current-var (caar init))
- (set (caar init) (eval (cadar init)))
- (setq init (cdr init)))
+ (dolist (var-init init)
+ (setq current-var (car var-init))
+ (set (car var-init) (eval (cadr var-init))))
(error
(if current-var
\f
(cc-provide 'cc-langs)
-;;; Local Variables:
-;;; indent-tabs-mode: t
-;;; tab-width: 8
-;;; End:
+;; Local Variables:
+;; indent-tabs-mode: t
+;; tab-width: 8
+;; End:
;;; cc-langs.el ends here