Mercurial > emacs
annotate lisp/progmodes/cc-langs.el @ 109808:210b4524545e
Minor icalendar fix.
* lisp/calendar/icalendar.el (icalendar--convert-recurring-to-diary):
Fix format call.
author | Glenn Morris <rgm@gnu.org> |
---|---|
date | Mon, 16 Aug 2010 23:48:37 -0700 |
parents | c18dffa2ba46 |
children | 280c8ae2476d |
rev | line source |
---|---|
36920 | 1 ;;; cc-langs.el --- language specific settings for CC Mode |
18720 | 2 |
74372 | 3 ;; Copyright (C) 1985, 1987, 1992, 1993, 1994, 1995, 1996, 1997, 1998, |
106815 | 4 ;; 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 |
75347 | 5 ;; Free Software Foundation, Inc. |
18720 | 6 |
75307 | 7 ;; Authors: 2002- Alan Mackenzie |
8 ;; 1998- Martin Stjernholm | |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
9 ;; 1992-1999 Barry A. Warsaw |
101112
0685234e527d
Comment (minor header format fixes).
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
10 ;; 1987 Dave Detlefs |
0685234e527d
Comment (minor header format fixes).
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
11 ;; 1987 Stewart Clamen |
18720 | 12 ;; 1985 Richard M. Stallman |
24282 | 13 ;; Maintainer: bug-cc-mode@gnu.org |
18720 | 14 ;; Created: 22-Apr-1997 (split from cc-mode.el) |
20141 | 15 ;; Version: See cc-mode.el |
18720 | 16 ;; Keywords: c languages oop |
17 | |
18 ;; This file is part of GNU Emacs. | |
19 | |
94673
52b7a8c22af5
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
94145
diff
changeset
|
20 ;; GNU Emacs is free software: you can redistribute it and/or modify |
18720 | 21 ;; it under the terms of the GNU General Public License as published by |
94673
52b7a8c22af5
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
94145
diff
changeset
|
22 ;; the Free Software Foundation, either version 3 of the License, or |
52b7a8c22af5
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
94145
diff
changeset
|
23 ;; (at your option) any later version. |
18720 | 24 |
25 ;; GNU Emacs is distributed in the hope that it will be useful, | |
26 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
27 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
28 ;; GNU General Public License for more details. | |
29 | |
30 ;; You should have received a copy of the GNU General Public License | |
94673
52b7a8c22af5
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
94145
diff
changeset
|
31 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
18720 | 32 |
38422
7a94f1c588c4
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
36920
diff
changeset
|
33 ;;; Commentary: |
7a94f1c588c4
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
36920
diff
changeset
|
34 |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
35 ;; HACKERS NOTE: There's heavy macro magic here. If you need to make |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
36 ;; changes in this or other files containing `c-lang-defconst' but |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
37 ;; don't want to read through the longer discussion below then read |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
38 ;; this: |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
39 ;; |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
40 ;; o A change in a `c-lang-defconst' or `c-lang-defvar' will not take |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
41 ;; effect if the file containing the mode init function (typically |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
42 ;; cc-mode.el) is byte compiled. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
43 ;; o To make changes show in font locking you need to reevaluate the |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
44 ;; `*-font-lock-keywords-*' constants, which normally is easiest to |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
45 ;; do with M-x eval-buffer in cc-fonts.el. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
46 ;; o In either case it's necessary to reinitialize the mode to make |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
47 ;; the changes show in an existing buffer. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
48 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
49 ;;; Introduction to the language dependent variable system: |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
50 ;; |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
51 ;; This file contains all the language dependent variables, except |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
52 ;; those specific for font locking which reside in cc-fonts.el. As |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
53 ;; far as possible, all the differences between the languages that CC |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
54 ;; Mode supports are described with these variables only, so that the |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
55 ;; code can be shared. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
56 ;; |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
57 ;; The language constant system (see cc-defs.el) is used to specify |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
58 ;; various language dependent info at a high level, such as lists of |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
59 ;; keywords, and then from them generate - at compile time - the |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
60 ;; various regexps and other low-level structures actually employed in |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
61 ;; the code at runtime. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
62 ;; |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
63 ;; This system is also designed to make it easy for developers of |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
64 ;; derived modes to customize the source constants for new language |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
65 ;; variants, without having to keep up with the exact regexps etc that |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
66 ;; are used in each CC Mode version. It's possible from an external |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
67 ;; package to add a new language by inheriting an existing one, and |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
68 ;; then change specific constants as necessary for the new language. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
69 ;; The old values for those constants (and the values of all the other |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
70 ;; high-level constants) may be used to build the new ones, and those |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
71 ;; new values will in turn be used by the low-level definitions here |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
72 ;; to build the runtime constants appropriately for the new language |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
73 ;; in the current version of CC Mode. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
74 ;; |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
75 ;; Like elsewhere in CC Mode, the existence of a doc string signifies |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
76 ;; that a language constant is part of the external API, and that it |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
77 ;; therefore can be used with a high confidence that it will continue |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
78 ;; to work with future versions of CC Mode. Even so, it's not |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
79 ;; unlikely that such constants will change meaning slightly as this |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
80 ;; system is refined further; a certain degree of dependence on the CC |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
81 ;; Mode version is unavoidable when hooking in at this level. Also |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
82 ;; note that there's still work to be done to actually use these |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
83 ;; constants everywhere inside CC Mode; there are still hardcoded |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
84 ;; values in many places in the code. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
85 ;; |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
86 ;; Separate packages will also benefit from the compile time |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
87 ;; evaluation; the byte compiled file(s) for them will contain the |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
88 ;; compiled runtime constants ready for use by (the byte compiled) CC |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
89 ;; Mode, and the source definitions in this file don't have to be |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
90 ;; loaded then. However, if a byte compiled package is loaded that |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
91 ;; has been compiled with a different version of CC Mode than the one |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
92 ;; currently loaded, then the compiled-in values will be discarded and |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
93 ;; new ones will be built when the mode is initialized. That will |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
94 ;; automatically trig a load of the file(s) containing the source |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
95 ;; definitions (i.e. this file and/or cc-fonts.el) if necessary. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
96 ;; |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
97 ;; A small example of a derived mode is available at |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
98 ;; <http://cc-mode.sourceforge.net/derived-mode-ex.el>. It also |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
99 ;; contains some useful hints for derived mode developers. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
100 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
101 ;;; Using language variables: |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
102 ;; |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
103 ;; The `c-lang-defvar' forms in this file comprise the language |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
104 ;; variables that CC Mode uses. It does not work to use |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
105 ;; `c-lang-defvar' anywhere else (which isn't much of a limitation |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
106 ;; since these variables sole purpose is to interface with the CC Mode |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
107 ;; core functions). The values in these `c-lang-defvar's are not |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
108 ;; evaluated right away but instead collected to a single large `setq' |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
109 ;; that can be inserted for a particular language with the |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
110 ;; `c-init-language-vars' macro. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
111 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
112 ;; This file is only required at compile time, or when not running |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
113 ;; from byte compiled files, or when the source definitions for the |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
114 ;; language constants are requested. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
115 |
38422
7a94f1c588c4
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
36920
diff
changeset
|
116 ;;; Code: |
7a94f1c588c4
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
36920
diff
changeset
|
117 |
101271
c7dad4ac139c
(declare-function): Add compatibility stub.
Glenn Morris <rgm@gnu.org>
parents:
101112
diff
changeset
|
118 ;; For Emacs < 22.2. |
c7dad4ac139c
(declare-function): Add compatibility stub.
Glenn Morris <rgm@gnu.org>
parents:
101112
diff
changeset
|
119 (eval-and-compile |
c7dad4ac139c
(declare-function): Add compatibility stub.
Glenn Morris <rgm@gnu.org>
parents:
101112
diff
changeset
|
120 (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))) |
c7dad4ac139c
(declare-function): Add compatibility stub.
Glenn Morris <rgm@gnu.org>
parents:
101112
diff
changeset
|
121 |
26817 | 122 (eval-when-compile |
123 (let ((load-path | |
36920 | 124 (if (and (boundp 'byte-compile-dest-file) |
125 (stringp byte-compile-dest-file)) | |
126 (cons (file-name-directory byte-compile-dest-file) load-path) | |
26817 | 127 load-path))) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
128 (load "cc-bytecomp" nil t))) |
26817 | 129 |
36920 | 130 (cc-require 'cc-defs) |
131 (cc-require 'cc-vars) | |
18842
72c2475ece1c
Require 'cc-defs for the definition of c-emacs-features.
Richard M. Stallman <rms@gnu.org>
parents:
18772
diff
changeset
|
132 |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
133 |
57295
a35c512cab8c
Load cl here since cc-defs doesn't do it. This is necessary for
Martin Stjernholm <mast@lysator.liu.se>
parents:
56646
diff
changeset
|
134 ;; This file is not always loaded. See note above. |
a35c512cab8c
Load cl here since cc-defs doesn't do it. This is necessary for
Martin Stjernholm <mast@lysator.liu.se>
parents:
56646
diff
changeset
|
135 (cc-external-require 'cl) |
a35c512cab8c
Load cl here since cc-defs doesn't do it. This is necessary for
Martin Stjernholm <mast@lysator.liu.se>
parents:
56646
diff
changeset
|
136 |
18720 | 137 |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
138 ;;; Setup for the `c-lang-defvar' system. |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
38422
diff
changeset
|
139 |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
38422
diff
changeset
|
140 (eval-and-compile |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
38422
diff
changeset
|
141 ;; These are used to collect the init forms from the subsequent |
72031
2b53c13e6121
* progmodes/cc-langs.el (c-emacs-variable-inits): new variable.
Alan Mackenzie <acm@muc.de>
parents:
71754
diff
changeset
|
142 ;; `c-lang-defvar' and `c-lang-setvar'. They are used to build the |
2b53c13e6121
* progmodes/cc-langs.el (c-emacs-variable-inits): new variable.
Alan Mackenzie <acm@muc.de>
parents:
71754
diff
changeset
|
143 ;; lambda in `c-make-init-lang-vars-fun' below, and to build `defvar's |
2b53c13e6121
* progmodes/cc-langs.el (c-emacs-variable-inits): new variable.
Alan Mackenzie <acm@muc.de>
parents:
71754
diff
changeset
|
144 ;; and `make-variable-buffer-local's in cc-engine and |
2b53c13e6121
* progmodes/cc-langs.el (c-emacs-variable-inits): new variable.
Alan Mackenzie <acm@muc.de>
parents:
71754
diff
changeset
|
145 ;; `make-local-variable's in `c-init-language-vars-for'. |
51748
f3cad02bce62
(c-style-alist, c-lang-variable-inits, c-lang-variable-inits-tail): The
Martin Stjernholm <mast@lysator.liu.se>
parents:
51714
diff
changeset
|
146 (defvar c-lang-variable-inits nil) |
f3cad02bce62
(c-style-alist, c-lang-variable-inits, c-lang-variable-inits-tail): The
Martin Stjernholm <mast@lysator.liu.se>
parents:
51714
diff
changeset
|
147 (defvar c-lang-variable-inits-tail nil) |
f3cad02bce62
(c-style-alist, c-lang-variable-inits, c-lang-variable-inits-tail): The
Martin Stjernholm <mast@lysator.liu.se>
parents:
51714
diff
changeset
|
148 (setq c-lang-variable-inits (list nil) |
72031
2b53c13e6121
* progmodes/cc-langs.el (c-emacs-variable-inits): new variable.
Alan Mackenzie <acm@muc.de>
parents:
71754
diff
changeset
|
149 c-lang-variable-inits-tail c-lang-variable-inits) |
2b53c13e6121
* progmodes/cc-langs.el (c-emacs-variable-inits): new variable.
Alan Mackenzie <acm@muc.de>
parents:
71754
diff
changeset
|
150 (defvar c-emacs-variable-inits nil) |
2b53c13e6121
* progmodes/cc-langs.el (c-emacs-variable-inits): new variable.
Alan Mackenzie <acm@muc.de>
parents:
71754
diff
changeset
|
151 (defvar c-emacs-variable-inits-tail nil) |
2b53c13e6121
* progmodes/cc-langs.el (c-emacs-variable-inits): new variable.
Alan Mackenzie <acm@muc.de>
parents:
71754
diff
changeset
|
152 (setq c-emacs-variable-inits (list nil) |
2b53c13e6121
* progmodes/cc-langs.el (c-emacs-variable-inits): new variable.
Alan Mackenzie <acm@muc.de>
parents:
71754
diff
changeset
|
153 c-emacs-variable-inits-tail c-emacs-variable-inits)) |
36920 | 154 |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
155 (defmacro c-lang-defvar (var val &optional doc) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
156 "Declares the buffer local variable VAR to get the value VAL. VAL is |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
157 evaluated and assigned at mode initialization. More precisely, VAL is |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
158 evaluated and bound to VAR when the result from the macro |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
159 `c-init-language-vars' is evaluated. |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
38422
diff
changeset
|
160 |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
161 `c-lang-const' is typically used in VAL to get the right value for the |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
162 language being initialized, and such calls will be macro expanded to |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
163 the evaluated constant value at compile time." |
36920 | 164 |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
165 (when (and (not doc) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
166 (eq (car-safe val) 'c-lang-const) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
167 (eq (nth 1 val) var) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
168 (not (nth 2 val))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
169 ;; Special case: If there's no docstring and the value is a |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
170 ;; simple (c-lang-const foo) where foo is the same name as VAR |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
171 ;; then take the docstring from the language constant foo. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
172 (setq doc (get (intern (symbol-name (nth 1 val)) c-lang-constants) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
173 'variable-documentation))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
174 (or (stringp doc) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
175 (setq doc nil)) |
18720 | 176 |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
177 (let ((elem (assq var (cdr c-lang-variable-inits)))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
178 (if elem |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
179 (setcdr elem (list val doc)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
180 (setcdr c-lang-variable-inits-tail (list (list var val doc))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
181 (setq c-lang-variable-inits-tail (cdr c-lang-variable-inits-tail)))) |
18720 | 182 |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
183 ;; Return the symbol, like the other def* forms. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
184 `',var) |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
38422
diff
changeset
|
185 |
72031
2b53c13e6121
* progmodes/cc-langs.el (c-emacs-variable-inits): new variable.
Alan Mackenzie <acm@muc.de>
parents:
71754
diff
changeset
|
186 (defmacro c-lang-setvar (var val) |
2b53c13e6121
* progmodes/cc-langs.el (c-emacs-variable-inits): new variable.
Alan Mackenzie <acm@muc.de>
parents:
71754
diff
changeset
|
187 "Causes the variable VAR to be made buffer local and to get set to the |
2b53c13e6121
* progmodes/cc-langs.el (c-emacs-variable-inits): new variable.
Alan Mackenzie <acm@muc.de>
parents:
71754
diff
changeset
|
188 value VAL. VAL is evaluated and assigned at mode initialization. More |
2b53c13e6121
* progmodes/cc-langs.el (c-emacs-variable-inits): new variable.
Alan Mackenzie <acm@muc.de>
parents:
71754
diff
changeset
|
189 precisely, VAL is evaluated and bound to VAR when the result from the |
2b53c13e6121
* progmodes/cc-langs.el (c-emacs-variable-inits): new variable.
Alan Mackenzie <acm@muc.de>
parents:
71754
diff
changeset
|
190 macro `c-init-language-vars' is evaluated. VAR is typically a standard |
2b53c13e6121
* progmodes/cc-langs.el (c-emacs-variable-inits): new variable.
Alan Mackenzie <acm@muc.de>
parents:
71754
diff
changeset
|
191 Emacs variable like `comment-start'. |
2b53c13e6121
* progmodes/cc-langs.el (c-emacs-variable-inits): new variable.
Alan Mackenzie <acm@muc.de>
parents:
71754
diff
changeset
|
192 |
2b53c13e6121
* progmodes/cc-langs.el (c-emacs-variable-inits): new variable.
Alan Mackenzie <acm@muc.de>
parents:
71754
diff
changeset
|
193 `c-lang-const' is typically used in VAL to get the right value for the |
2b53c13e6121
* progmodes/cc-langs.el (c-emacs-variable-inits): new variable.
Alan Mackenzie <acm@muc.de>
parents:
71754
diff
changeset
|
194 language being initialized, and such calls will be macro expanded to |
2b53c13e6121
* progmodes/cc-langs.el (c-emacs-variable-inits): new variable.
Alan Mackenzie <acm@muc.de>
parents:
71754
diff
changeset
|
195 the evaluated constant value at compile time." |
2b53c13e6121
* progmodes/cc-langs.el (c-emacs-variable-inits): new variable.
Alan Mackenzie <acm@muc.de>
parents:
71754
diff
changeset
|
196 (let ((elem (assq var (cdr c-emacs-variable-inits)))) |
2b53c13e6121
* progmodes/cc-langs.el (c-emacs-variable-inits): new variable.
Alan Mackenzie <acm@muc.de>
parents:
71754
diff
changeset
|
197 (if elem |
2b53c13e6121
* progmodes/cc-langs.el (c-emacs-variable-inits): new variable.
Alan Mackenzie <acm@muc.de>
parents:
71754
diff
changeset
|
198 (setcdr elem (list val)) ; Maybe remove "list", sometime. 2006-07-19 |
2b53c13e6121
* progmodes/cc-langs.el (c-emacs-variable-inits): new variable.
Alan Mackenzie <acm@muc.de>
parents:
71754
diff
changeset
|
199 (setcdr c-emacs-variable-inits-tail (list (list var val))) |
2b53c13e6121
* progmodes/cc-langs.el (c-emacs-variable-inits): new variable.
Alan Mackenzie <acm@muc.de>
parents:
71754
diff
changeset
|
200 (setq c-emacs-variable-inits-tail (cdr c-emacs-variable-inits-tail)))) |
2b53c13e6121
* progmodes/cc-langs.el (c-emacs-variable-inits): new variable.
Alan Mackenzie <acm@muc.de>
parents:
71754
diff
changeset
|
201 |
2b53c13e6121
* progmodes/cc-langs.el (c-emacs-variable-inits): new variable.
Alan Mackenzie <acm@muc.de>
parents:
71754
diff
changeset
|
202 ;; Return the symbol, like the other def* forms. |
2b53c13e6121
* progmodes/cc-langs.el (c-emacs-variable-inits): new variable.
Alan Mackenzie <acm@muc.de>
parents:
71754
diff
changeset
|
203 `',var) |
2b53c13e6121
* progmodes/cc-langs.el (c-emacs-variable-inits): new variable.
Alan Mackenzie <acm@muc.de>
parents:
71754
diff
changeset
|
204 |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
205 (put 'c-lang-defvar 'lisp-indent-function 'defun) |
71754
60304f6ae360
* progmodes/cc-awk.el, cc-defs.el, cc-fonts.el, cc-langs.el,
Alan Mackenzie <acm@muc.de>
parents:
70025
diff
changeset
|
206 ; (eval-after-load "edebug" ; 2006-07-09: def-edebug-spec is now in subr.el. |
60304f6ae360
* progmodes/cc-awk.el, cc-defs.el, cc-fonts.el, cc-langs.el,
Alan Mackenzie <acm@muc.de>
parents:
70025
diff
changeset
|
207 ; ' |
60304f6ae360
* progmodes/cc-awk.el, cc-defs.el, cc-fonts.el, cc-langs.el,
Alan Mackenzie <acm@muc.de>
parents:
70025
diff
changeset
|
208 (def-edebug-spec c-lang-defvar |
60304f6ae360
* progmodes/cc-awk.el, cc-defs.el, cc-fonts.el, cc-langs.el,
Alan Mackenzie <acm@muc.de>
parents:
70025
diff
changeset
|
209 (&define name def-form &optional stringp)) ;) |
18720 | 210 |
101271
c7dad4ac139c
(declare-function): Add compatibility stub.
Glenn Morris <rgm@gnu.org>
parents:
101112
diff
changeset
|
211 ;; Suppress "might not be defined at runtime" warning. |
c7dad4ac139c
(declare-function): Add compatibility stub.
Glenn Morris <rgm@gnu.org>
parents:
101112
diff
changeset
|
212 ;; This file is only used when compiling other cc files. |
c7dad4ac139c
(declare-function): Add compatibility stub.
Glenn Morris <rgm@gnu.org>
parents:
101112
diff
changeset
|
213 (declare-function delete-duplicates "cl-seq" (cl-seq &rest cl-keys)) |
c7dad4ac139c
(declare-function): Add compatibility stub.
Glenn Morris <rgm@gnu.org>
parents:
101112
diff
changeset
|
214 (declare-function mapcan "cl-extra" (cl-func cl-seq &rest cl-rest)) |
c7dad4ac139c
(declare-function): Add compatibility stub.
Glenn Morris <rgm@gnu.org>
parents:
101112
diff
changeset
|
215 (declare-function cl-macroexpand-all "cl-extra" (form &optional env)) |
c7dad4ac139c
(declare-function): Add compatibility stub.
Glenn Morris <rgm@gnu.org>
parents:
101112
diff
changeset
|
216 |
69140
3d8b060d10fb
cc-align.el, cc-awk.el, cc-bytecomp.el, cc-cmds.el, cc-compat.el,
Alan Mackenzie <acm@muc.de>
parents:
68773
diff
changeset
|
217 (eval-and-compile |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
218 ;; Some helper functions used when building the language constants. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
219 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
220 (defun c-filter-ops (ops opgroup-filter op-filter &optional xlate) |
75130
b9690e9e273d
(c-operators, c-filter-ops): Amend doc-string and comments.
Alan Mackenzie <acm@muc.de>
parents:
75027
diff
changeset
|
221 ;; Extract a subset of the operators in the list OPS in a DWIM:ey |
80256
cdd9800b7aaf
(c-before-font-lock-function): Fix bug in doc-string, "c-old-LEN" ->
Alan Mackenzie <acm@muc.de>
parents:
80159
diff
changeset
|
222 ;; way. The return value is a plain list of operators: |
cdd9800b7aaf
(c-before-font-lock-function): Fix bug in doc-string, "c-old-LEN" ->
Alan Mackenzie <acm@muc.de>
parents:
80159
diff
changeset
|
223 ;; |
75130
b9690e9e273d
(c-operators, c-filter-ops): Amend doc-string and comments.
Alan Mackenzie <acm@muc.de>
parents:
75027
diff
changeset
|
224 ;; OPS either has the structure of `c-operators', is a single |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
225 ;; group in `c-operators', or is a plain list of operators. |
75130
b9690e9e273d
(c-operators, c-filter-ops): Amend doc-string and comments.
Alan Mackenzie <acm@muc.de>
parents:
75027
diff
changeset
|
226 ;; |
b9690e9e273d
(c-operators, c-filter-ops): Amend doc-string and comments.
Alan Mackenzie <acm@muc.de>
parents:
75027
diff
changeset
|
227 ;; OPGROUP-FILTER specifies how to select the operator groups. It |
b9690e9e273d
(c-operators, c-filter-ops): Amend doc-string and comments.
Alan Mackenzie <acm@muc.de>
parents:
75027
diff
changeset
|
228 ;; can be t to choose all groups, a list of group type symbols |
b9690e9e273d
(c-operators, c-filter-ops): Amend doc-string and comments.
Alan Mackenzie <acm@muc.de>
parents:
75027
diff
changeset
|
229 ;; (such as 'prefix) to accept, or a function which will be called |
b9690e9e273d
(c-operators, c-filter-ops): Amend doc-string and comments.
Alan Mackenzie <acm@muc.de>
parents:
75027
diff
changeset
|
230 ;; with the group symbol for each group and should return non-nil |
b9690e9e273d
(c-operators, c-filter-ops): Amend doc-string and comments.
Alan Mackenzie <acm@muc.de>
parents:
75027
diff
changeset
|
231 ;; if that group is to be included. |
b9690e9e273d
(c-operators, c-filter-ops): Amend doc-string and comments.
Alan Mackenzie <acm@muc.de>
parents:
75027
diff
changeset
|
232 ;; |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
233 ;; If XLATE is given, it's a function which is called for each |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
234 ;; matching operator and its return value is collected instead. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
235 ;; If it returns a list, the elements are spliced directly into |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
236 ;; the final result, which is returned as a list with duplicates |
75130
b9690e9e273d
(c-operators, c-filter-ops): Amend doc-string and comments.
Alan Mackenzie <acm@muc.de>
parents:
75027
diff
changeset
|
237 ;; removed using `equal'. |
b9690e9e273d
(c-operators, c-filter-ops): Amend doc-string and comments.
Alan Mackenzie <acm@muc.de>
parents:
75027
diff
changeset
|
238 ;; |
b9690e9e273d
(c-operators, c-filter-ops): Amend doc-string and comments.
Alan Mackenzie <acm@muc.de>
parents:
75027
diff
changeset
|
239 ;; `c-mode-syntax-table' for the current mode is in effect during |
b9690e9e273d
(c-operators, c-filter-ops): Amend doc-string and comments.
Alan Mackenzie <acm@muc.de>
parents:
75027
diff
changeset
|
240 ;; the whole procedure. |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
241 (unless (listp (car-safe ops)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
242 (setq ops (list ops))) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
243 (cond ((eq opgroup-filter t) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
244 (setq opgroup-filter (lambda (opgroup) t))) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
245 ((not (functionp opgroup-filter)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
246 (setq opgroup-filter `(lambda (opgroup) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
247 (memq opgroup ',opgroup-filter))))) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
248 (cond ((eq op-filter t) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
249 (setq op-filter (lambda (op) t))) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
250 ((stringp op-filter) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
251 (setq op-filter `(lambda (op) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
252 (string-match ,op-filter op))))) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
253 (unless xlate |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
254 (setq xlate 'identity)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
255 (c-with-syntax-table (c-lang-const c-mode-syntax-table) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
256 (delete-duplicates |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
257 (mapcan (lambda (opgroup) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
258 (when (if (symbolp (car opgroup)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
259 (when (funcall opgroup-filter (car opgroup)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
260 (setq opgroup (cdr opgroup)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
261 t) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
262 t) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
263 (mapcan (lambda (op) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
264 (when (funcall op-filter op) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
265 (let ((res (funcall xlate op))) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
266 (if (listp res) res (list res))))) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
267 opgroup))) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
268 ops) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
269 :test 'equal)))) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
270 |
18720 | 271 |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
272 ;;; Various mode specific values that aren't language related. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
273 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
274 (c-lang-defconst c-mode-menu |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
275 ;; The definition for the mode menu. The menu title is prepended to |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
276 ;; this before it's fed to `easy-menu-define'. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
277 t `(["Comment Out Region" comment-region |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
278 (c-fn-region-is-active-p)] |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
279 ["Uncomment Region" (comment-region (region-beginning) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
280 (region-end) '(4)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
281 (c-fn-region-is-active-p)] |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
282 ["Indent Expression" c-indent-exp |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
283 (memq (char-after) '(?\( ?\[ ?\{))] |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
284 ["Indent Line or Region" c-indent-line-or-region t] |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
285 ["Fill Comment Paragraph" c-fill-paragraph t] |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
286 "----" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
287 ["Backward Statement" c-beginning-of-statement t] |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
288 ["Forward Statement" c-end-of-statement t] |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
289 ,@(when (c-lang-const c-opt-cpp-prefix) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
290 ;; Only applicable if there's a cpp preprocessor. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
291 `(["Up Conditional" c-up-conditional t] |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
292 ["Backward Conditional" c-backward-conditional t] |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
293 ["Forward Conditional" c-forward-conditional t] |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
294 "----" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
295 ["Macro Expand Region" c-macro-expand |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
296 (c-fn-region-is-active-p)] |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
297 ["Backslashify" c-backslash-region |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
298 (c-fn-region-is-active-p)])) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
299 "----" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
300 ("Toggle..." |
68773
dc49655f57ae
Update copyright for 2006.
Nick Roberts <nickrob@snap.net.nz>
parents:
67278
diff
changeset
|
301 ["Syntactic indentation" c-toggle-syntactic-indentation |
dc49655f57ae
Update copyright for 2006.
Nick Roberts <nickrob@snap.net.nz>
parents:
67278
diff
changeset
|
302 :style toggle :selected c-syntactic-indentation] |
69140
3d8b060d10fb
cc-align.el, cc-awk.el, cc-bytecomp.el, cc-cmds.el, cc-compat.el,
Alan Mackenzie <acm@muc.de>
parents:
68773
diff
changeset
|
303 ["Electric mode" c-toggle-electric-state |
3d8b060d10fb
cc-align.el, cc-awk.el, cc-bytecomp.el, cc-cmds.el, cc-compat.el,
Alan Mackenzie <acm@muc.de>
parents:
68773
diff
changeset
|
304 :style toggle :selected c-electric-flag] |
3d8b060d10fb
cc-align.el, cc-awk.el, cc-bytecomp.el, cc-cmds.el, cc-compat.el,
Alan Mackenzie <acm@muc.de>
parents:
68773
diff
changeset
|
305 ["Auto newline" c-toggle-auto-newline |
68773
dc49655f57ae
Update copyright for 2006.
Nick Roberts <nickrob@snap.net.nz>
parents:
67278
diff
changeset
|
306 :style toggle :selected c-auto-newline] |
69140
3d8b060d10fb
cc-align.el, cc-awk.el, cc-bytecomp.el, cc-cmds.el, cc-compat.el,
Alan Mackenzie <acm@muc.de>
parents:
68773
diff
changeset
|
307 ["Hungry delete" c-toggle-hungry-state |
3d8b060d10fb
cc-align.el, cc-awk.el, cc-bytecomp.el, cc-cmds.el, cc-compat.el,
Alan Mackenzie <acm@muc.de>
parents:
68773
diff
changeset
|
308 :style toggle :selected c-hungry-delete-key] |
106160
b27aeda9c1fd
2009-11-20 Tassilo Horn <tassilo@member.fsf.org>
Tassilo Horn <tassilo@member.fsf.org>
parents:
105206
diff
changeset
|
309 ["Subword mode" subword-mode |
b27aeda9c1fd
2009-11-20 Tassilo Horn <tassilo@member.fsf.org>
Tassilo Horn <tassilo@member.fsf.org>
parents:
105206
diff
changeset
|
310 :style toggle :selected (and (boundp 'subword-mode) |
b27aeda9c1fd
2009-11-20 Tassilo Horn <tassilo@member.fsf.org>
Tassilo Horn <tassilo@member.fsf.org>
parents:
105206
diff
changeset
|
311 subword-mode)]))) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
312 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
313 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
314 ;;; Syntax tables. |
18720 | 315 |
316 (defun c-populate-syntax-table (table) | |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
317 "Populate the given syntax table as necessary for a C-like language. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
318 This includes setting ' and \" as string delimiters, and setting up |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
319 the comment syntax to handle both line style \"//\" and block style |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
320 \"/*\" \"*/\" comments." |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
321 |
18720 | 322 (modify-syntax-entry ?_ "_" table) |
323 (modify-syntax-entry ?\\ "\\" table) | |
324 (modify-syntax-entry ?+ "." table) | |
325 (modify-syntax-entry ?- "." table) | |
326 (modify-syntax-entry ?= "." table) | |
327 (modify-syntax-entry ?% "." table) | |
328 (modify-syntax-entry ?< "." table) | |
329 (modify-syntax-entry ?> "." table) | |
330 (modify-syntax-entry ?& "." table) | |
331 (modify-syntax-entry ?| "." table) | |
19300
b07fa43938cc
(c-mode-base-map, c++-mode-map):
Richard M. Stallman <rms@gnu.org>
parents:
19250
diff
changeset
|
332 (modify-syntax-entry ?\' "\"" table) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
333 (modify-syntax-entry ?\240 "." table) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
334 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
335 ;; Set up block and line oriented comments. The new C |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
336 ;; standard mandates both comment styles even in C, so since |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
337 ;; all languages now require dual comments, we make this the |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
338 ;; default. |
18720 | 339 (cond |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
340 ;; XEmacs |
18720 | 341 ((memq '8-bit c-emacs-features) |
342 (modify-syntax-entry ?/ ". 1456" table) | |
19300
b07fa43938cc
(c-mode-base-map, c++-mode-map):
Richard M. Stallman <rms@gnu.org>
parents:
19250
diff
changeset
|
343 (modify-syntax-entry ?* ". 23" table)) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
344 ;; Emacs |
18720 | 345 ((memq '1-bit c-emacs-features) |
346 (modify-syntax-entry ?/ ". 124b" table) | |
19300
b07fa43938cc
(c-mode-base-map, c++-mode-map):
Richard M. Stallman <rms@gnu.org>
parents:
19250
diff
changeset
|
347 (modify-syntax-entry ?* ". 23" table)) |
18720 | 348 ;; incompatible |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
349 (t (error "CC Mode is incompatible with this version of Emacs"))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
350 |
19300
b07fa43938cc
(c-mode-base-map, c++-mode-map):
Richard M. Stallman <rms@gnu.org>
parents:
19250
diff
changeset
|
351 (modify-syntax-entry ?\n "> b" table) |
b07fa43938cc
(c-mode-base-map, c++-mode-map):
Richard M. Stallman <rms@gnu.org>
parents:
19250
diff
changeset
|
352 ;; Give CR the same syntax as newline, for selective-display |
b07fa43938cc
(c-mode-base-map, c++-mode-map):
Richard M. Stallman <rms@gnu.org>
parents:
19250
diff
changeset
|
353 (modify-syntax-entry ?\^m "> b" table)) |
b07fa43938cc
(c-mode-base-map, c++-mode-map):
Richard M. Stallman <rms@gnu.org>
parents:
19250
diff
changeset
|
354 |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
355 (c-lang-defconst c-make-mode-syntax-table |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
356 "Functions that generates the mode specific syntax tables. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
357 The syntax tables aren't stored directly since they're quite large." |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
358 t `(lambda () |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
359 (let ((table (make-syntax-table))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
360 (c-populate-syntax-table table) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
361 ;; Mode specific syntaxes. |
109599
c18dffa2ba46
Enhance Java Mode to handle Java 5.0 (Tiger) and Java 6 (Mustang).
Alan Mackenzie <acm@muc.de>
parents:
107086
diff
changeset
|
362 ,(cond ((or (c-major-mode-is 'objc-mode) (c-major-mode-is 'java-mode)) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
363 ;; Let '@' be part of symbols in ObjC to cope with |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
364 ;; its compiler directives as single keyword tokens. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
365 ;; This is then necessary since it's assumed that |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
366 ;; every keyword is a single symbol. |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
367 `(modify-syntax-entry ?@ "_" table)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
368 ((c-major-mode-is 'pike-mode) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
369 `(modify-syntax-entry ?@ "." table))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
370 table))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
371 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
372 (c-lang-defconst c-mode-syntax-table |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
373 ;; The syntax tables in evaluated form. Only used temporarily when |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
374 ;; the constants in this file are evaluated. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
375 t (funcall (c-lang-const c-make-mode-syntax-table))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
376 |
51946
048b0517e63d
(c++-make-template-syntax-table, c-syntactic-ws-start, c-syntactic-ws-end):
Martin Stjernholm <mast@lysator.liu.se>
parents:
51748
diff
changeset
|
377 (c-lang-defconst c++-make-template-syntax-table |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
378 ;; A variant of `c++-mode-syntax-table' that defines `<' and `>' as |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
379 ;; parenthesis characters. Used temporarily when template argument |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
380 ;; lists are parsed. Note that this encourages incorrect parsing of |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
381 ;; templates since they might contain normal operators that uses the |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
382 ;; '<' and '>' characters. Therefore this syntax table might go |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
383 ;; away when CC Mode handles templates correctly everywhere. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
384 t nil |
109599
c18dffa2ba46
Enhance Java Mode to handle Java 5.0 (Tiger) and Java 6 (Mustang).
Alan Mackenzie <acm@muc.de>
parents:
107086
diff
changeset
|
385 (java c++) `(lambda () |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
386 (let ((table (funcall ,(c-lang-const c-make-mode-syntax-table)))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
387 (modify-syntax-entry ?< "(>" table) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
388 (modify-syntax-entry ?> ")<" table) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
389 table))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
390 (c-lang-defvar c++-template-syntax-table |
51946
048b0517e63d
(c++-make-template-syntax-table, c-syntactic-ws-start, c-syntactic-ws-end):
Martin Stjernholm <mast@lysator.liu.se>
parents:
51748
diff
changeset
|
391 (and (c-lang-const c++-make-template-syntax-table) |
048b0517e63d
(c++-make-template-syntax-table, c-syntactic-ws-start, c-syntactic-ws-end):
Martin Stjernholm <mast@lysator.liu.se>
parents:
51748
diff
changeset
|
392 (funcall (c-lang-const c++-make-template-syntax-table)))) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
393 |
107086
1786f2e6a856
Change strategy for marking < and > as template delimiters: mark them
Alan Mackenzie <acm@muc.de>
parents:
106815
diff
changeset
|
394 (c-lang-defconst c-no-parens-syntax-table |
1786f2e6a856
Change strategy for marking < and > as template delimiters: mark them
Alan Mackenzie <acm@muc.de>
parents:
106815
diff
changeset
|
395 ;; A variant of the standard syntax table which is used to find matching |
1786f2e6a856
Change strategy for marking < and > as template delimiters: mark them
Alan Mackenzie <acm@muc.de>
parents:
106815
diff
changeset
|
396 ;; "<"s and ">"s which have been marked as parens using syntax table |
1786f2e6a856
Change strategy for marking < and > as template delimiters: mark them
Alan Mackenzie <acm@muc.de>
parents:
106815
diff
changeset
|
397 ;; properties. The other paren characters (e.g. "{", ")" "]") are given a |
1786f2e6a856
Change strategy for marking < and > as template delimiters: mark them
Alan Mackenzie <acm@muc.de>
parents:
106815
diff
changeset
|
398 ;; non-paren syntax here. so that the list commands will work on "< ... >" |
1786f2e6a856
Change strategy for marking < and > as template delimiters: mark them
Alan Mackenzie <acm@muc.de>
parents:
106815
diff
changeset
|
399 ;; even when there's unbalanced other parens inside them. |
1786f2e6a856
Change strategy for marking < and > as template delimiters: mark them
Alan Mackenzie <acm@muc.de>
parents:
106815
diff
changeset
|
400 ;; |
1786f2e6a856
Change strategy for marking < and > as template delimiters: mark them
Alan Mackenzie <acm@muc.de>
parents:
106815
diff
changeset
|
401 ;; This variable is nil for languages which don't have template stuff. |
1786f2e6a856
Change strategy for marking < and > as template delimiters: mark them
Alan Mackenzie <acm@muc.de>
parents:
106815
diff
changeset
|
402 t `(lambda () |
1786f2e6a856
Change strategy for marking < and > as template delimiters: mark them
Alan Mackenzie <acm@muc.de>
parents:
106815
diff
changeset
|
403 (if (c-lang-const c-recognize-<>-arglists) |
1786f2e6a856
Change strategy for marking < and > as template delimiters: mark them
Alan Mackenzie <acm@muc.de>
parents:
106815
diff
changeset
|
404 (let ((table (funcall ,(c-lang-const c-make-mode-syntax-table)))) |
1786f2e6a856
Change strategy for marking < and > as template delimiters: mark them
Alan Mackenzie <acm@muc.de>
parents:
106815
diff
changeset
|
405 (modify-syntax-entry ?\( "." table) |
1786f2e6a856
Change strategy for marking < and > as template delimiters: mark them
Alan Mackenzie <acm@muc.de>
parents:
106815
diff
changeset
|
406 (modify-syntax-entry ?\) "." table) |
1786f2e6a856
Change strategy for marking < and > as template delimiters: mark them
Alan Mackenzie <acm@muc.de>
parents:
106815
diff
changeset
|
407 (modify-syntax-entry ?\[ "." table) |
1786f2e6a856
Change strategy for marking < and > as template delimiters: mark them
Alan Mackenzie <acm@muc.de>
parents:
106815
diff
changeset
|
408 (modify-syntax-entry ?\] "." table) |
1786f2e6a856
Change strategy for marking < and > as template delimiters: mark them
Alan Mackenzie <acm@muc.de>
parents:
106815
diff
changeset
|
409 (modify-syntax-entry ?\{ "." table) |
1786f2e6a856
Change strategy for marking < and > as template delimiters: mark them
Alan Mackenzie <acm@muc.de>
parents:
106815
diff
changeset
|
410 (modify-syntax-entry ?\} "." table) |
1786f2e6a856
Change strategy for marking < and > as template delimiters: mark them
Alan Mackenzie <acm@muc.de>
parents:
106815
diff
changeset
|
411 table)))) |
1786f2e6a856
Change strategy for marking < and > as template delimiters: mark them
Alan Mackenzie <acm@muc.de>
parents:
106815
diff
changeset
|
412 (c-lang-defvar c-no-parens-syntax-table |
1786f2e6a856
Change strategy for marking < and > as template delimiters: mark them
Alan Mackenzie <acm@muc.de>
parents:
106815
diff
changeset
|
413 (funcall (c-lang-const c-no-parens-syntax-table))) |
1786f2e6a856
Change strategy for marking < and > as template delimiters: mark them
Alan Mackenzie <acm@muc.de>
parents:
106815
diff
changeset
|
414 |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
415 (c-lang-defconst c-identifier-syntax-modifications |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
416 "A list that describes the modifications that should be done to the |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
417 mode syntax table to get a syntax table that matches all identifiers |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
418 and keywords as words. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
419 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
420 The list is just like the one used in `font-lock-defaults': Each |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
421 element is a cons where the car is the character to modify and the cdr |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
422 the new syntax, as accepted by `modify-syntax-entry'." |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
423 ;; The $ character is not allowed in most languages (one exception |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
424 ;; is Java which allows it for legacy reasons) but we still classify |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
425 ;; it as an indentifier character since it's often used in various |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
426 ;; machine generated identifiers. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
427 t '((?_ . "w") (?$ . "w")) |
109599
c18dffa2ba46
Enhance Java Mode to handle Java 5.0 (Tiger) and Java 6 (Mustang).
Alan Mackenzie <acm@muc.de>
parents:
107086
diff
changeset
|
428 (objc java) (append '((?@ . "w")) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
429 (c-lang-const c-identifier-syntax-modifications)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
430 awk '((?_ . "w"))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
431 (c-lang-defvar c-identifier-syntax-modifications |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
432 (c-lang-const c-identifier-syntax-modifications)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
433 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
434 (c-lang-defvar c-identifier-syntax-table |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
435 (let ((table (copy-syntax-table (c-mode-var "mode-syntax-table"))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
436 (mods c-identifier-syntax-modifications) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
437 mod) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
438 (while mods |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
439 (setq mod (car mods) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
440 mods (cdr mods)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
441 (modify-syntax-entry (car mod) (cdr mod) table)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
442 table) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
443 "Syntax table built on the mode syntax table but additionally |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
444 classifies symbol constituents like '_' and '$' as word constituents, |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
445 so that all identifiers are recognized as words.") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
446 |
107086
1786f2e6a856
Change strategy for marking < and > as template delimiters: mark them
Alan Mackenzie <acm@muc.de>
parents:
106815
diff
changeset
|
447 (c-lang-defconst c-get-state-before-change-functions |
1786f2e6a856
Change strategy for marking < and > as template delimiters: mark them
Alan Mackenzie <acm@muc.de>
parents:
106815
diff
changeset
|
448 ;; For documentation see the following c-lang-defvar of the same name. |
1786f2e6a856
Change strategy for marking < and > as template delimiters: mark them
Alan Mackenzie <acm@muc.de>
parents:
106815
diff
changeset
|
449 ;; The value here may be a list of functions or a single function. |
1786f2e6a856
Change strategy for marking < and > as template delimiters: mark them
Alan Mackenzie <acm@muc.de>
parents:
106815
diff
changeset
|
450 t nil |
1786f2e6a856
Change strategy for marking < and > as template delimiters: mark them
Alan Mackenzie <acm@muc.de>
parents:
106815
diff
changeset
|
451 c++ '(c-extend-region-for-CPP c-before-change-check-<>-operators) |
1786f2e6a856
Change strategy for marking < and > as template delimiters: mark them
Alan Mackenzie <acm@muc.de>
parents:
106815
diff
changeset
|
452 (c objc) 'c-extend-region-for-CPP |
1786f2e6a856
Change strategy for marking < and > as template delimiters: mark them
Alan Mackenzie <acm@muc.de>
parents:
106815
diff
changeset
|
453 ;; java 'c-before-change-check-<>-operators |
1786f2e6a856
Change strategy for marking < and > as template delimiters: mark them
Alan Mackenzie <acm@muc.de>
parents:
106815
diff
changeset
|
454 awk 'c-awk-record-region-clear-NL) |
1786f2e6a856
Change strategy for marking < and > as template delimiters: mark them
Alan Mackenzie <acm@muc.de>
parents:
106815
diff
changeset
|
455 (c-lang-defvar c-get-state-before-change-functions |
1786f2e6a856
Change strategy for marking < and > as template delimiters: mark them
Alan Mackenzie <acm@muc.de>
parents:
106815
diff
changeset
|
456 (let ((fs (c-lang-const c-get-state-before-change-functions))) |
1786f2e6a856
Change strategy for marking < and > as template delimiters: mark them
Alan Mackenzie <acm@muc.de>
parents:
106815
diff
changeset
|
457 (if (listp fs) |
1786f2e6a856
Change strategy for marking < and > as template delimiters: mark them
Alan Mackenzie <acm@muc.de>
parents:
106815
diff
changeset
|
458 fs |
1786f2e6a856
Change strategy for marking < and > as template delimiters: mark them
Alan Mackenzie <acm@muc.de>
parents:
106815
diff
changeset
|
459 (list fs))) |
1786f2e6a856
Change strategy for marking < and > as template delimiters: mark them
Alan Mackenzie <acm@muc.de>
parents:
106815
diff
changeset
|
460 "If non-nil, a list of functions called from c-before-change-hook. |
1786f2e6a856
Change strategy for marking < and > as template delimiters: mark them
Alan Mackenzie <acm@muc.de>
parents:
106815
diff
changeset
|
461 Typically these will record enough state to allow |
80159
0a04edfc4982
Set of changes so that "obtrusive" syntactic elements in a
Alan Mackenzie <acm@muc.de>
parents:
79958
diff
changeset
|
462 `c-before-font-lock-function' to extend the region to fontify, |
0a04edfc4982
Set of changes so that "obtrusive" syntactic elements in a
Alan Mackenzie <acm@muc.de>
parents:
79958
diff
changeset
|
463 and may do such things as removing text-properties which must be |
0a04edfc4982
Set of changes so that "obtrusive" syntactic elements in a
Alan Mackenzie <acm@muc.de>
parents:
79958
diff
changeset
|
464 recalculated. |
0a04edfc4982
Set of changes so that "obtrusive" syntactic elements in a
Alan Mackenzie <acm@muc.de>
parents:
79958
diff
changeset
|
465 |
107086
1786f2e6a856
Change strategy for marking < and > as template delimiters: mark them
Alan Mackenzie <acm@muc.de>
parents:
106815
diff
changeset
|
466 These functions will be run in the order given. Each of them |
1786f2e6a856
Change strategy for marking < and > as template delimiters: mark them
Alan Mackenzie <acm@muc.de>
parents:
106815
diff
changeset
|
467 takes 2 parameters, the BEG and END supplied to every |
80159
0a04edfc4982
Set of changes so that "obtrusive" syntactic elements in a
Alan Mackenzie <acm@muc.de>
parents:
79958
diff
changeset
|
468 before-change function; on entry, the buffer will have been |
0a04edfc4982
Set of changes so that "obtrusive" syntactic elements in a
Alan Mackenzie <acm@muc.de>
parents:
79958
diff
changeset
|
469 widened and match-data will have been saved; point is undefined |
0a04edfc4982
Set of changes so that "obtrusive" syntactic elements in a
Alan Mackenzie <acm@muc.de>
parents:
79958
diff
changeset
|
470 on both entry and exit; the return value is ignored. |
0a04edfc4982
Set of changes so that "obtrusive" syntactic elements in a
Alan Mackenzie <acm@muc.de>
parents:
79958
diff
changeset
|
471 |
107086
1786f2e6a856
Change strategy for marking < and > as template delimiters: mark them
Alan Mackenzie <acm@muc.de>
parents:
106815
diff
changeset
|
472 The functions are called even when font locking isn't enabled. |
1786f2e6a856
Change strategy for marking < and > as template delimiters: mark them
Alan Mackenzie <acm@muc.de>
parents:
106815
diff
changeset
|
473 |
1786f2e6a856
Change strategy for marking < and > as template delimiters: mark them
Alan Mackenzie <acm@muc.de>
parents:
106815
diff
changeset
|
474 When the mode is initialized, the functions are called with |
1786f2e6a856
Change strategy for marking < and > as template delimiters: mark them
Alan Mackenzie <acm@muc.de>
parents:
106815
diff
changeset
|
475 parameters \(point-min) and \(point-max).") |
1786f2e6a856
Change strategy for marking < and > as template delimiters: mark them
Alan Mackenzie <acm@muc.de>
parents:
106815
diff
changeset
|
476 |
80159
0a04edfc4982
Set of changes so that "obtrusive" syntactic elements in a
Alan Mackenzie <acm@muc.de>
parents:
79958
diff
changeset
|
477 (c-lang-defconst c-before-font-lock-function |
0a04edfc4982
Set of changes so that "obtrusive" syntactic elements in a
Alan Mackenzie <acm@muc.de>
parents:
79958
diff
changeset
|
478 "If non-nil, a function called just before font locking. |
0a04edfc4982
Set of changes so that "obtrusive" syntactic elements in a
Alan Mackenzie <acm@muc.de>
parents:
79958
diff
changeset
|
479 Typically it will extend the region about to be fontified \(see |
0a04edfc4982
Set of changes so that "obtrusive" syntactic elements in a
Alan Mackenzie <acm@muc.de>
parents:
79958
diff
changeset
|
480 below) and will set `syntax-table' text properties on the region. |
0a04edfc4982
Set of changes so that "obtrusive" syntactic elements in a
Alan Mackenzie <acm@muc.de>
parents:
79958
diff
changeset
|
481 |
0a04edfc4982
Set of changes so that "obtrusive" syntactic elements in a
Alan Mackenzie <acm@muc.de>
parents:
79958
diff
changeset
|
482 It takes 3 parameters, the BEG, END, and OLD-LEN supplied to |
0a04edfc4982
Set of changes so that "obtrusive" syntactic elements in a
Alan Mackenzie <acm@muc.de>
parents:
79958
diff
changeset
|
483 every after-change function; point is undefined on both entry and |
0a04edfc4982
Set of changes so that "obtrusive" syntactic elements in a
Alan Mackenzie <acm@muc.de>
parents:
79958
diff
changeset
|
484 exit; on entry, the buffer will have been widened and match-data |
0a04edfc4982
Set of changes so that "obtrusive" syntactic elements in a
Alan Mackenzie <acm@muc.de>
parents:
79958
diff
changeset
|
485 will have been saved; the return value is ignored. |
0a04edfc4982
Set of changes so that "obtrusive" syntactic elements in a
Alan Mackenzie <acm@muc.de>
parents:
79958
diff
changeset
|
486 |
0a04edfc4982
Set of changes so that "obtrusive" syntactic elements in a
Alan Mackenzie <acm@muc.de>
parents:
79958
diff
changeset
|
487 The function may extend the region to be fontified by setting the |
80460
efa8f716525c
(c-before-font-lock-function): Correct a typo in the doc string.
Alan Mackenzie <acm@muc.de>
parents:
80256
diff
changeset
|
488 buffer local variables c-new-BEG and c-new-END. |
80159
0a04edfc4982
Set of changes so that "obtrusive" syntactic elements in a
Alan Mackenzie <acm@muc.de>
parents:
79958
diff
changeset
|
489 |
0a04edfc4982
Set of changes so that "obtrusive" syntactic elements in a
Alan Mackenzie <acm@muc.de>
parents:
79958
diff
changeset
|
490 The function is called even when font locking is disabled. |
0a04edfc4982
Set of changes so that "obtrusive" syntactic elements in a
Alan Mackenzie <acm@muc.de>
parents:
79958
diff
changeset
|
491 |
0a04edfc4982
Set of changes so that "obtrusive" syntactic elements in a
Alan Mackenzie <acm@muc.de>
parents:
79958
diff
changeset
|
492 When the mode is initialized, this function is called with |
0a04edfc4982
Set of changes so that "obtrusive" syntactic elements in a
Alan Mackenzie <acm@muc.de>
parents:
79958
diff
changeset
|
493 parameters \(point-min), \(point-max) and <buffer size>." |
0a04edfc4982
Set of changes so that "obtrusive" syntactic elements in a
Alan Mackenzie <acm@muc.de>
parents:
79958
diff
changeset
|
494 t nil |
106395
f2b36fb84bf7
Enhance `c-parse-state' to run efficiently in "brace desserts".
Alan Mackenzie <acm@muc.de>
parents:
106160
diff
changeset
|
495 (c c++ objc) 'c-neutralize-syntax-in-and-mark-CPP |
80159
0a04edfc4982
Set of changes so that "obtrusive" syntactic elements in a
Alan Mackenzie <acm@muc.de>
parents:
79958
diff
changeset
|
496 awk 'c-awk-extend-and-syntax-tablify-region) |
0a04edfc4982
Set of changes so that "obtrusive" syntactic elements in a
Alan Mackenzie <acm@muc.de>
parents:
79958
diff
changeset
|
497 (c-lang-defvar c-before-font-lock-function |
0a04edfc4982
Set of changes so that "obtrusive" syntactic elements in a
Alan Mackenzie <acm@muc.de>
parents:
79958
diff
changeset
|
498 (c-lang-const c-before-font-lock-function)) |
0a04edfc4982
Set of changes so that "obtrusive" syntactic elements in a
Alan Mackenzie <acm@muc.de>
parents:
79958
diff
changeset
|
499 |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
500 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
501 ;;; Lexer-level syntax (identifiers, tokens etc). |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
502 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
503 (c-lang-defconst c-symbol-start |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
504 "Regexp that matches the start of a symbol, i.e. any identifier or |
109599
c18dffa2ba46
Enhance Java Mode to handle Java 5.0 (Tiger) and Java 6 (Mustang).
Alan Mackenzie <acm@muc.de>
parents:
107086
diff
changeset
|
505 keyword. It's unspecified how far it matches. Does not contain a \\| |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
506 operator at the top level." |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
507 t (concat "[" c-alpha "_]") |
109599
c18dffa2ba46
Enhance Java Mode to handle Java 5.0 (Tiger) and Java 6 (Mustang).
Alan Mackenzie <acm@muc.de>
parents:
107086
diff
changeset
|
508 java (concat "[" c-alpha "_@]") |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
509 objc (concat "[" c-alpha "@]") |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
510 pike (concat "[" c-alpha "_`]")) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
511 (c-lang-defvar c-symbol-start (c-lang-const c-symbol-start)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
512 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
513 (c-lang-defconst c-symbol-chars |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
514 "Set of characters that can be part of a symbol. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
515 This is on the form that fits inside [ ] in a regexp." |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
516 ;; Pike note: With the backquote identifiers this would include most |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
517 ;; operator chars too, but they are handled with other means instead. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
518 t (concat c-alnum "_$") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
519 objc (concat c-alnum "_$@")) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
520 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
521 (c-lang-defconst c-symbol-key |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
522 "Regexp matching identifiers and keywords (with submatch 0). Assumed |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
523 to match if `c-symbol-start' matches on the same position." |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
524 t (concat (c-lang-const c-symbol-start) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
525 "[" (c-lang-const c-symbol-chars) "]*") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
526 pike (concat |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
527 ;; Use the value from C here since the operator backquote is |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
528 ;; covered by the other alternative. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
529 (c-lang-const c-symbol-key c) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
530 "\\|" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
531 (c-make-keywords-re nil |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
532 (c-lang-const c-overloadable-operators)))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
533 (c-lang-defvar c-symbol-key (c-lang-const c-symbol-key)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
534 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
535 (c-lang-defconst c-symbol-key-depth |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
536 ;; Number of regexp grouping parens in `c-symbol-key'. |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
537 t (regexp-opt-depth (c-lang-const c-symbol-key))) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
538 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
539 (c-lang-defconst c-nonsymbol-chars |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
540 "This is the set of chars that can't be part of a symbol, i.e. the |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
541 negation of `c-symbol-chars'." |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
542 t (concat "^" (c-lang-const c-symbol-chars))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
543 (c-lang-defvar c-nonsymbol-chars (c-lang-const c-nonsymbol-chars)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
544 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
545 (c-lang-defconst c-nonsymbol-key |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
546 "Regexp that matches any character that can't be part of a symbol. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
547 It's usually appended to other regexps to avoid matching a prefix. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
548 It's assumed to not contain any submatchers." |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
549 ;; The same thing regarding Unicode identifiers applies here as to |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
550 ;; `c-symbol-key'. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
551 t (concat "[" (c-lang-const c-nonsymbol-chars) "]")) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
552 |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
553 (c-lang-defconst c-identifier-ops |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
554 "The operators that make up fully qualified identifiers. nil in |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
555 languages that don't have such things. See `c-operators' for a |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
556 description of the format. Binary operators can concatenate symbols, |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
557 e.g. \"::\" in \"A::B::C\". Prefix operators can precede identifiers, |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
558 e.g. \"~\" in \"~A::B\". Other types of operators aren't supported. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
559 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
560 This value is by default merged into `c-operators'." |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
561 t nil |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
562 c++ '((prefix "~" "??-" "compl") |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
563 (right-assoc "::") |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
564 (prefix "::")) |
56646
b7446b6f097d
Updated CC Mode to 5.30.9.
Martin Stjernholm <mast@lysator.liu.se>
parents:
52607
diff
changeset
|
565 ;; Java has "." to concatenate identifiers but it's also used for |
b7446b6f097d
Updated CC Mode to 5.30.9.
Martin Stjernholm <mast@lysator.liu.se>
parents:
52607
diff
changeset
|
566 ;; normal indexing. There's special code in the Java font lock |
b7446b6f097d
Updated CC Mode to 5.30.9.
Martin Stjernholm <mast@lysator.liu.se>
parents:
52607
diff
changeset
|
567 ;; rules to fontify qualified identifiers based on the standard |
b7446b6f097d
Updated CC Mode to 5.30.9.
Martin Stjernholm <mast@lysator.liu.se>
parents:
52607
diff
changeset
|
568 ;; naming conventions. We still define "." here to make |
b7446b6f097d
Updated CC Mode to 5.30.9.
Martin Stjernholm <mast@lysator.liu.se>
parents:
52607
diff
changeset
|
569 ;; `c-forward-name' move over as long names as possible which is |
b7446b6f097d
Updated CC Mode to 5.30.9.
Martin Stjernholm <mast@lysator.liu.se>
parents:
52607
diff
changeset
|
570 ;; necessary to e.g. handle throws clauses correctly. |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
571 java '((left-assoc ".")) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
572 idl '((left-assoc "::") |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
573 (prefix "::")) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
574 pike '((left-assoc "::") |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
575 (prefix "::") |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
576 (left-assoc "."))) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
577 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
578 (c-lang-defconst c-opt-identifier-concat-key |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
579 ;; Appendable adorned regexp matching the operators that join |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
580 ;; symbols to fully qualified identifiers, or nil in languages that |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
581 ;; don't have such things. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
582 ;; |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
583 ;; This was a docstring constant in 5.30. It still works but is now |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
584 ;; considered internal - change `c-identifier-ops' instead. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
585 t (let ((ops (c-filter-ops (c-lang-const c-identifier-ops) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
586 '(left-assoc right-assoc) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
587 t))) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
588 (when ops |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
589 (c-make-keywords-re 'appendable ops)))) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
590 (c-lang-defvar c-opt-identifier-concat-key |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
591 (c-lang-const c-opt-identifier-concat-key) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
592 'dont-doc) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
593 |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
594 (c-lang-defconst c-opt-identifier-concat-key-depth |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
595 ;; Number of regexp grouping parens in `c-opt-identifier-concat-key'. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
596 t (regexp-opt-depth (c-lang-const c-opt-identifier-concat-key))) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
597 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
598 (c-lang-defconst c-opt-identifier-prefix-key |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
599 ;; Appendable adorned regexp matching operators that might precede |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
600 ;; an identifier and that are part of the identifier in that case. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
601 ;; nil in languages without such things. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
602 t (let ((ops (c-filter-ops (c-lang-const c-identifier-ops) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
603 '(prefix) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
604 t))) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
605 (when ops |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
606 (c-make-keywords-re 'appendable ops)))) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
607 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
608 (c-lang-defconst c-after-id-concat-ops |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
609 "Operators that can occur after a binary operator on `c-identifier-ops' |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
610 in identifiers. nil in languages that don't have such things. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
611 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
612 Operators here should also have appropriate entries in `c-operators' - |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
613 it's not taken care of by default." |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
614 t nil |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
615 ;; '~' for destructors in C++, '*' for member pointers. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
616 c++ '("~" "*") |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
617 ;; In Java we recognize '*' to deal with "foo.bar.*" that can occur |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
618 ;; in import declarations. (This will also match bogus things like |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
619 ;; "foo.*bar" but we don't bother.) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
620 java '("*")) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
621 |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
622 (c-lang-defconst c-opt-after-id-concat-key |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
623 ;; Regexp that must match the token after |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
624 ;; `c-opt-identifier-concat-key' for it to be considered an |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
625 ;; identifier concatenation operator (which e.g. causes the |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
626 ;; preceding identifier to be fontified as a reference). Assumed to |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
627 ;; be a string if `c-opt-identifier-concat-key' is. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
628 ;; |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
629 ;; This was a docstring constant in 5.30. It still works but is now |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
630 ;; considered internal - change `c-after-id-concat-ops' instead. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
631 t (concat (c-lang-const c-symbol-start) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
632 (if (c-lang-const c-after-id-concat-ops) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
633 (concat "\\|" (c-make-keywords-re 'appendable |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
634 (c-lang-const c-after-id-concat-ops))) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
635 ""))) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
636 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
637 (c-lang-defconst c-identifier-start |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
638 "Regexp that matches the start of an (optionally qualified) identifier. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
639 It should also match all keywords. It's unspecified how far it |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
640 matches." |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
641 t (concat (c-lang-const c-symbol-start) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
642 (if (c-lang-const c-opt-identifier-prefix-key) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
643 (concat "\\|" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
644 (c-lang-const c-opt-identifier-prefix-key)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
645 ""))) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
646 (c-lang-defvar c-identifier-start (c-lang-const c-identifier-start)) |
18720 | 647 |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
648 (c-lang-defconst c-identifier-key |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
649 "Regexp matching a fully qualified identifier, like \"A::B::c\" in |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
650 C++. It does not recognize the full range of syntactic whitespace |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
651 between the tokens; `c-forward-name' has to be used for that. It |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
652 should also not match identifiers containing parenthesis groupings, |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
653 e.g. identifiers with template arguments such as \"A<X,Y>\" in C++." |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
654 ;; This regexp is more complex than strictly necessary to ensure |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
655 ;; that it can be matched with a minimum of backtracking. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
656 t (concat (if (c-lang-const c-opt-identifier-prefix-key) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
657 (concat |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
658 "\\(" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
659 (c-lang-const c-opt-identifier-prefix-key) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
660 (c-lang-const c-simple-ws) "*" |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
661 "\\)?") |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
662 "") |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
663 "\\(" (c-lang-const c-symbol-key) "\\)" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
664 (if (c-lang-const c-opt-identifier-concat-key) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
665 (concat |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
666 "\\(" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
667 (c-lang-const c-simple-ws) "*" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
668 (c-lang-const c-opt-identifier-concat-key) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
669 (c-lang-const c-simple-ws) "*" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
670 (if (c-lang-const c-after-id-concat-ops) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
671 (concat |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
672 "\\(" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
673 (c-make-keywords-re 'appendable |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
674 (c-lang-const c-after-id-concat-ops)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
675 (concat |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
676 ;; For flexibility, consider the symbol match |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
677 ;; optional if we've hit a |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
678 ;; `c-after-id-concat-ops' operator. This is |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
679 ;; also necessary to handle the "*" that can |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
680 ;; end import declaration identifiers in Java. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
681 "\\(" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
682 (c-lang-const c-simple-ws) "*" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
683 "\\(" (c-lang-const c-symbol-key) "\\)" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
684 "\\)?") |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
685 "\\|" |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
686 "\\(" (c-lang-const c-symbol-key) "\\)" |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
687 "\\)") |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
688 (concat "\\(" (c-lang-const c-symbol-key) "\\)")) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
689 "\\)*") |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
690 ""))) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
691 (c-lang-defvar c-identifier-key (c-lang-const c-identifier-key)) |
18720 | 692 |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
693 (c-lang-defconst c-identifier-last-sym-match |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
694 ;; This was a docstring constant in 5.30 but it's no longer used. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
695 ;; It's only kept to avoid breaking third party code. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
696 ;; |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
697 ;; Used to identify the submatch in `c-identifier-key' that |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
698 ;; surrounds the last symbol in the qualified identifier. It's a |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
699 ;; list of submatch numbers, of which the first that has a match is |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
700 ;; taken. It's assumed that at least one does when the regexp has |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
701 ;; matched. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
702 t nil) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
703 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
704 (c-lang-defconst c-string-escaped-newlines |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
705 "Set if the language support backslash escaped newlines inside string |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
706 literals." |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
707 t nil |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
708 (c c++ objc pike) t) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
709 (c-lang-defvar c-string-escaped-newlines |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
710 (c-lang-const c-string-escaped-newlines)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
711 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
712 (c-lang-defconst c-multiline-string-start-char |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
713 "Set if the language supports multiline string literals without escaped |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
714 newlines. If t, all string literals are multiline. If a character, |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
715 only literals where the open quote is immediately preceded by that |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
716 literal are multiline." |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
717 t nil |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
718 pike ?#) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
719 (c-lang-defvar c-multiline-string-start-char |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
720 (c-lang-const c-multiline-string-start-char)) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
721 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
722 (c-lang-defconst c-opt-cpp-prefix |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
723 "Regexp matching the prefix of a cpp directive in the languages that |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
724 normally use that macro preprocessor. Tested at bol or at boi. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
725 Assumed to not contain any submatches or \\| operators." |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
726 ;; TODO (ACM, 2005-04-01). Amend the following to recognise escaped NLs; |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
727 ;; amend all uses of c-opt-cpp-prefix which count regexp-depth. |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
728 t "\\s *#\\s *" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
729 (java awk) nil) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
730 (c-lang-defvar c-opt-cpp-prefix (c-lang-const c-opt-cpp-prefix)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
731 |
80159
0a04edfc4982
Set of changes so that "obtrusive" syntactic elements in a
Alan Mackenzie <acm@muc.de>
parents:
79958
diff
changeset
|
732 (c-lang-defconst c-anchored-cpp-prefix |
0a04edfc4982
Set of changes so that "obtrusive" syntactic elements in a
Alan Mackenzie <acm@muc.de>
parents:
79958
diff
changeset
|
733 "Regexp matching the prefix of a cpp directive anchored to BOL, |
0a04edfc4982
Set of changes so that "obtrusive" syntactic elements in a
Alan Mackenzie <acm@muc.de>
parents:
79958
diff
changeset
|
734 in the languages that have a macro preprocessor." |
0a04edfc4982
Set of changes so that "obtrusive" syntactic elements in a
Alan Mackenzie <acm@muc.de>
parents:
79958
diff
changeset
|
735 t (if (c-lang-const c-opt-cpp-prefix) |
0a04edfc4982
Set of changes so that "obtrusive" syntactic elements in a
Alan Mackenzie <acm@muc.de>
parents:
79958
diff
changeset
|
736 (concat "^" (c-lang-const c-opt-cpp-prefix)))) |
0a04edfc4982
Set of changes so that "obtrusive" syntactic elements in a
Alan Mackenzie <acm@muc.de>
parents:
79958
diff
changeset
|
737 (c-lang-defvar c-anchored-cpp-prefix (c-lang-const c-anchored-cpp-prefix)) |
0a04edfc4982
Set of changes so that "obtrusive" syntactic elements in a
Alan Mackenzie <acm@muc.de>
parents:
79958
diff
changeset
|
738 |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
739 (c-lang-defconst c-opt-cpp-start |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
740 "Regexp matching the prefix of a cpp directive including the directive |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
741 name, or nil in languages without preprocessor support. The first |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
742 submatch surrounds the directive name." |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
743 t (if (c-lang-const c-opt-cpp-prefix) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
744 (concat (c-lang-const c-opt-cpp-prefix) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
745 "\\([" c-alnum "]+\\)")) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
746 ;; Pike, being a scripting language, recognizes hash-bangs too. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
747 pike (concat (c-lang-const c-opt-cpp-prefix) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
748 "\\([" c-alnum "]+\\|!\\)")) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
749 (c-lang-defvar c-opt-cpp-start (c-lang-const c-opt-cpp-start)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
750 |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
751 (c-lang-defconst c-cpp-message-directives |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
752 "List of cpp directives (without the prefix) that are followed by a |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
753 string message." |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
754 t (if (c-lang-const c-opt-cpp-prefix) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
755 '("error")) |
80159
0a04edfc4982
Set of changes so that "obtrusive" syntactic elements in a
Alan Mackenzie <acm@muc.de>
parents:
79958
diff
changeset
|
756 (c c++ objc pike) '("error" "warning")) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
757 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
758 (c-lang-defconst c-cpp-include-directives |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
759 "List of cpp directives (without the prefix) that are followed by a |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
760 file name in angle brackets or quotes." |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
761 t (if (c-lang-const c-opt-cpp-prefix) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
762 '("include")) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
763 objc '("include" "import")) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
764 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
765 (c-lang-defconst c-opt-cpp-macro-define |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
766 "Cpp directive (without the prefix) that is followed by a macro |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
767 definition, or nil if the language doesn't have any." |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
768 t (if (c-lang-const c-opt-cpp-prefix) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
769 "define")) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
770 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
771 (c-lang-defconst c-opt-cpp-macro-define-start |
80460
efa8f716525c
(c-before-font-lock-function): Correct a typo in the doc string.
Alan Mackenzie <acm@muc.de>
parents:
80256
diff
changeset
|
772 ;; Regexp matching everything up to the macro body of a cpp define, or the |
efa8f716525c
(c-before-font-lock-function): Correct a typo in the doc string.
Alan Mackenzie <acm@muc.de>
parents:
80256
diff
changeset
|
773 ;; end of the logical line if there is none. Submatch 1 is the name of the |
efa8f716525c
(c-before-font-lock-function): Correct a typo in the doc string.
Alan Mackenzie <acm@muc.de>
parents:
80256
diff
changeset
|
774 ;; macro. Set if c-opt-cpp-macro-define is. |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
775 t (if (c-lang-const c-opt-cpp-macro-define) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
776 (concat (c-lang-const c-opt-cpp-prefix) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
777 (c-lang-const c-opt-cpp-macro-define) |
80460
efa8f716525c
(c-before-font-lock-function): Correct a typo in the doc string.
Alan Mackenzie <acm@muc.de>
parents:
80256
diff
changeset
|
778 "[ \t]+\\(\\(\\sw\\|_\\)+\\)\\(\([^\)]*\)\\)?" |
efa8f716525c
(c-before-font-lock-function): Correct a typo in the doc string.
Alan Mackenzie <acm@muc.de>
parents:
80256
diff
changeset
|
779 ;; ^ ^ #defined name |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
780 "\\([ \t]\\|\\\\\n\\)*"))) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
781 (c-lang-defvar c-opt-cpp-macro-define-start |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
782 (c-lang-const c-opt-cpp-macro-define-start)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
783 |
75027
9f636bd65206
Update CC Mode to version 5.31.4. The detailed changes are those
Alan Mackenzie <acm@muc.de>
parents:
74581
diff
changeset
|
784 (c-lang-defconst c-opt-cpp-macro-define-id |
9f636bd65206
Update CC Mode to version 5.31.4. The detailed changes are those
Alan Mackenzie <acm@muc.de>
parents:
74581
diff
changeset
|
785 ;; Regexp matching everything up to the end of the identifier defined |
9f636bd65206
Update CC Mode to version 5.31.4. The detailed changes are those
Alan Mackenzie <acm@muc.de>
parents:
74581
diff
changeset
|
786 ;; by a cpp define. |
9f636bd65206
Update CC Mode to version 5.31.4. The detailed changes are those
Alan Mackenzie <acm@muc.de>
parents:
74581
diff
changeset
|
787 t (if (c-lang-const c-opt-cpp-macro-define) |
9f636bd65206
Update CC Mode to version 5.31.4. The detailed changes are those
Alan Mackenzie <acm@muc.de>
parents:
74581
diff
changeset
|
788 (concat (c-lang-const c-opt-cpp-prefix) ; # |
9f636bd65206
Update CC Mode to version 5.31.4. The detailed changes are those
Alan Mackenzie <acm@muc.de>
parents:
74581
diff
changeset
|
789 (c-lang-const c-opt-cpp-macro-define) ; define |
9f636bd65206
Update CC Mode to version 5.31.4. The detailed changes are those
Alan Mackenzie <acm@muc.de>
parents:
74581
diff
changeset
|
790 "[ \t]+\\(\\sw\\|_\\)+"))) |
9f636bd65206
Update CC Mode to version 5.31.4. The detailed changes are those
Alan Mackenzie <acm@muc.de>
parents:
74581
diff
changeset
|
791 (c-lang-defvar c-opt-cpp-macro-define-id |
9f636bd65206
Update CC Mode to version 5.31.4. The detailed changes are those
Alan Mackenzie <acm@muc.de>
parents:
74581
diff
changeset
|
792 (c-lang-const c-opt-cpp-macro-define-id)) |
9f636bd65206
Update CC Mode to version 5.31.4. The detailed changes are those
Alan Mackenzie <acm@muc.de>
parents:
74581
diff
changeset
|
793 |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
794 (c-lang-defconst c-cpp-expr-directives |
80159
0a04edfc4982
Set of changes so that "obtrusive" syntactic elements in a
Alan Mackenzie <acm@muc.de>
parents:
79958
diff
changeset
|
795 "List of cpp directives (without the prefix) that are followed by an |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
796 expression." |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
797 t (if (c-lang-const c-opt-cpp-prefix) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
798 '("if" "elif"))) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
799 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
800 (c-lang-defconst c-cpp-expr-functions |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
801 "List of functions in cpp expressions." |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
802 t (if (c-lang-const c-opt-cpp-prefix) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
803 '("defined")) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
804 pike '("defined" "efun" "constant")) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
805 |
52341
6a060e586596
(c-lineup-math): Don't align the operators "!=", "<=" and ">=" as assignment
Martin Stjernholm <mast@lysator.liu.se>
parents:
51946
diff
changeset
|
806 (c-lang-defconst c-assignment-operators |
6a060e586596
(c-lineup-math): Don't align the operators "!=", "<=" and ">=" as assignment
Martin Stjernholm <mast@lysator.liu.se>
parents:
51946
diff
changeset
|
807 "List of all assignment operators." |
6a060e586596
(c-lineup-math): Don't align the operators "!=", "<=" and ">=" as assignment
Martin Stjernholm <mast@lysator.liu.se>
parents:
51946
diff
changeset
|
808 t '("=" "*=" "/=" "%=" "+=" "-=" ">>=" "<<=" "&=" "^=" "|=") |
6a060e586596
(c-lineup-math): Don't align the operators "!=", "<=" and ">=" as assignment
Martin Stjernholm <mast@lysator.liu.se>
parents:
51946
diff
changeset
|
809 java (append (c-lang-const c-assignment-operators) |
6a060e586596
(c-lineup-math): Don't align the operators "!=", "<=" and ">=" as assignment
Martin Stjernholm <mast@lysator.liu.se>
parents:
51946
diff
changeset
|
810 '(">>>=")) |
6a060e586596
(c-lineup-math): Don't align the operators "!=", "<=" and ">=" as assignment
Martin Stjernholm <mast@lysator.liu.se>
parents:
51946
diff
changeset
|
811 c++ (append (c-lang-const c-assignment-operators) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
812 '("and_eq" "or_eq" "xor_eq" "??!=" "??'=")) |
52341
6a060e586596
(c-lineup-math): Don't align the operators "!=", "<=" and ">=" as assignment
Martin Stjernholm <mast@lysator.liu.se>
parents:
51946
diff
changeset
|
813 idl nil) |
6a060e586596
(c-lineup-math): Don't align the operators "!=", "<=" and ">=" as assignment
Martin Stjernholm <mast@lysator.liu.se>
parents:
51946
diff
changeset
|
814 |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
815 (c-lang-defconst c-operators |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
816 "List describing all operators, along with their precedence and |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
817 associativity. The order in the list corresponds to the precedence of |
75130
b9690e9e273d
(c-operators, c-filter-ops): Amend doc-string and comments.
Alan Mackenzie <acm@muc.de>
parents:
75027
diff
changeset
|
818 the operators: The operators in each element are a group with the same |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
819 precedence, and the group has higher precedence than the groups in all |
75130
b9690e9e273d
(c-operators, c-filter-ops): Amend doc-string and comments.
Alan Mackenzie <acm@muc.de>
parents:
75027
diff
changeset
|
820 following elements. The car of each element describes the type of the |
b9690e9e273d
(c-operators, c-filter-ops): Amend doc-string and comments.
Alan Mackenzie <acm@muc.de>
parents:
75027
diff
changeset
|
821 operator group, and the cdr is a list of the operator tokens in it. |
b9690e9e273d
(c-operators, c-filter-ops): Amend doc-string and comments.
Alan Mackenzie <acm@muc.de>
parents:
75027
diff
changeset
|
822 The operator group types are: |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
823 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
824 'prefix Unary prefix operators. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
825 'postfix Unary postfix operators. |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
826 'postfix-if-paren |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
827 Unary postfix operators if and only if the chars have |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
828 parenthesis syntax. |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
829 'left-assoc Binary left associative operators (i.e. a+b+c means (a+b)+c). |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
830 'right-assoc Binary right associative operators (i.e. a=b=c means a=(b=c)). |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
831 'right-assoc-sequence |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
832 Right associative operator that constitutes of a |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
833 sequence of tokens that separate expressions. All the |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
834 tokens in the group are in this case taken as |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
835 describing the sequence in one such operator, and the |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
836 order between them is therefore significant. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
837 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
838 Operators containing a character with paren syntax are taken to match |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
839 with a corresponding open/close paren somewhere else. A postfix |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
840 operator with close paren syntax is taken to end a postfix expression |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
841 started somewhere earlier, rather than start a new one at point. Vice |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
842 versa for prefix operators with open paren syntax. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
843 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
844 Note that operators like \".\" and \"->\" which in language references |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
845 often are described as postfix operators are considered binary here, |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
846 since CC Mode treats every identifier as an expression." |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
847 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
848 ;; There's currently no code in CC Mode that exploit all the info |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
849 ;; in this variable; precedence, associativity etc are present as a |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
850 ;; preparation for future work. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
851 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
852 t `(;; Preprocessor. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
853 ,@(when (c-lang-const c-opt-cpp-prefix) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
854 `((prefix "#" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
855 ,@(when (c-major-mode-is '(c-mode c++-mode)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
856 '("%:" "??="))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
857 (left-assoc "##" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
858 ,@(when (c-major-mode-is '(c-mode c++-mode)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
859 '("%:%:" "??=??="))))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
860 |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
861 ;; Primary. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
862 ,@(c-lang-const c-identifier-ops) |
109599
c18dffa2ba46
Enhance Java Mode to handle Java 5.0 (Tiger) and Java 6 (Mustang).
Alan Mackenzie <acm@muc.de>
parents:
107086
diff
changeset
|
863 ,@(cond ((or (c-major-mode-is 'c++-mode) (c-major-mode-is 'java-mode)) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
864 `((postfix-if-paren "<" ">"))) ; Templates. |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
865 ((c-major-mode-is 'pike-mode) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
866 `((prefix "global" "predef"))) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
867 ((c-major-mode-is 'java-mode) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
868 `((prefix "super")))) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
869 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
870 ;; Postfix. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
871 ,@(when (c-major-mode-is 'c++-mode) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
872 ;; The following need special treatment. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
873 `((prefix "dynamic_cast" "static_cast" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
874 "reinterpret_cast" "const_cast" "typeid"))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
875 (left-assoc "." |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
876 ,@(unless (c-major-mode-is 'java-mode) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
877 '("->"))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
878 (postfix "++" "--" "[" "]" "(" ")" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
879 ,@(when (c-major-mode-is '(c-mode c++-mode)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
880 '("<:" ":>" "??(" "??)"))) |
26817 | 881 |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
882 ;; Unary. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
883 (prefix "++" "--" "+" "-" "!" "~" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
884 ,@(when (c-major-mode-is 'c++-mode) '("not" "compl")) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
885 ,@(when (c-major-mode-is '(c-mode c++-mode)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
886 '("*" "&" "sizeof" "??-")) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
887 ,@(when (c-major-mode-is 'objc-mode) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
888 '("@selector" "@protocol" "@encode")) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
889 ;; The following need special treatment. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
890 ,@(cond ((c-major-mode-is 'c++-mode) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
891 '("new" "delete")) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
892 ((c-major-mode-is 'java-mode) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
893 '("new")) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
894 ((c-major-mode-is 'pike-mode) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
895 '("class" "lambda" "catch" "throw" "gauge"))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
896 "(" ")" ; Cast. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
897 ,@(when (c-major-mode-is 'pike-mode) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
898 '("[" "]"))) ; Type cast. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
899 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
900 ;; Member selection. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
901 ,@(when (c-major-mode-is 'c++-mode) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
902 `((left-assoc ".*" "->*"))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
903 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
904 ;; Multiplicative. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
905 (left-assoc "*" "/" "%") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
906 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
907 ;; Additive. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
908 (left-assoc "+" "-") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
909 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
910 ;; Shift. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
911 (left-assoc "<<" ">>" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
912 ,@(when (c-major-mode-is 'java-mode) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
913 '(">>>"))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
914 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
915 ;; Relational. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
916 (left-assoc "<" ">" "<=" ">=" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
917 ,@(when (c-major-mode-is 'java-mode) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
918 '("instanceof"))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
919 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
920 ;; Equality. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
921 (left-assoc "==" "!=" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
922 ,@(when (c-major-mode-is 'c++-mode) '("not_eq"))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
923 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
924 ;; Bitwise and. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
925 (left-assoc "&" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
926 ,@(when (c-major-mode-is 'c++-mode) '("bitand"))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
927 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
928 ;; Bitwise exclusive or. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
929 (left-assoc "^" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
930 ,@(when (c-major-mode-is '(c-mode c++-mode)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
931 '("??'")) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
932 ,@(when (c-major-mode-is 'c++-mode) '("xor"))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
933 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
934 ;; Bitwise or. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
935 (left-assoc "|" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
936 ,@(when (c-major-mode-is '(c-mode c++-mode)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
937 '("??!")) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
938 ,@(when (c-major-mode-is 'c++-mode) '("bitor"))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
939 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
940 ;; Logical and. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
941 (left-assoc "&&" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
942 ,@(when (c-major-mode-is 'c++-mode) '("and"))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
943 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
944 ;; Logical or. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
945 (left-assoc "||" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
946 ,@(when (c-major-mode-is '(c-mode c++-mode)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
947 '("??!??!")) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
948 ,@(when (c-major-mode-is 'c++-mode) '("or"))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
949 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
950 ;; Conditional. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
951 (right-assoc-sequence "?" ":") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
952 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
953 ;; Assignment. |
52341
6a060e586596
(c-lineup-math): Don't align the operators "!=", "<=" and ">=" as assignment
Martin Stjernholm <mast@lysator.liu.se>
parents:
51946
diff
changeset
|
954 (right-assoc ,@(c-lang-const c-assignment-operators)) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
955 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
956 ;; Exception. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
957 ,@(when (c-major-mode-is 'c++-mode) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
958 '((prefix "throw"))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
959 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
960 ;; Sequence. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
961 (left-assoc ",")) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
962 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
963 ;; IDL got its own definition since it has a much smaller operator |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
964 ;; set than the other languages. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
965 idl `(;; Preprocessor. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
966 (prefix "#") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
967 (left-assoc "##") |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
968 ;; Primary. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
969 ,@(c-lang-const c-identifier-ops) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
970 ;; Unary. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
971 (prefix "+" "-" "~") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
972 ;; Multiplicative. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
973 (left-assoc "*" "/" "%") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
974 ;; Additive. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
975 (left-assoc "+" "-") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
976 ;; Shift. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
977 (left-assoc "<<" ">>") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
978 ;; And. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
979 (left-assoc "&") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
980 ;; Xor. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
981 (left-assoc "^") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
982 ;; Or. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
983 (left-assoc "|"))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
984 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
985 (c-lang-defconst c-operator-list |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
986 ;; The operators as a flat list (without duplicates). |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
987 t (c-filter-ops (c-lang-const c-operators) t t)) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
988 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
989 (c-lang-defconst c-overloadable-operators |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
990 "List of the operators that are overloadable, in their \"identifier |
75027
9f636bd65206
Update CC Mode to version 5.31.4. The detailed changes are those
Alan Mackenzie <acm@muc.de>
parents:
74581
diff
changeset
|
991 form\". See also `c-op-identifier-prefix'." |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
992 t nil |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
993 c++ '("new" "delete" ;; Can be followed by "[]" but we ignore that. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
994 "+" "-" "*" "/" "%" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
995 "^" "??'" "xor" "&" "bitand" "|" "??!" "bitor" "~" "??-" "compl" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
996 "!" "=" "<" ">" "+=" "-=" "*=" "/=" "%=" "^=" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
997 "??'=" "xor_eq" "&=" "and_eq" "|=" "??!=" "or_eq" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
998 "<<" ">>" ">>=" "<<=" "==" "!=" "not_eq" "<=" ">=" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
999 "&&" "and" "||" "??!??!" "or" "++" "--" "," "->*" "->" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1000 "()" "[]" "<::>" "??(??)") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1001 ;; These work like identifiers in Pike. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1002 pike '("`+" "`-" "`&" "`|" "`^" "`<<" "`>>" "`*" "`/" "`%" "`~" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1003 "`==" "`<" "`>" "`!" "`[]" "`[]=" "`->" "`->=" "`()" "``+" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1004 "``-" "``&" "``|" "``^" "``<<" "``>>" "``*" "``/" "``%" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1005 "`+=")) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1006 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1007 (c-lang-defconst c-overloadable-operators-regexp |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1008 ;; Regexp tested after an "operator" token in C++. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1009 t nil |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1010 c++ (c-make-keywords-re nil (c-lang-const c-overloadable-operators))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1011 (c-lang-defvar c-overloadable-operators-regexp |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1012 (c-lang-const c-overloadable-operators-regexp)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1013 |
75027
9f636bd65206
Update CC Mode to version 5.31.4. The detailed changes are those
Alan Mackenzie <acm@muc.de>
parents:
74581
diff
changeset
|
1014 (c-lang-defconst c-opt-op-identifier-prefix |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1015 "Regexp matching the token before the ones in |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1016 `c-overloadable-operators' when operators are specified in their |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1017 \"identifier form\". This typically matches \"operator\" in C++ where |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1018 operator functions are specified as e.g. \"operator +\". It's nil in |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1019 languages without operator functions or where the complete operator |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1020 identifier is listed in `c-overloadable-operators'. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1021 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1022 This regexp is assumed to not match any non-operator identifier." |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1023 t nil |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1024 c++ (c-make-keywords-re t '("operator"))) |
75027
9f636bd65206
Update CC Mode to version 5.31.4. The detailed changes are those
Alan Mackenzie <acm@muc.de>
parents:
74581
diff
changeset
|
1025 (c-lang-defvar c-opt-op-identifier-prefix |
9f636bd65206
Update CC Mode to version 5.31.4. The detailed changes are those
Alan Mackenzie <acm@muc.de>
parents:
74581
diff
changeset
|
1026 (c-lang-const c-opt-op-identifier-prefix)) |
9f636bd65206
Update CC Mode to version 5.31.4. The detailed changes are those
Alan Mackenzie <acm@muc.de>
parents:
74581
diff
changeset
|
1027 |
9f636bd65206
Update CC Mode to version 5.31.4. The detailed changes are those
Alan Mackenzie <acm@muc.de>
parents:
74581
diff
changeset
|
1028 ;; Note: the following alias is an old name which was a mis-spelling. It has |
9f636bd65206
Update CC Mode to version 5.31.4. The detailed changes are those
Alan Mackenzie <acm@muc.de>
parents:
74581
diff
changeset
|
1029 ;; been corrected above and throughout cc-engine.el. It will be removed at |
9f636bd65206
Update CC Mode to version 5.31.4. The detailed changes are those
Alan Mackenzie <acm@muc.de>
parents:
74581
diff
changeset
|
1030 ;; some release very shortly in the future. ACM, 2006-04-14. |
97943
8c3cc772f767
(c-opt-op-identitier-prefix): Fix typo.
Glenn Morris <rgm@gnu.org>
parents:
94673
diff
changeset
|
1031 (defvaralias 'c-opt-op-identitier-prefix 'c-opt-op-identifier-prefix) |
75027
9f636bd65206
Update CC Mode to version 5.31.4. The detailed changes are those
Alan Mackenzie <acm@muc.de>
parents:
74581
diff
changeset
|
1032 (make-obsolete-variable 'c-opt-op-identitier-prefix 'c-opt-op-identifier-prefix |
9f636bd65206
Update CC Mode to version 5.31.4. The detailed changes are those
Alan Mackenzie <acm@muc.de>
parents:
74581
diff
changeset
|
1033 "CC Mode 5.31.4, 2006-04-14") |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1034 |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1035 (c-lang-defconst c-other-op-syntax-tokens |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1036 "List of the tokens made up of characters in the punctuation or |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1037 parenthesis syntax classes that have uses other than as expression |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1038 operators." |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1039 t '("{" "}" "(" ")" "[" "]" ";" ":" "," "=" "/*" "*/" "//") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1040 (c c++ pike) (append '("#" "##" ; Used by cpp. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1041 "::" "...") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1042 (c-lang-const c-other-op-syntax-tokens)) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1043 (c c++) (append '("*") (c-lang-const c-other-op-syntax-tokens)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1044 c++ (append '("&" "<%" "%>" "<:" ":>" "%:" "%:%:") |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1045 (c-lang-const c-other-op-syntax-tokens)) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1046 objc (append '("#" "##" ; Used by cpp. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1047 "+" "-") (c-lang-const c-other-op-syntax-tokens)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1048 idl (append '("#" "##") ; Used by cpp. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1049 (c-lang-const c-other-op-syntax-tokens)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1050 pike (append '("..") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1051 (c-lang-const c-other-op-syntax-tokens) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1052 (c-lang-const c-overloadable-operators)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1053 awk '("{" "}" "(" ")" "[" "]" ";" "," "=" "/")) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1054 |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1055 (c-lang-defconst c-all-op-syntax-tokens |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1056 ;; List of all tokens in the punctuation and parenthesis syntax |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1057 ;; classes. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1058 t (delete-duplicates (append (c-lang-const c-other-op-syntax-tokens) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1059 (c-lang-const c-operator-list)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1060 :test 'string-equal)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1061 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1062 (c-lang-defconst c-nonsymbol-token-char-list |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1063 ;; List containing all chars not in the word, symbol or |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1064 ;; syntactically irrelevant syntax classes, i.e. all punctuation, |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1065 ;; parenthesis and string delimiter chars. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1066 t (c-with-syntax-table (c-lang-const c-mode-syntax-table) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1067 ;; Only go through the chars in the printable ASCII range. No |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1068 ;; language so far has 8-bit or widestring operators. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1069 (let (list (char 32)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1070 (while (< char 127) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1071 (or (memq (char-syntax char) '(?w ?_ ?< ?> ?\ )) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1072 (setq list (cons (c-int-to-char char) list))) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1073 (setq char (1+ char))) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1074 list))) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1075 |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1076 (c-lang-defconst c-nonsymbol-token-regexp |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1077 ;; Regexp matching all tokens in the punctuation and parenthesis |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1078 ;; syntax classes. Note that this also matches ".", which can start |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1079 ;; a float. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1080 t (c-make-keywords-re nil |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1081 (c-filter-ops (c-lang-const c-all-op-syntax-tokens) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1082 t |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1083 "\\`\\(\\s.\\|\\s\(\\|\\s\)\\)+\\'"))) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1084 (c-lang-defvar c-nonsymbol-token-regexp |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1085 (c-lang-const c-nonsymbol-token-regexp)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1086 |
52341
6a060e586596
(c-lineup-math): Don't align the operators "!=", "<=" and ">=" as assignment
Martin Stjernholm <mast@lysator.liu.se>
parents:
51946
diff
changeset
|
1087 (c-lang-defconst c-assignment-op-regexp |
6a060e586596
(c-lineup-math): Don't align the operators "!=", "<=" and ">=" as assignment
Martin Stjernholm <mast@lysator.liu.se>
parents:
51946
diff
changeset
|
1088 ;; Regexp matching all assignment operators and only them. The |
6a060e586596
(c-lineup-math): Don't align the operators "!=", "<=" and ">=" as assignment
Martin Stjernholm <mast@lysator.liu.se>
parents:
51946
diff
changeset
|
1089 ;; beginning of the first submatch is used to detect the end of the |
6a060e586596
(c-lineup-math): Don't align the operators "!=", "<=" and ">=" as assignment
Martin Stjernholm <mast@lysator.liu.se>
parents:
51946
diff
changeset
|
1090 ;; token, along with the end of the whole match. |
6a060e586596
(c-lineup-math): Don't align the operators "!=", "<=" and ">=" as assignment
Martin Stjernholm <mast@lysator.liu.se>
parents:
51946
diff
changeset
|
1091 t (if (c-lang-const c-assignment-operators) |
6a060e586596
(c-lineup-math): Don't align the operators "!=", "<=" and ">=" as assignment
Martin Stjernholm <mast@lysator.liu.se>
parents:
51946
diff
changeset
|
1092 (concat |
6a060e586596
(c-lineup-math): Don't align the operators "!=", "<=" and ">=" as assignment
Martin Stjernholm <mast@lysator.liu.se>
parents:
51946
diff
changeset
|
1093 ;; Need special case for "=" since it's a prefix of "==". |
6a060e586596
(c-lineup-math): Don't align the operators "!=", "<=" and ">=" as assignment
Martin Stjernholm <mast@lysator.liu.se>
parents:
51946
diff
changeset
|
1094 "=\\([^=]\\|$\\)" |
6a060e586596
(c-lineup-math): Don't align the operators "!=", "<=" and ">=" as assignment
Martin Stjernholm <mast@lysator.liu.se>
parents:
51946
diff
changeset
|
1095 "\\|" |
6a060e586596
(c-lineup-math): Don't align the operators "!=", "<=" and ">=" as assignment
Martin Stjernholm <mast@lysator.liu.se>
parents:
51946
diff
changeset
|
1096 (c-make-keywords-re nil |
6a060e586596
(c-lineup-math): Don't align the operators "!=", "<=" and ">=" as assignment
Martin Stjernholm <mast@lysator.liu.se>
parents:
51946
diff
changeset
|
1097 (set-difference (c-lang-const c-assignment-operators) |
6a060e586596
(c-lineup-math): Don't align the operators "!=", "<=" and ">=" as assignment
Martin Stjernholm <mast@lysator.liu.se>
parents:
51946
diff
changeset
|
1098 '("=") |
6a060e586596
(c-lineup-math): Don't align the operators "!=", "<=" and ">=" as assignment
Martin Stjernholm <mast@lysator.liu.se>
parents:
51946
diff
changeset
|
1099 :test 'string-equal))) |
6a060e586596
(c-lineup-math): Don't align the operators "!=", "<=" and ">=" as assignment
Martin Stjernholm <mast@lysator.liu.se>
parents:
51946
diff
changeset
|
1100 "\\<\\>")) |
6a060e586596
(c-lineup-math): Don't align the operators "!=", "<=" and ">=" as assignment
Martin Stjernholm <mast@lysator.liu.se>
parents:
51946
diff
changeset
|
1101 (c-lang-defvar c-assignment-op-regexp |
6a060e586596
(c-lineup-math): Don't align the operators "!=", "<=" and ">=" as assignment
Martin Stjernholm <mast@lysator.liu.se>
parents:
51946
diff
changeset
|
1102 (c-lang-const c-assignment-op-regexp)) |
6a060e586596
(c-lineup-math): Don't align the operators "!=", "<=" and ">=" as assignment
Martin Stjernholm <mast@lysator.liu.se>
parents:
51946
diff
changeset
|
1103 |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1104 (c-lang-defconst c-<>-multichar-token-regexp |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1105 ;; Regexp matching all tokens containing "<" or ">" which are longer |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1106 ;; than one char. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1107 t (c-make-keywords-re nil |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1108 (c-filter-ops (c-lang-const c-all-op-syntax-tokens) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1109 t |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1110 ".[<>]\\|[<>]."))) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1111 (c-lang-defvar c-<>-multichar-token-regexp |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1112 (c-lang-const c-<>-multichar-token-regexp)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1113 |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1114 (c-lang-defconst c-<-op-cont-regexp |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1115 ;; Regexp matching the second and subsequent characters of all |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1116 ;; multicharacter tokens that begin with "<". |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1117 t (c-make-keywords-re nil |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1118 (c-filter-ops (c-lang-const c-all-op-syntax-tokens) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1119 t |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1120 "\\`<." |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1121 (lambda (op) (substring op 1))))) |
109599
c18dffa2ba46
Enhance Java Mode to handle Java 5.0 (Tiger) and Java 6 (Mustang).
Alan Mackenzie <acm@muc.de>
parents:
107086
diff
changeset
|
1122 |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1123 (c-lang-defvar c-<-op-cont-regexp (c-lang-const c-<-op-cont-regexp)) |
18720 | 1124 |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1125 (c-lang-defconst c->-op-cont-regexp |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1126 ;; Regexp matching the second and subsequent characters of all |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1127 ;; multicharacter tokens that begin with ">". |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1128 t (c-make-keywords-re nil |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1129 (c-filter-ops (c-lang-const c-all-op-syntax-tokens) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1130 t |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1131 "\\`>." |
109599
c18dffa2ba46
Enhance Java Mode to handle Java 5.0 (Tiger) and Java 6 (Mustang).
Alan Mackenzie <acm@muc.de>
parents:
107086
diff
changeset
|
1132 (lambda (op) (substring op 1)))) |
c18dffa2ba46
Enhance Java Mode to handle Java 5.0 (Tiger) and Java 6 (Mustang).
Alan Mackenzie <acm@muc.de>
parents:
107086
diff
changeset
|
1133 java (c-make-keywords-re nil |
c18dffa2ba46
Enhance Java Mode to handle Java 5.0 (Tiger) and Java 6 (Mustang).
Alan Mackenzie <acm@muc.de>
parents:
107086
diff
changeset
|
1134 (c-filter-ops (c-lang-const c-all-op-syntax-tokens) |
c18dffa2ba46
Enhance Java Mode to handle Java 5.0 (Tiger) and Java 6 (Mustang).
Alan Mackenzie <acm@muc.de>
parents:
107086
diff
changeset
|
1135 t |
c18dffa2ba46
Enhance Java Mode to handle Java 5.0 (Tiger) and Java 6 (Mustang).
Alan Mackenzie <acm@muc.de>
parents:
107086
diff
changeset
|
1136 "\\`>[^>]\\|\\`>>[^>]" |
c18dffa2ba46
Enhance Java Mode to handle Java 5.0 (Tiger) and Java 6 (Mustang).
Alan Mackenzie <acm@muc.de>
parents:
107086
diff
changeset
|
1137 (lambda (op) (substring op 1))))) |
c18dffa2ba46
Enhance Java Mode to handle Java 5.0 (Tiger) and Java 6 (Mustang).
Alan Mackenzie <acm@muc.de>
parents:
107086
diff
changeset
|
1138 |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1139 (c-lang-defvar c->-op-cont-regexp (c-lang-const c->-op-cont-regexp)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1140 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1141 (c-lang-defconst c-stmt-delim-chars |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1142 ;; The characters that should be considered to bound statements. To |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1143 ;; optimize `c-crosses-statement-barrier-p' somewhat, it's assumed to |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1144 ;; begin with "^" to negate the set. If ? : operators should be |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1145 ;; detected then the string must end with "?:". |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1146 t "^;{}?:" |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1147 awk "^;{}#\n\r?:") ; The newline chars gets special treatment. |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1148 (c-lang-defvar c-stmt-delim-chars (c-lang-const c-stmt-delim-chars)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1149 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1150 (c-lang-defconst c-stmt-delim-chars-with-comma |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1151 ;; Variant of `c-stmt-delim-chars' that additionally contains ','. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1152 t "^;,{}?:" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1153 awk "^;,{}\n\r?:") ; The newline chars gets special treatment. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1154 (c-lang-defvar c-stmt-delim-chars-with-comma |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1155 (c-lang-const c-stmt-delim-chars-with-comma)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1156 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1157 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1158 ;;; Syntactic whitespace. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1159 |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1160 (c-lang-defconst c-simple-ws |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1161 "Regexp matching an ordinary whitespace character. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1162 Does not contain a \\| operator at the top level." |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1163 ;; "\\s " is not enough since it doesn't match line breaks. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1164 t "\\(\\s \\|[\n\r]\\)") |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1165 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1166 (c-lang-defconst c-simple-ws-depth |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1167 ;; Number of regexp grouping parens in `c-simple-ws'. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1168 t (regexp-opt-depth (c-lang-const c-simple-ws))) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1169 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1170 (c-lang-defconst c-line-comment-starter |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1171 "String that starts line comments, or nil if such don't exist. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1172 Line comments are always terminated by newlines. At least one of |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1173 `c-block-comment-starter' and this one is assumed to be set. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1174 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1175 Note that it's currently not enough to set this to support a new |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1176 comment style. Other stuff like the syntax table must also be set up |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1177 properly." |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1178 t "//" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1179 awk "#") |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1180 (c-lang-defvar c-line-comment-starter (c-lang-const c-line-comment-starter)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1181 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1182 (c-lang-defconst c-block-comment-starter |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1183 "String that starts block comments, or nil if such don't exist. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1184 Block comments are ended by `c-block-comment-ender', which is assumed |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1185 to be set if this is. At least one of `c-line-comment-starter' and |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1186 this one is assumed to be set. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1187 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1188 Note that it's currently not enough to set this to support a new |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1189 comment style. Other stuff like the syntax table must also be set up |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1190 properly." |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1191 t "/*" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1192 awk nil) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1193 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1194 (c-lang-defconst c-block-comment-ender |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1195 "String that ends block comments, or nil if such don't exist. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1196 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1197 Note that it's currently not enough to set this to support a new |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1198 comment style. Other stuff like the syntax table must also be set up |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1199 properly." |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1200 t "*/" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1201 awk nil) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1202 |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1203 (c-lang-defconst c-comment-start-regexp |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1204 ;; Regexp to match the start of any type of comment. |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1205 t (let ((re (c-make-keywords-re nil |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1206 (list (c-lang-const c-line-comment-starter) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1207 (c-lang-const c-block-comment-starter))))) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1208 (if (memq 'gen-comment-delim c-emacs-features) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1209 (concat re "\\|\\s!") |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1210 re))) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1211 (c-lang-defvar c-comment-start-regexp (c-lang-const c-comment-start-regexp)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1212 |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1213 ;;;; Added by ACM, 2003/9/18. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1214 (c-lang-defconst c-block-comment-start-regexp |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1215 ;; Regexp which matches the start of a block comment (if such exists in the |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1216 ;; language) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1217 t (if (c-lang-const c-block-comment-starter) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1218 (regexp-quote (c-lang-const c-block-comment-starter)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1219 "\\<\\>")) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1220 (c-lang-defvar c-block-comment-start-regexp |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1221 (c-lang-const c-block-comment-start-regexp)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1222 |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1223 (c-lang-defconst c-literal-start-regexp |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1224 ;; Regexp to match the start of comments and string literals. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1225 t (concat (c-lang-const c-comment-start-regexp) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1226 "\\|" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1227 (if (memq 'gen-string-delim c-emacs-features) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1228 "\"|" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1229 "\""))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1230 (c-lang-defvar c-literal-start-regexp (c-lang-const c-literal-start-regexp)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1231 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1232 (c-lang-defconst c-doc-comment-start-regexp |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1233 "Regexp to match the start of documentation comments." |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1234 t "\\<\\>" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1235 ;; From font-lock.el: `doxygen' uses /*! while others use /**. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1236 (c c++ objc) "/\\*[*!]" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1237 java "/\\*\\*" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1238 pike "/[/*]!") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1239 (c-lang-defvar c-doc-comment-start-regexp |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1240 (c-lang-const c-doc-comment-start-regexp)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1241 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1242 (c-lang-defconst comment-start |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1243 "String that starts comments inserted with M-; etc. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1244 `comment-start' is initialized from this." |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1245 ;; Default: Prefer line comments to block comments, and pad with a space. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1246 t (concat (or (c-lang-const c-line-comment-starter) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1247 (c-lang-const c-block-comment-starter)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1248 " ") |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1249 ;; In C we still default to the block comment style since line |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1250 ;; comments aren't entirely portable. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1251 c "/* ") |
72031
2b53c13e6121
* progmodes/cc-langs.el (c-emacs-variable-inits): new variable.
Alan Mackenzie <acm@muc.de>
parents:
71754
diff
changeset
|
1252 (c-lang-setvar comment-start (c-lang-const comment-start)) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1253 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1254 (c-lang-defconst comment-end |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1255 "String that ends comments inserted with M-; etc. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1256 `comment-end' is initialized from this." |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1257 ;; Default: Use block comment style if comment-start uses block |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1258 ;; comments, and pad with a space in that case. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1259 t (if (string-match (concat "\\`\\(" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1260 (c-lang-const c-block-comment-start-regexp) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1261 "\\)") |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1262 (c-lang-const comment-start)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1263 (concat " " (c-lang-const c-block-comment-ender)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1264 "")) |
72031
2b53c13e6121
* progmodes/cc-langs.el (c-emacs-variable-inits): new variable.
Alan Mackenzie <acm@muc.de>
parents:
71754
diff
changeset
|
1265 (c-lang-setvar comment-end (c-lang-const comment-end)) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1266 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1267 (c-lang-defconst comment-start-skip |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1268 "Regexp to match the start of a comment plus everything up to its body. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1269 `comment-start-skip' is initialized from this." |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1270 ;; Default: Allow the last char of the comment starter(s) to be |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1271 ;; repeated, then allow any amount of horizontal whitespace. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1272 t (concat "\\(" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1273 (c-concat-separated |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1274 (mapcar (lambda (cs) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1275 (when cs |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1276 (concat (regexp-quote cs) "+"))) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1277 (list (c-lang-const c-line-comment-starter) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1278 (c-lang-const c-block-comment-starter))) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1279 "\\|") |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1280 "\\)\\s *")) |
72031
2b53c13e6121
* progmodes/cc-langs.el (c-emacs-variable-inits): new variable.
Alan Mackenzie <acm@muc.de>
parents:
71754
diff
changeset
|
1281 (c-lang-setvar comment-start-skip (c-lang-const comment-start-skip)) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1282 |
51946
048b0517e63d
(c++-make-template-syntax-table, c-syntactic-ws-start, c-syntactic-ws-end):
Martin Stjernholm <mast@lysator.liu.se>
parents:
51748
diff
changeset
|
1283 (c-lang-defconst c-syntactic-ws-start |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1284 ;; Regexp matching any sequence that can start syntactic whitespace. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1285 ;; The only uncertain case is '#' when there are cpp directives. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1286 t (concat "\\s \\|" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1287 (c-make-keywords-re nil |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1288 (append (list (c-lang-const c-line-comment-starter) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1289 (c-lang-const c-block-comment-starter) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1290 (when (c-lang-const c-opt-cpp-prefix) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1291 "#")) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1292 '("\n" "\r"))) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1293 "\\|\\\\[\n\r]" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1294 (when (memq 'gen-comment-delim c-emacs-features) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1295 "\\|\\s!"))) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1296 (c-lang-defvar c-syntactic-ws-start (c-lang-const c-syntactic-ws-start)) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1297 |
51946
048b0517e63d
(c++-make-template-syntax-table, c-syntactic-ws-start, c-syntactic-ws-end):
Martin Stjernholm <mast@lysator.liu.se>
parents:
51748
diff
changeset
|
1298 (c-lang-defconst c-syntactic-ws-end |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1299 ;; Regexp matching any single character that might end syntactic whitespace. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1300 t (concat "\\s \\|" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1301 (c-make-keywords-re nil |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1302 (append (when (c-lang-const c-block-comment-ender) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1303 (list |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1304 (string |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1305 (elt (c-lang-const c-block-comment-ender) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1306 (1- (length |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1307 (c-lang-const c-block-comment-ender))))))) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1308 '("\n" "\r"))) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1309 (when (memq 'gen-comment-delim c-emacs-features) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1310 "\\|\\s!"))) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1311 (c-lang-defvar c-syntactic-ws-end (c-lang-const c-syntactic-ws-end)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1312 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1313 (c-lang-defconst c-unterminated-block-comment-regexp |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1314 ;; Regexp matching an unterminated block comment that doesn't |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1315 ;; contain line breaks, or nil in languages without block comments. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1316 ;; Does not contain a \| operator at the top level. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1317 t (when (c-lang-const c-block-comment-starter) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1318 (concat |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1319 (regexp-quote (c-lang-const c-block-comment-starter)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1320 ;; It's messy to cook together a regexp that matches anything |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1321 ;; but c-block-comment-ender. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1322 (let ((end (c-lang-const c-block-comment-ender))) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1323 (cond ((= (length end) 1) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1324 (concat "[^" end "\n\r]*")) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1325 ((= (length end) 2) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1326 (concat "[^" (substring end 0 1) "\n\r]*" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1327 "\\(" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1328 (regexp-quote (substring end 0 1)) "+" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1329 "[^" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1330 ;; The quoting rules inside char classes are silly. :P |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1331 (cond ((= (elt end 0) (elt end 1)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1332 (concat (substring end 0 1) "\n\r")) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1333 ((= (elt end 1) ?\]) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1334 (concat (substring end 1 2) "\n\r" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1335 (substring end 0 1))) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1336 (t |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1337 (concat (substring end 0 1) "\n\r" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1338 (substring end 1 2)))) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1339 "]" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1340 "[^" (substring end 0 1) "\n\r]*" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1341 "\\)*")) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1342 (t |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1343 (error "Can't handle a block comment ender of length %s" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1344 (length end)))))))) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1345 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1346 (c-lang-defconst c-block-comment-regexp |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1347 ;; Regexp matching a block comment that doesn't contain line breaks, |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1348 ;; or nil in languages without block comments. The reason we don't |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1349 ;; allow line breaks is to avoid going very far and risk running out |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1350 ;; of regexp stack; this regexp is intended to handle only short |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1351 ;; comments that might be put in the middle of limited constructs |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1352 ;; like declarations. Does not contain a \| operator at the top |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1353 ;; level. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1354 t (when (c-lang-const c-unterminated-block-comment-regexp) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1355 (concat |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1356 (c-lang-const c-unterminated-block-comment-regexp) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1357 (let ((end (c-lang-const c-block-comment-ender))) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1358 (cond ((= (length end) 1) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1359 (regexp-quote end)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1360 ((= (length end) 2) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1361 (concat (regexp-quote (substring end 0 1)) "+" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1362 (regexp-quote (substring end 1 2)))) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1363 (t |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1364 (error "Can't handle a block comment ender of length %s" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1365 (length end)))))))) |
18720 | 1366 |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1367 (c-lang-defconst c-nonwhite-syntactic-ws |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1368 ;; Regexp matching a piece of syntactic whitespace that isn't a |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1369 ;; sequence of simple whitespace characters. As opposed to |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1370 ;; `c-(forward|backward)-syntactic-ws', this doesn't regard cpp |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1371 ;; directives as syntactic whitespace. |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1372 t (c-concat-separated |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1373 (list (when (c-lang-const c-line-comment-starter) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1374 (concat (regexp-quote (c-lang-const c-line-comment-starter)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1375 "[^\n\r]*[\n\r]")) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1376 (c-lang-const c-block-comment-regexp) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1377 "\\\\[\n\r]" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1378 (when (memq 'gen-comment-delim c-emacs-features) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1379 "\\s!\\S!*\\s!")) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1380 "\\|")) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1381 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1382 (c-lang-defconst c-syntactic-ws |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1383 ;; Regexp matching syntactic whitespace, including possibly the |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1384 ;; empty string. As opposed to `c-(forward|backward)-syntactic-ws', |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1385 ;; this doesn't regard cpp directives as syntactic whitespace. Does |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1386 ;; not contain a \| operator at the top level. |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1387 t (concat (c-lang-const c-simple-ws) "*" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1388 "\\(" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1389 (concat "\\(" (c-lang-const c-nonwhite-syntactic-ws) "\\)" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1390 (c-lang-const c-simple-ws) "*") |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1391 "\\)*")) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1392 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1393 (c-lang-defconst c-syntactic-ws-depth |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1394 ;; Number of regexp grouping parens in `c-syntactic-ws'. |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1395 t (regexp-opt-depth (c-lang-const c-syntactic-ws))) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1396 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1397 (c-lang-defconst c-nonempty-syntactic-ws |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1398 ;; Regexp matching syntactic whitespace, which is at least one |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1399 ;; character long. As opposed to `c-(forward|backward)-syntactic-ws', |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1400 ;; this doesn't regard cpp directives as syntactic whitespace. Does |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1401 ;; not contain a \| operator at the top level. |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1402 t (concat "\\(" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1403 (c-lang-const c-simple-ws) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1404 "\\|" |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1405 (c-lang-const c-nonwhite-syntactic-ws) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1406 "\\)+")) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1407 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1408 (c-lang-defconst c-nonempty-syntactic-ws-depth |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1409 ;; Number of regexp grouping parens in `c-nonempty-syntactic-ws'. |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1410 t (regexp-opt-depth (c-lang-const c-nonempty-syntactic-ws))) |
19250 | 1411 |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1412 (c-lang-defconst c-single-line-syntactic-ws |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1413 ;; Regexp matching syntactic whitespace without any line breaks. As |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1414 ;; opposed to `c-(forward|backward)-syntactic-ws', this doesn't |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1415 ;; regard cpp directives as syntactic whitespace. Does not contain |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1416 ;; a \| operator at the top level. |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1417 t (if (c-lang-const c-block-comment-regexp) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1418 (concat "\\s *\\(" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1419 (c-lang-const c-block-comment-regexp) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1420 "\\s *\\)*") |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1421 "\\s *")) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1422 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1423 (c-lang-defconst c-single-line-syntactic-ws-depth |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1424 ;; Number of regexp grouping parens in `c-single-line-syntactic-ws'. |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1425 t (regexp-opt-depth (c-lang-const c-single-line-syntactic-ws))) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1426 |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1427 (c-lang-defconst c-syntactic-eol |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1428 ;; Regexp that matches when there is no syntactically significant |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1429 ;; text before eol. Macros are regarded as syntactically |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1430 ;; significant text here. |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1431 t (concat (c-lang-const c-single-line-syntactic-ws) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1432 ;; Match eol (possibly inside a block comment or preceded |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1433 ;; by a line continuation backslash), or the beginning of a |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1434 ;; line comment. Note: This has to be modified for awk |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1435 ;; where line comments start with '#'. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1436 "\\(" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1437 (c-concat-separated |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1438 (list (when (c-lang-const c-line-comment-starter) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1439 (regexp-quote (c-lang-const c-line-comment-starter))) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1440 (when (c-lang-const c-unterminated-block-comment-regexp) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1441 (concat (c-lang-const c-unterminated-block-comment-regexp) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1442 "$")) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1443 "\\\\$" |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1444 "$") |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1445 "\\|") |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1446 "\\)")) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1447 (c-lang-defvar c-syntactic-eol (c-lang-const c-syntactic-eol)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1448 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1449 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1450 ;;; Syntactic analysis ("virtual semicolons") for line-oriented languages (AWK). |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1451 (c-lang-defconst c-at-vsemi-p-fn |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1452 "Contains a function \"Is there a virtual semicolon at POS or point?\". |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1453 Such a function takes one optional parameter, a buffer position (defaults to |
74581
a25d780605e7
(c-at-vsemi-p-fn, c-vsemi-status-unknown-p-fn): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents:
74372
diff
changeset
|
1454 point), and returns nil or t. This variable contains nil for languages which |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1455 don't have EOL terminated statements. " |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1456 t nil |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1457 awk 'c-awk-at-vsemi-p) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1458 (c-lang-defvar c-at-vsemi-p-fn (c-lang-const c-at-vsemi-p-fn)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1459 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1460 (c-lang-defconst c-vsemi-status-unknown-p-fn |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1461 "Contains a function \"are we unsure whether there is a virtual semicolon on this line?\". |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1462 The (admittedly kludgey) purpose of such a function is to prevent an infinite |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1463 recursion in c-beginning-of-statement-1 when point starts at a `while' token. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1464 The function MUST NOT UNDER ANY CIRCUMSTANCES call c-beginning-of-statement-1, |
74581
a25d780605e7
(c-at-vsemi-p-fn, c-vsemi-status-unknown-p-fn): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents:
74372
diff
changeset
|
1465 even indirectly. This variable contains nil for languages which don't have |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1466 EOL terminated statements." |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1467 t nil |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1468 awk 'c-awk-vsemi-status-unknown-p) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1469 (c-lang-defvar c-vsemi-status-unknown-p-fn |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1470 (c-lang-const c-vsemi-status-unknown-p-fn)) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1471 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1472 |
77081
e8bd3e011b64
Changes to make `narrow-to-defun' and `mark-defun' work properly in CC
Alan Mackenzie <acm@muc.de>
parents:
75347
diff
changeset
|
1473 ;;; Defun functions |
e8bd3e011b64
Changes to make `narrow-to-defun' and `mark-defun' work properly in CC
Alan Mackenzie <acm@muc.de>
parents:
75347
diff
changeset
|
1474 |
e8bd3e011b64
Changes to make `narrow-to-defun' and `mark-defun' work properly in CC
Alan Mackenzie <acm@muc.de>
parents:
75347
diff
changeset
|
1475 ;; The Emacs variables beginning-of-defun-function and |
e8bd3e011b64
Changes to make `narrow-to-defun' and `mark-defun' work properly in CC
Alan Mackenzie <acm@muc.de>
parents:
75347
diff
changeset
|
1476 ;; end-of-defun-function will be set so that commands like |
e8bd3e011b64
Changes to make `narrow-to-defun' and `mark-defun' work properly in CC
Alan Mackenzie <acm@muc.de>
parents:
75347
diff
changeset
|
1477 ;; `mark-defun' and `narrow-to-defun' work right. The key sequences |
e8bd3e011b64
Changes to make `narrow-to-defun' and `mark-defun' work properly in CC
Alan Mackenzie <acm@muc.de>
parents:
75347
diff
changeset
|
1478 ;; C-M-a and C-M-e are, however, bound directly to the CC Mode |
e8bd3e011b64
Changes to make `narrow-to-defun' and `mark-defun' work properly in CC
Alan Mackenzie <acm@muc.de>
parents:
75347
diff
changeset
|
1479 ;; functions, allowing optimisation for large n. |
e8bd3e011b64
Changes to make `narrow-to-defun' and `mark-defun' work properly in CC
Alan Mackenzie <acm@muc.de>
parents:
75347
diff
changeset
|
1480 (c-lang-defconst beginning-of-defun-function |
e8bd3e011b64
Changes to make `narrow-to-defun' and `mark-defun' work properly in CC
Alan Mackenzie <acm@muc.de>
parents:
75347
diff
changeset
|
1481 "Function to which beginning-of-defun-function will be set." |
e8bd3e011b64
Changes to make `narrow-to-defun' and `mark-defun' work properly in CC
Alan Mackenzie <acm@muc.de>
parents:
75347
diff
changeset
|
1482 t 'c-beginning-of-defun |
e8bd3e011b64
Changes to make `narrow-to-defun' and `mark-defun' work properly in CC
Alan Mackenzie <acm@muc.de>
parents:
75347
diff
changeset
|
1483 awk 'c-awk-beginning-of-defun) |
e8bd3e011b64
Changes to make `narrow-to-defun' and `mark-defun' work properly in CC
Alan Mackenzie <acm@muc.de>
parents:
75347
diff
changeset
|
1484 (c-lang-setvar beginning-of-defun-function |
e8bd3e011b64
Changes to make `narrow-to-defun' and `mark-defun' work properly in CC
Alan Mackenzie <acm@muc.de>
parents:
75347
diff
changeset
|
1485 (c-lang-const beginning-of-defun-function)) |
e8bd3e011b64
Changes to make `narrow-to-defun' and `mark-defun' work properly in CC
Alan Mackenzie <acm@muc.de>
parents:
75347
diff
changeset
|
1486 |
e8bd3e011b64
Changes to make `narrow-to-defun' and `mark-defun' work properly in CC
Alan Mackenzie <acm@muc.de>
parents:
75347
diff
changeset
|
1487 (c-lang-defconst end-of-defun-function |
e8bd3e011b64
Changes to make `narrow-to-defun' and `mark-defun' work properly in CC
Alan Mackenzie <acm@muc.de>
parents:
75347
diff
changeset
|
1488 "Function to which end-of-defun-function will be set." |
e8bd3e011b64
Changes to make `narrow-to-defun' and `mark-defun' work properly in CC
Alan Mackenzie <acm@muc.de>
parents:
75347
diff
changeset
|
1489 t 'c-end-of-defun |
e8bd3e011b64
Changes to make `narrow-to-defun' and `mark-defun' work properly in CC
Alan Mackenzie <acm@muc.de>
parents:
75347
diff
changeset
|
1490 awk 'c-awk-end-of-defun) |
e8bd3e011b64
Changes to make `narrow-to-defun' and `mark-defun' work properly in CC
Alan Mackenzie <acm@muc.de>
parents:
75347
diff
changeset
|
1491 (c-lang-setvar end-of-defun-function (c-lang-const end-of-defun-function)) |
e8bd3e011b64
Changes to make `narrow-to-defun' and `mark-defun' work properly in CC
Alan Mackenzie <acm@muc.de>
parents:
75347
diff
changeset
|
1492 |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1493 ;;; In-comment text handling. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1494 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1495 (c-lang-defconst c-paragraph-start |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1496 "Regexp to append to `paragraph-start'." |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1497 t "$" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1498 java "\\(@[a-zA-Z]+\\>\\|$\\)" ; For Javadoc. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1499 pike "\\(@[a-zA-Z_-]+\\>\\([^{]\\|$\\)\\|$\\)") ; For Pike refdoc. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1500 (c-lang-defvar c-paragraph-start (c-lang-const c-paragraph-start)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1501 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1502 (c-lang-defconst c-paragraph-separate |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1503 "Regexp to append to `paragraph-separate'." |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1504 t "$" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1505 pike (c-lang-const c-paragraph-start)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1506 (c-lang-defvar c-paragraph-separate (c-lang-const c-paragraph-separate)) |
24282 | 1507 |
36920 | 1508 |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1509 ;;; Keyword lists. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1510 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1511 ;; Note: All and only all language constants containing keyword lists |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1512 ;; should end with "-kwds"; they're automatically collected into the |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1513 ;; `c-kwds-lang-consts' list below and used to build `c-keywords' etc. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1514 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1515 (c-lang-defconst c-primitive-type-kwds |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1516 "Primitive type keywords. As opposed to the other keyword lists, the |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1517 keywords listed here are fontified with the type face instead of the |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1518 keyword face. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1519 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1520 If any of these also are on `c-type-list-kwds', `c-ref-list-kwds', |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1521 `c-colon-type-list-kwds', `c-paren-nontype-kwds', `c-paren-type-kwds', |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1522 `c-<>-type-kwds', or `c-<>-arglist-kwds' then the associated clauses |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1523 will be handled. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1524 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1525 Do not try to modify this list for end user customizations; the |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1526 `*-font-lock-extra-types' variable, where `*' is the mode prefix, is |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1527 the appropriate place for that." |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1528 t '("char" "double" "float" "int" "long" "short" "signed" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1529 "unsigned" "void") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1530 c (append |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1531 '("_Bool" "_Complex" "_Imaginary") ; Conditionally defined in C99. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1532 (c-lang-const c-primitive-type-kwds)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1533 c++ (append |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1534 '("bool" "wchar_t") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1535 (c-lang-const c-primitive-type-kwds)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1536 ;; Objective-C extends C, but probably not the new stuff in C99. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1537 objc (append |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1538 '("id" "Class" "SEL" "IMP" "BOOL") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1539 (c-lang-const c-primitive-type-kwds)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1540 java '("boolean" "byte" "char" "double" "float" "int" "long" "short" "void") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1541 idl '("Object" "ValueBase" "any" "boolean" "char" "double" "fixed" "float" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1542 "long" "octet" "sequence" "short" "string" "void" "wchar" "wstring" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1543 ;; In CORBA PSDL: |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1544 "ref" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1545 ;; The following can't really end a type, but we have to specify them |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1546 ;; here due to the assumption in `c-primitive-type-prefix-kwds'. It |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1547 ;; doesn't matter that much. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1548 "unsigned" "strong") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1549 pike '(;; this_program isn't really a keyword, but it's practically |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1550 ;; used as a builtin type. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1551 "array" "float" "function" "int" "mapping" "mixed" "multiset" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1552 "object" "program" "string" "this_program" "void")) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1553 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1554 (c-lang-defconst c-primitive-type-key |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1555 ;; An adorned regexp that matches `c-primitive-type-kwds'. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1556 t (c-make-keywords-re t (c-lang-const c-primitive-type-kwds))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1557 (c-lang-defvar c-primitive-type-key (c-lang-const c-primitive-type-key)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1558 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1559 (c-lang-defconst c-primitive-type-prefix-kwds |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1560 "Keywords that might act as prefixes for primitive types. Assumed to |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1561 be a subset of `c-primitive-type-kwds'." |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1562 t nil |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1563 (c c++) '("long" "short" "signed" "unsigned") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1564 idl '("long" "unsigned" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1565 ;; In CORBA PSDL: |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1566 "strong")) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1567 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1568 (c-lang-defconst c-type-prefix-kwds |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1569 "Keywords where the following name - if any - is a type name, and |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1570 where the keyword together with the symbol works as a type in |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1571 declarations. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1572 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1573 Note that an alternative if the second part doesn't hold is |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1574 `c-type-list-kwds'. Keywords on this list are typically also present |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1575 on one of the `*-decl-kwds' lists." |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1576 t nil |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1577 c '("struct" "union" "enum") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1578 c++ (append '("class" "typename") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1579 (c-lang-const c-type-prefix-kwds c))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1580 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1581 (c-lang-defconst c-type-prefix-key |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1582 ;; Adorned regexp matching `c-type-prefix-kwds'. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1583 t (c-make-keywords-re t (c-lang-const c-type-prefix-kwds))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1584 (c-lang-defvar c-type-prefix-key (c-lang-const c-type-prefix-key)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1585 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1586 (c-lang-defconst c-type-modifier-kwds |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1587 "Type modifier keywords. These can occur almost anywhere in types |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1588 but they don't build a type of themselves. Unlike the keywords on |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1589 `c-primitive-type-kwds', they are fontified with the keyword face and |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1590 not the type face." |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1591 t nil |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1592 c '("const" "restrict" "volatile") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1593 c++ '("const" "volatile" "throw") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1594 objc '("const" "volatile")) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1595 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1596 (c-lang-defconst c-opt-type-modifier-key |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1597 ;; Adorned regexp matching `c-type-modifier-kwds', or nil in |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1598 ;; languages without such keywords. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1599 t (and (c-lang-const c-type-modifier-kwds) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1600 (c-make-keywords-re t (c-lang-const c-type-modifier-kwds)))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1601 (c-lang-defvar c-opt-type-modifier-key (c-lang-const c-opt-type-modifier-key)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1602 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1603 (c-lang-defconst c-opt-type-component-key |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1604 ;; An adorned regexp that matches `c-primitive-type-prefix-kwds' and |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1605 ;; `c-type-modifier-kwds', or nil in languages without any of them. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1606 t (and (or (c-lang-const c-primitive-type-prefix-kwds) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1607 (c-lang-const c-type-modifier-kwds)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1608 (c-make-keywords-re t |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1609 (append (c-lang-const c-primitive-type-prefix-kwds) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1610 (c-lang-const c-type-modifier-kwds))))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1611 (c-lang-defvar c-opt-type-component-key |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1612 (c-lang-const c-opt-type-component-key)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1613 |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1614 (c-lang-defconst c-type-start-kwds |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1615 ;; All keywords that can start a type (i.e. are either a type prefix |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1616 ;; or a complete type). |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1617 t (delete-duplicates (append (c-lang-const c-primitive-type-kwds) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1618 (c-lang-const c-type-prefix-kwds) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1619 (c-lang-const c-type-modifier-kwds)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1620 :test 'string-equal)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1621 |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1622 (c-lang-defconst c-class-decl-kwds |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1623 "Keywords introducing declarations where the following block (if any) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1624 contains another declaration level that should be considered a class. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1625 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1626 If any of these also are on `c-type-list-kwds', `c-ref-list-kwds', |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1627 `c-colon-type-list-kwds', `c-paren-nontype-kwds', `c-paren-type-kwds', |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1628 `c-<>-type-kwds', or `c-<>-arglist-kwds' then the associated clauses |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1629 will be handled. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1630 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1631 Note that presence on this list does not automatically treat the |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1632 following identifier as a type; the keyword must also be present on |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1633 `c-type-prefix-kwds' or `c-type-list-kwds' to accomplish that." |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1634 t nil |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1635 c '("struct" "union") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1636 c++ '("class" "struct" "union") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1637 objc '("struct" "union" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1638 "@interface" "@implementation" "@protocol") |
109599
c18dffa2ba46
Enhance Java Mode to handle Java 5.0 (Tiger) and Java 6 (Mustang).
Alan Mackenzie <acm@muc.de>
parents:
107086
diff
changeset
|
1639 java '("class" "@interface" "interface") |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1640 idl '("component" "eventtype" "exception" "home" "interface" "struct" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1641 "union" "valuetype" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1642 ;; In CORBA PSDL: |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1643 "storagehome" "storagetype" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1644 ;; In CORBA CIDL: |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1645 "catalog" "executor" "manages" "segment") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1646 pike '("class")) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1647 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1648 (c-lang-defconst c-class-key |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1649 ;; Regexp matching the start of a class. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1650 t (c-make-keywords-re t (c-lang-const c-class-decl-kwds))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1651 (c-lang-defvar c-class-key (c-lang-const c-class-key)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1652 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1653 (c-lang-defconst c-brace-list-decl-kwds |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1654 "Keywords introducing declarations where the following block (if |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1655 any) is a brace list. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1656 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1657 If any of these also are on `c-type-list-kwds', `c-ref-list-kwds', |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1658 `c-colon-type-list-kwds', `c-paren-nontype-kwds', `c-paren-type-kwds', |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1659 `c-<>-type-kwds', or `c-<>-arglist-kwds' then the associated clauses |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1660 will be handled." |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1661 t '("enum") |
109599
c18dffa2ba46
Enhance Java Mode to handle Java 5.0 (Tiger) and Java 6 (Mustang).
Alan Mackenzie <acm@muc.de>
parents:
107086
diff
changeset
|
1662 (awk) nil) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1663 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1664 (c-lang-defconst c-brace-list-key |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1665 ;; Regexp matching the start of declarations where the following |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1666 ;; block is a brace list. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1667 t (c-make-keywords-re t (c-lang-const c-brace-list-decl-kwds))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1668 (c-lang-defvar c-brace-list-key (c-lang-const c-brace-list-key)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1669 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1670 (c-lang-defconst c-other-block-decl-kwds |
62641
27b53b1903b6
2005-05-23 Martin Stjernholm <bug-cc-mode@gnu.org>
Martin Stjernholm <mast@lysator.liu.se>
parents:
57295
diff
changeset
|
1671 "Keywords where the following block (if any) contains another |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1672 declaration level that should not be considered a class. For every |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1673 keyword here, CC Mode will add a set of special syntactic symbols for |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1674 those blocks. E.g. if the keyword is \"foo\" then there will be |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1675 `foo-open', `foo-close', and `infoo' symbols. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1676 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1677 The intention is that this category should be used for block |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1678 constructs that aren't related to object orientation concepts like |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1679 classes (which thus also include e.g. interfaces, templates, |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1680 contracts, structs, etc). The more pragmatic distinction is that |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1681 while most want some indentation inside classes, it's fairly common |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1682 that they don't want it in some of these constructs, so it should be |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1683 simple to configure that differently from classes. See also |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1684 `c-class-decl-kwds'. |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1685 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1686 If any of these also are on `c-type-list-kwds', `c-ref-list-kwds', |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1687 `c-colon-type-list-kwds', `c-paren-nontype-kwds', `c-paren-type-kwds', |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1688 `c-<>-type-kwds', or `c-<>-arglist-kwds' then the associated clauses |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1689 will be handled." |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1690 t nil |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1691 (c objc) '("extern") |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1692 c++ '("namespace" "extern") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1693 idl '("module" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1694 ;; In CORBA CIDL: |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1695 "composition")) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1696 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1697 (c-lang-defconst c-other-decl-block-key |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1698 ;; Regexp matching the start of blocks besides classes that contain |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1699 ;; another declaration level. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1700 t (c-make-keywords-re t (c-lang-const c-other-block-decl-kwds))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1701 (c-lang-defvar c-other-decl-block-key (c-lang-const c-other-decl-block-key)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1702 |
78657
d9f04596fa48
(c-other-decl-block-key-in-symbols-alist): new language variable.
Alan Mackenzie <acm@muc.de>
parents:
78354
diff
changeset
|
1703 (c-lang-defvar c-other-decl-block-key-in-symbols-alist |
d9f04596fa48
(c-other-decl-block-key-in-symbols-alist): new language variable.
Alan Mackenzie <acm@muc.de>
parents:
78354
diff
changeset
|
1704 (mapcar |
d9f04596fa48
(c-other-decl-block-key-in-symbols-alist): new language variable.
Alan Mackenzie <acm@muc.de>
parents:
78354
diff
changeset
|
1705 (lambda (elt) |
d9f04596fa48
(c-other-decl-block-key-in-symbols-alist): new language variable.
Alan Mackenzie <acm@muc.de>
parents:
78354
diff
changeset
|
1706 (cons elt |
d9f04596fa48
(c-other-decl-block-key-in-symbols-alist): new language variable.
Alan Mackenzie <acm@muc.de>
parents:
78354
diff
changeset
|
1707 (if (string= elt "extern") |
d9f04596fa48
(c-other-decl-block-key-in-symbols-alist): new language variable.
Alan Mackenzie <acm@muc.de>
parents:
78354
diff
changeset
|
1708 'inextern-lang |
d9f04596fa48
(c-other-decl-block-key-in-symbols-alist): new language variable.
Alan Mackenzie <acm@muc.de>
parents:
78354
diff
changeset
|
1709 (intern (concat "in" elt))))) |
d9f04596fa48
(c-other-decl-block-key-in-symbols-alist): new language variable.
Alan Mackenzie <acm@muc.de>
parents:
78354
diff
changeset
|
1710 (c-lang-const c-other-block-decl-kwds)) |
d9f04596fa48
(c-other-decl-block-key-in-symbols-alist): new language variable.
Alan Mackenzie <acm@muc.de>
parents:
78354
diff
changeset
|
1711 "Alist associating keywords in c-other-decl-block-decl-kwds with |
d9f04596fa48
(c-other-decl-block-key-in-symbols-alist): new language variable.
Alan Mackenzie <acm@muc.de>
parents:
78354
diff
changeset
|
1712 their matching \"in\" syntactic symbols.") |
d9f04596fa48
(c-other-decl-block-key-in-symbols-alist): new language variable.
Alan Mackenzie <acm@muc.de>
parents:
78354
diff
changeset
|
1713 |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1714 (c-lang-defconst c-typedef-decl-kwds |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1715 "Keywords introducing declarations where the identifier(s) being |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1716 declared are types. |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1717 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1718 If any of these also are on `c-type-list-kwds', `c-ref-list-kwds', |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1719 `c-colon-type-list-kwds', `c-paren-nontype-kwds', `c-paren-type-kwds', |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1720 `c-<>-type-kwds', or `c-<>-arglist-kwds' then the associated clauses |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1721 will be handled." |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1722 ;; Default to `c-class-decl-kwds' and `c-brace-list-decl-kwds' |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1723 ;; (since e.g. "Foo" is a type that's being defined in "class Foo |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1724 ;; {...}"). |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1725 t (append (c-lang-const c-class-decl-kwds) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1726 (c-lang-const c-brace-list-decl-kwds)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1727 ;; Languages that have a "typedef" construct. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1728 (c c++ objc idl pike) (append (c-lang-const c-typedef-decl-kwds) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1729 '("typedef")) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1730 ;; Unlike most other languages, exception names are not handled as |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1731 ;; types in IDL since they only can occur in "raises" specs. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1732 idl (delete "exception" (append (c-lang-const c-typedef-decl-kwds) nil))) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1733 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1734 (c-lang-defconst c-typeless-decl-kwds |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1735 "Keywords introducing declarations where the \(first) identifier |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1736 \(declarator) follows directly after the keyword, without any type. |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1737 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1738 If any of these also are on `c-type-list-kwds', `c-ref-list-kwds', |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1739 `c-colon-type-list-kwds', `c-paren-nontype-kwds', `c-paren-type-kwds', |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1740 `c-<>-type-kwds', or `c-<>-arglist-kwds' then the associated clauses |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1741 will be handled." |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1742 ;; Default to `c-class-decl-kwds' and `c-brace-list-decl-kwds' |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1743 ;; (since e.g. "Foo" is the identifier being defined in "class Foo |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1744 ;; {...}"). |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1745 t (append (c-lang-const c-class-decl-kwds) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1746 (c-lang-const c-brace-list-decl-kwds)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1747 ;; Note: "manages" for CORBA CIDL clashes with its presence on |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1748 ;; `c-type-list-kwds' for IDL. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1749 idl (append (c-lang-const c-typeless-decl-kwds) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1750 '("factory" "finder" "native" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1751 ;; In CORBA PSDL: |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1752 "key" "stores" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1753 ;; In CORBA CIDL: |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1754 "facet")) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1755 pike (append (c-lang-const c-class-decl-kwds) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1756 '("constant"))) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1757 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1758 (c-lang-defconst c-modifier-kwds |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1759 "Keywords that can prefix normal declarations of identifiers |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1760 \(and typically act as flags). Things like argument declarations |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1761 inside function headers are also considered declarations in this |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1762 sense. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1763 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1764 If any of these also are on `c-type-list-kwds', `c-ref-list-kwds', |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1765 `c-colon-type-list-kwds', `c-paren-nontype-kwds', `c-paren-type-kwds', |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1766 `c-<>-type-kwds', or `c-<>-arglist-kwds' then the associated clauses |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1767 will be handled." |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1768 t nil |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1769 (c c++) '("auto" "extern" "inline" "register" "static") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1770 c++ (append '("explicit" "friend" "mutable" "template" "using" "virtual") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1771 (c-lang-const c-modifier-kwds)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1772 objc '("auto" "bycopy" "byref" "extern" "in" "inout" "oneway" "out" "static") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1773 ;; FIXME: Some of those below ought to be on `c-other-decl-kwds' instead. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1774 idl '("abstract" "attribute" "const" "consumes" "custom" "emits" "import" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1775 "in" "inout" "local" "multiple" "oneway" "out" "private" "provides" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1776 "public" "publishes" "readonly" "typeid" "typeprefix" "uses" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1777 ;; In CORBA PSDL: |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1778 "primary" "state" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1779 ;; In CORBA CIDL: |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1780 "bindsTo" "delegatesTo" "implements" "proxy" "storedOn") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1781 ;; Note: "const" is not used in Java, but it's still a reserved keyword. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1782 java '("abstract" "const" "final" "native" "private" "protected" "public" |
109599
c18dffa2ba46
Enhance Java Mode to handle Java 5.0 (Tiger) and Java 6 (Mustang).
Alan Mackenzie <acm@muc.de>
parents:
107086
diff
changeset
|
1783 "static" "strictfp" "synchronized" "transient" "volatile" "@[A-Za-z0-9]+") |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1784 pike '("final" "inline" "local" "nomask" "optional" "private" "protected" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1785 "public" "static" "variant")) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1786 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1787 (c-lang-defconst c-other-decl-kwds |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1788 "Keywords that can start or prefix any declaration level construct, |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1789 besides those on `c-class-decl-kwds', `c-brace-list-decl-kwds', |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1790 `c-other-block-decl-kwds', `c-typedef-decl-kwds', |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1791 `c-typeless-decl-kwds' and `c-modifier-kwds'. |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1792 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1793 If any of these also are on `c-type-list-kwds', `c-ref-list-kwds', |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1794 `c-colon-type-list-kwds', `c-paren-nontype-kwds', `c-paren-type-kwds', |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1795 `c-<>-type-kwds', or `c-<>-arglist-kwds' then the associated clauses |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1796 will be handled." |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1797 t nil |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1798 objc '("@class" "@end" "@defs") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1799 java '("import" "package") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1800 pike '("import" "inherit")) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1801 |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1802 (c-lang-defconst c-decl-start-kwds |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1803 "Keywords that always start declarations, wherever they occur. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1804 This can be used for declarations that aren't recognized by the normal |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1805 combination of `c-decl-prefix-re' and `c-decl-start-re'." |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1806 t nil |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1807 ;; Classes can be declared anywhere in a Pike expression. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1808 pike '("class")) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1809 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1810 (c-lang-defconst c-decl-hangon-kwds |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1811 "Keywords that can occur anywhere in a declaration level construct. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1812 This is used for self-contained things that can be tacked on anywhere |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1813 on a declaration and that should be ignored to be able to recognize it |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1814 correctly. Typical cases are compiler extensions like |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1815 \"__attribute__\" or \"__declspec\": |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1816 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1817 __declspec(noreturn) void foo(); |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1818 class __declspec(dllexport) classname {...}; |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1819 void foo() __attribute__((noreturn)); |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1820 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1821 Note that unrecognized plain symbols are skipped anyway if they occur |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1822 before the type, so such things are not necessary to mention here. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1823 Mentioning them here is necessary only if they can occur in other |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1824 places, or if they are followed by a construct that must be skipped |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1825 over \(like the parens in the \"__attribute__\" and \"__declspec\" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1826 examples above). In the last case, they alse need to be present on |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1827 one of `c-type-list-kwds', `c-ref-list-kwds', |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1828 `c-colon-type-list-kwds', `c-paren-nontype-kwds', `c-paren-type-kwds', |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1829 `c-<>-type-kwds', or `c-<>-arglist-kwds'." |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1830 ;; NB: These are currently not recognized in all parts of a |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1831 ;; declaration. Specifically, they aren't recognized in the middle |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1832 ;; of multi-token types, inside declarators, and between the |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1833 ;; identifier and the arglist paren of a function declaration. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1834 ;; |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1835 ;; FIXME: This ought to be user customizable since compiler stuff |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1836 ;; like this usually is wrapped in project specific macros. (It'd |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1837 ;; of course be even better if we could cope without knowing this.) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1838 t nil |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1839 (c c++) '(;; GCC extension. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1840 "__attribute__" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1841 ;; MSVC extension. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1842 "__declspec")) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1843 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1844 (c-lang-defconst c-decl-hangon-key |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1845 ;; Adorned regexp matching `c-decl-hangon-kwds'. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1846 t (c-make-keywords-re t (c-lang-const c-decl-hangon-kwds))) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1847 (c-lang-defvar c-decl-hangon-key (c-lang-const c-decl-hangon-key)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1848 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1849 (c-lang-defconst c-prefix-spec-kwds |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1850 ;; All keywords that can occur in the preamble of a declaration. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1851 ;; They typically occur before the type, but they are also matched |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1852 ;; after presumptive types since we often can't be sure that |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1853 ;; something is a type or just some sort of macro in front of the |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1854 ;; declaration. They might be ambiguous with types or type |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1855 ;; prefixes. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1856 t (delete-duplicates (append (c-lang-const c-class-decl-kwds) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1857 (c-lang-const c-brace-list-decl-kwds) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1858 (c-lang-const c-other-block-decl-kwds) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1859 (c-lang-const c-typedef-decl-kwds) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1860 (c-lang-const c-typeless-decl-kwds) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1861 (c-lang-const c-modifier-kwds) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1862 (c-lang-const c-other-decl-kwds) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1863 (c-lang-const c-decl-start-kwds) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1864 (c-lang-const c-decl-hangon-kwds)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1865 :test 'string-equal)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1866 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1867 (c-lang-defconst c-prefix-spec-kwds-re |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1868 ;; Adorned regexp of `c-prefix-spec-kwds'. |
109599
c18dffa2ba46
Enhance Java Mode to handle Java 5.0 (Tiger) and Java 6 (Mustang).
Alan Mackenzie <acm@muc.de>
parents:
107086
diff
changeset
|
1869 t (c-make-keywords-re t (c-lang-const c-prefix-spec-kwds)) |
c18dffa2ba46
Enhance Java Mode to handle Java 5.0 (Tiger) and Java 6 (Mustang).
Alan Mackenzie <acm@muc.de>
parents:
107086
diff
changeset
|
1870 java (replace-regexp-in-string |
c18dffa2ba46
Enhance Java Mode to handle Java 5.0 (Tiger) and Java 6 (Mustang).
Alan Mackenzie <acm@muc.de>
parents:
107086
diff
changeset
|
1871 "\\\\\\[" "[" |
c18dffa2ba46
Enhance Java Mode to handle Java 5.0 (Tiger) and Java 6 (Mustang).
Alan Mackenzie <acm@muc.de>
parents:
107086
diff
changeset
|
1872 (replace-regexp-in-string "\\\\\\+" "+" (c-make-keywords-re t (c-lang-const c-prefix-spec-kwds))))) |
c18dffa2ba46
Enhance Java Mode to handle Java 5.0 (Tiger) and Java 6 (Mustang).
Alan Mackenzie <acm@muc.de>
parents:
107086
diff
changeset
|
1873 |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1874 (c-lang-defvar c-prefix-spec-kwds-re (c-lang-const c-prefix-spec-kwds-re)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1875 |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1876 (c-lang-defconst c-specifier-key |
79955
aa18c505efa9
(c-specifier-key): Exclude "template" from this regexp; to allow the "{"
Alan Mackenzie <acm@muc.de>
parents:
79717
diff
changeset
|
1877 ;; Adorned regexp of the keywords in `c-prefix-spec-kwds' that aren't |
aa18c505efa9
(c-specifier-key): Exclude "template" from this regexp; to allow the "{"
Alan Mackenzie <acm@muc.de>
parents:
79717
diff
changeset
|
1878 ;; ambiguous with types or type prefixes. These are the keywords (like |
aa18c505efa9
(c-specifier-key): Exclude "template" from this regexp; to allow the "{"
Alan Mackenzie <acm@muc.de>
parents:
79717
diff
changeset
|
1879 ;; extern, namespace, but NOT template) that can modify a declaration. |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1880 t (c-make-keywords-re t |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1881 (set-difference (c-lang-const c-prefix-spec-kwds) |
79955
aa18c505efa9
(c-specifier-key): Exclude "template" from this regexp; to allow the "{"
Alan Mackenzie <acm@muc.de>
parents:
79717
diff
changeset
|
1882 (append (c-lang-const c-type-start-kwds) |
aa18c505efa9
(c-specifier-key): Exclude "template" from this regexp; to allow the "{"
Alan Mackenzie <acm@muc.de>
parents:
79717
diff
changeset
|
1883 (c-lang-const c-<>-arglist-kwds)) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1884 :test 'string-equal))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1885 (c-lang-defvar c-specifier-key (c-lang-const c-specifier-key)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1886 |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1887 (c-lang-defconst c-postfix-spec-kwds |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1888 ;; Keywords that can occur after argument list of a function header |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1889 ;; declaration, i.e. in the "K&R region". |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1890 t (append (c-lang-const c-postfix-decl-spec-kwds) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1891 (c-lang-const c-decl-hangon-kwds))) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1892 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1893 (c-lang-defconst c-not-decl-init-keywords |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1894 ;; Adorned regexp matching all keywords that can't appear at the |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1895 ;; start of a declaration. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1896 t (c-make-keywords-re t |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1897 (set-difference (c-lang-const c-keywords) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1898 (append (c-lang-const c-type-start-kwds) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1899 (c-lang-const c-prefix-spec-kwds)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1900 :test 'string-equal))) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1901 (c-lang-defvar c-not-decl-init-keywords |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1902 (c-lang-const c-not-decl-init-keywords)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1903 |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1904 (c-lang-defconst c-protection-kwds |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1905 "Access protection label keywords in classes." |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1906 t nil |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1907 c++ '("private" "protected" "public") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1908 objc '("@private" "@protected" "@public")) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1909 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1910 (c-lang-defconst c-block-decls-with-vars |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1911 "Keywords introducing declarations that can contain a block which |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1912 might be followed by variable declarations, e.g. like \"foo\" in |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1913 \"class Foo { ... } foo;\". So if there is a block in a declaration |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1914 like that, it ends with the following ';' and not right away. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1915 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1916 The keywords on list are assumed to also be present on one of the |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1917 `*-decl-kwds' lists." |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1918 t nil |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1919 (c objc) '("struct" "union" "enum" "typedef") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1920 c++ '("class" "struct" "union" "enum" "typedef")) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1921 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1922 (c-lang-defconst c-opt-block-decls-with-vars-key |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1923 ;; Regexp matching the `c-block-decls-with-vars' keywords, or nil in |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1924 ;; languages without such constructs. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1925 t (and (c-lang-const c-block-decls-with-vars) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1926 (c-make-keywords-re t (c-lang-const c-block-decls-with-vars)))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1927 (c-lang-defvar c-opt-block-decls-with-vars-key |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1928 (c-lang-const c-opt-block-decls-with-vars-key)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1929 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1930 (c-lang-defconst c-postfix-decl-spec-kwds |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1931 "Keywords introducing extra declaration specifiers in the region |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1932 between the header and the body \(i.e. the \"K&R-region\") in |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1933 declarations." |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1934 t nil |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1935 java '("extends" "implements" "throws") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1936 idl '("context" "getraises" "manages" "primarykey" "raises" "setraises" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1937 "supports" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1938 ;; In CORBA PSDL: |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1939 "as" "const" "implements" "of" "ref")) |
36920 | 1940 |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1941 (c-lang-defconst c-nonsymbol-sexp-kwds |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1942 "Keywords that may be followed by a nonsymbol sexp before whatever |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1943 construct it's part of continues." |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1944 t nil |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1945 (c c++ objc) '("extern")) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1946 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1947 (c-lang-defconst c-type-list-kwds |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1948 "Keywords that may be followed by a comma separated list of type |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1949 identifiers, where each optionally can be prefixed by keywords. (Can |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1950 also be used for the special case when the list can contain only one |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1951 element.) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1952 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1953 Assumed to be mutually exclusive with `c-ref-list-kwds'. There's no |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1954 reason to put keywords on this list if they are on `c-type-prefix-kwds'. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1955 There's also no reason to add keywords that prefixes a normal |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1956 declaration consisting of a type followed by a declarator (list), so |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1957 the keywords on `c-modifier-kwds' should normally not be listed here |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1958 either. |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1959 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1960 Note: Use `c-typeless-decl-kwds' for keywords followed by a function |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1961 or variable identifier (that's being defined)." |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1962 t nil |
52607
28b12b0193f6
(c-type-list-kwds): If "operator" is followed by an identifier in C++
Martin Stjernholm <mast@lysator.liu.se>
parents:
52401
diff
changeset
|
1963 c++ '("operator") |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1964 objc '("@class") |
109599
c18dffa2ba46
Enhance Java Mode to handle Java 5.0 (Tiger) and Java 6 (Mustang).
Alan Mackenzie <acm@muc.de>
parents:
107086
diff
changeset
|
1965 java '("import" "new" "extends" "super" "implements" "throws") |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1966 idl '("manages" "native" "primarykey" "supports" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1967 ;; In CORBA PSDL: |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1968 "as" "implements" "of" "scope") |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1969 pike '("inherit")) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1970 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1971 (c-lang-defconst c-ref-list-kwds |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1972 "Keywords that may be followed by a comma separated list of |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1973 reference (i.e. namespace/scope/module) identifiers, where each |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1974 optionally can be prefixed by keywords. (Can also be used for the |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1975 special case when the list can contain only one element.) Assumed to |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1976 be mutually exclusive with `c-type-list-kwds'. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1977 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1978 Note: Use `c-typeless-decl-kwds' for keywords followed by a function |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1979 or variable identifier (that's being defined)." |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1980 t nil |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1981 c++ '("namespace") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1982 java '("package") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1983 idl '("import" "module" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1984 ;; In CORBA CIDL: |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1985 "composition") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1986 pike '("import")) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1987 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1988 (c-lang-defconst c-colon-type-list-kwds |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1989 "Keywords that may be followed (not necessarily directly) by a colon |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1990 and then a comma separated list of type identifiers, where each |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1991 optionally can be prefixed by keywords. (Can also be used for the |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1992 special case when the list can contain only one element.)" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1993 t nil |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1994 c++ '("class" "struct") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1995 idl '("component" "eventtype" "home" "interface" "valuetype" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1996 ;; In CORBA PSDL: |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1997 "storagehome" "storagetype")) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1998 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
1999 (c-lang-defconst c-colon-type-list-re |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2000 "Regexp matched after the keywords in `c-colon-type-list-kwds' to skip |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2001 forward to the colon. The end of the match is assumed to be directly |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2002 after the colon, so the regexp should end with \":\". Must be a |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2003 regexp if `c-colon-type-list-kwds' isn't nil." |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2004 t (if (c-lang-const c-colon-type-list-kwds) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2005 ;; Disallow various common punctuation chars that can't come |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2006 ;; before the ":" that starts the inherit list after "class" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2007 ;; or "struct" in C++. (Also used as default for other |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2008 ;; languages.) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2009 "[^\]\[{}();,/#=:]*:")) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2010 (c-lang-defvar c-colon-type-list-re (c-lang-const c-colon-type-list-re)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2011 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2012 (c-lang-defconst c-paren-nontype-kwds |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2013 "Keywords that may be followed by a parenthesis expression that doesn't |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2014 contain type identifiers." |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2015 t nil |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2016 (c c++) '(;; GCC extension. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2017 "__attribute__" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2018 ;; MSVC extension. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2019 "__declspec")) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2020 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2021 (c-lang-defconst c-paren-type-kwds |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2022 "Keywords that may be followed by a parenthesis expression containing |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2023 type identifiers separated by arbitrary tokens." |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2024 t nil |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2025 c++ '("throw") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2026 objc '("@defs") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2027 idl '("switch") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2028 pike '("array" "function" "int" "mapping" "multiset" "object" "program")) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2029 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2030 (c-lang-defconst c-paren-any-kwds |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2031 t (delete-duplicates (append (c-lang-const c-paren-nontype-kwds) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2032 (c-lang-const c-paren-type-kwds)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2033 :test 'string-equal)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2034 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2035 (c-lang-defconst c-<>-type-kwds |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2036 "Keywords that may be followed by an angle bracket expression |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2037 containing type identifiers separated by \",\". The difference from |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2038 `c-<>-arglist-kwds' is that unknown names are taken to be types and |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2039 not other identifiers. `c-recognize-<>-arglists' is assumed to be set |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2040 if this isn't nil." |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2041 t nil |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2042 objc '("id") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2043 idl '("sequence" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2044 ;; In CORBA PSDL: |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2045 "ref")) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2046 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2047 (c-lang-defconst c-<>-arglist-kwds |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2048 "Keywords that can be followed by a C++ style template arglist; see |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2049 `c-recognize-<>-arglists' for details. That language constant is |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2050 assumed to be set if this isn't nil." |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2051 t nil |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2052 c++ '("template") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2053 idl '("fixed" "string" "wstring")) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2054 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2055 (c-lang-defconst c-<>-sexp-kwds |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2056 ;; All keywords that can be followed by an angle bracket sexp. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2057 t (delete-duplicates (append (c-lang-const c-<>-type-kwds) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2058 (c-lang-const c-<>-arglist-kwds)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2059 :test 'string-equal)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2060 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2061 (c-lang-defconst c-opt-<>-sexp-key |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2062 ;; Adorned regexp matching keywords that can be followed by an angle |
52341
6a060e586596
(c-lineup-math): Don't align the operators "!=", "<=" and ">=" as assignment
Martin Stjernholm <mast@lysator.liu.se>
parents:
51946
diff
changeset
|
2063 ;; bracket sexp. Always set when `c-recognize-<>-arglists' is. |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2064 t (if (c-lang-const c-recognize-<>-arglists) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2065 (c-make-keywords-re t (c-lang-const c-<>-sexp-kwds)))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2066 (c-lang-defvar c-opt-<>-sexp-key (c-lang-const c-opt-<>-sexp-key)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2067 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2068 (c-lang-defconst c-brace-id-list-kwds |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2069 "Keywords that may be followed by a brace block containing a comma |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2070 separated list of identifier definitions, i.e. like the list of |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2071 identifiers that follows the type in a normal declaration." |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2072 t (c-lang-const c-brace-list-decl-kwds)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2073 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2074 (c-lang-defconst c-block-stmt-1-kwds |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2075 "Statement keywords followed directly by a substatement." |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2076 t '("do" "else") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2077 c++ '("do" "else" "try") |
79958
d22f0fe0ef05
(c-block-stmt-1-kwds, c-block-stmt-2-kwds, c-simple-stmt-kwds): New
Alan Mackenzie <acm@muc.de>
parents:
79955
diff
changeset
|
2078 objc '("do" "else" "@finally" "@try") |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2079 java '("do" "else" "finally" "try") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2080 idl nil) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2081 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2082 (c-lang-defconst c-block-stmt-1-key |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2083 ;; Regexp matching the start of any statement followed directly by a |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2084 ;; substatement (doesn't match a bare block, however). |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2085 t (c-make-keywords-re t (c-lang-const c-block-stmt-1-kwds))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2086 (c-lang-defvar c-block-stmt-1-key (c-lang-const c-block-stmt-1-key)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2087 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2088 (c-lang-defconst c-block-stmt-2-kwds |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2089 "Statement keywords followed by a paren sexp and then by a substatement." |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2090 t '("for" "if" "switch" "while") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2091 c++ '("for" "if" "switch" "while" "catch") |
79958
d22f0fe0ef05
(c-block-stmt-1-kwds, c-block-stmt-2-kwds, c-simple-stmt-kwds): New
Alan Mackenzie <acm@muc.de>
parents:
79955
diff
changeset
|
2092 objc '("for" "if" "switch" "while" "@catch" "@synchronized") |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2093 java '("for" "if" "switch" "while" "catch" "synchronized") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2094 idl nil |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2095 pike '("for" "if" "switch" "while" "foreach") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2096 awk '("for" "if" "while")) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2097 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2098 (c-lang-defconst c-block-stmt-2-key |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2099 ;; Regexp matching the start of any statement followed by a paren sexp |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2100 ;; and then by a substatement. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2101 t (c-make-keywords-re t (c-lang-const c-block-stmt-2-kwds))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2102 (c-lang-defvar c-block-stmt-2-key (c-lang-const c-block-stmt-2-key)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2103 |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2104 (c-lang-defconst c-block-stmt-kwds |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2105 ;; Union of `c-block-stmt-1-kwds' and `c-block-stmt-2-kwds'. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2106 t (delete-duplicates (append (c-lang-const c-block-stmt-1-kwds) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2107 (c-lang-const c-block-stmt-2-kwds)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2108 :test 'string-equal)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2109 |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2110 (c-lang-defconst c-opt-block-stmt-key |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2111 ;; Regexp matching the start of any statement that has a |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2112 ;; substatement (except a bare block). Nil in languages that |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2113 ;; don't have such constructs. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2114 t (if (or (c-lang-const c-block-stmt-1-kwds) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2115 (c-lang-const c-block-stmt-2-kwds)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2116 (c-make-keywords-re t |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2117 (append (c-lang-const c-block-stmt-1-kwds) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2118 (c-lang-const c-block-stmt-2-kwds))))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2119 (c-lang-defvar c-opt-block-stmt-key (c-lang-const c-opt-block-stmt-key)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2120 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2121 (c-lang-defconst c-simple-stmt-kwds |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2122 "Statement keywords followed by an expression or nothing." |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2123 t '("break" "continue" "goto" "return") |
79958
d22f0fe0ef05
(c-block-stmt-1-kwds, c-block-stmt-2-kwds, c-simple-stmt-kwds): New
Alan Mackenzie <acm@muc.de>
parents:
79955
diff
changeset
|
2124 objc '("break" "continue" "goto" "return" "@throw") |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2125 ;; Note: `goto' is not valid in Java, but the keyword is still reserved. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2126 java '("break" "continue" "goto" "return" "throw") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2127 idl nil |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2128 pike '("break" "continue" "return") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2129 awk '(;; Not sure about "delete", "exit", "getline", etc. ; ACM 2002/5/30 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2130 "break" "continue" "return" "delete" "exit" "getline" "next" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2131 "nextfile" "print" "printf")) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2132 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2133 (c-lang-defconst c-simple-stmt-key |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2134 ;; Adorned regexp matching `c-simple-stmt-kwds'. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2135 t (c-make-keywords-re t (c-lang-const c-simple-stmt-kwds))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2136 (c-lang-defvar c-simple-stmt-key (c-lang-const c-simple-stmt-key)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2137 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2138 (c-lang-defconst c-paren-stmt-kwds |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2139 "Statement keywords followed by a parenthesis expression that |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2140 nevertheless contains a list separated with ';' and not ','." |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2141 t '("for") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2142 idl nil) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2143 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2144 (c-lang-defconst c-paren-stmt-key |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2145 ;; Adorned regexp matching `c-paren-stmt-kwds'. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2146 t (c-make-keywords-re t (c-lang-const c-paren-stmt-kwds))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2147 (c-lang-defvar c-paren-stmt-key (c-lang-const c-paren-stmt-key)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2148 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2149 (c-lang-defconst c-asm-stmt-kwds |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2150 "Statement keywords followed by an assembler expression." |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2151 t nil |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2152 (c c++) '("asm" "__asm__")) ;; Not standard, but common. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2153 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2154 (c-lang-defconst c-opt-asm-stmt-key |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2155 ;; Regexp matching the start of an assembler statement. Nil in |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2156 ;; languages that don't support that. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2157 t (if (c-lang-const c-asm-stmt-kwds) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2158 (c-make-keywords-re t (c-lang-const c-asm-stmt-kwds)))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2159 (c-lang-defvar c-opt-asm-stmt-key (c-lang-const c-opt-asm-stmt-key)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2160 |
102168
4f3b9ebc200a
cc-engine.el (c-beginning-of-statement-1): Enhance to parse case clauses
Alan Mackenzie <acm@muc.de>
parents:
101271
diff
changeset
|
2161 (c-lang-defconst c-case-kwds |
4f3b9ebc200a
cc-engine.el (c-beginning-of-statement-1): Enhance to parse case clauses
Alan Mackenzie <acm@muc.de>
parents:
101271
diff
changeset
|
2162 "The keyword\(s) which introduce a \"case\" like construct. |
4f3b9ebc200a
cc-engine.el (c-beginning-of-statement-1): Enhance to parse case clauses
Alan Mackenzie <acm@muc.de>
parents:
101271
diff
changeset
|
2163 This construct is \"<keyword> <expression> :\"." |
4f3b9ebc200a
cc-engine.el (c-beginning-of-statement-1): Enhance to parse case clauses
Alan Mackenzie <acm@muc.de>
parents:
101271
diff
changeset
|
2164 t '("case") |
4f3b9ebc200a
cc-engine.el (c-beginning-of-statement-1): Enhance to parse case clauses
Alan Mackenzie <acm@muc.de>
parents:
101271
diff
changeset
|
2165 awk nil) |
4f3b9ebc200a
cc-engine.el (c-beginning-of-statement-1): Enhance to parse case clauses
Alan Mackenzie <acm@muc.de>
parents:
101271
diff
changeset
|
2166 |
4f3b9ebc200a
cc-engine.el (c-beginning-of-statement-1): Enhance to parse case clauses
Alan Mackenzie <acm@muc.de>
parents:
101271
diff
changeset
|
2167 (c-lang-defconst c-case-kwds-regexp |
4f3b9ebc200a
cc-engine.el (c-beginning-of-statement-1): Enhance to parse case clauses
Alan Mackenzie <acm@muc.de>
parents:
101271
diff
changeset
|
2168 ;; Adorned regexp matching any "case"-like keyword. |
4f3b9ebc200a
cc-engine.el (c-beginning-of-statement-1): Enhance to parse case clauses
Alan Mackenzie <acm@muc.de>
parents:
101271
diff
changeset
|
2169 t (c-make-keywords-re t (c-lang-const c-case-kwds))) |
4f3b9ebc200a
cc-engine.el (c-beginning-of-statement-1): Enhance to parse case clauses
Alan Mackenzie <acm@muc.de>
parents:
101271
diff
changeset
|
2170 (c-lang-defvar c-case-kwds-regexp (c-lang-const c-case-kwds-regexp)) |
4f3b9ebc200a
cc-engine.el (c-beginning-of-statement-1): Enhance to parse case clauses
Alan Mackenzie <acm@muc.de>
parents:
101271
diff
changeset
|
2171 |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2172 (c-lang-defconst c-label-kwds |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2173 "Keywords introducing colon terminated labels in blocks." |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2174 t '("case" "default") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2175 awk nil) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2176 |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2177 (c-lang-defconst c-label-kwds-regexp |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2178 ;; Adorned regexp matching any keyword that introduces a label. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2179 t (c-make-keywords-re t (c-lang-const c-label-kwds))) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2180 (c-lang-defvar c-label-kwds-regexp (c-lang-const c-label-kwds-regexp)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2181 |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2182 (c-lang-defconst c-before-label-kwds |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2183 "Keywords that might be followed by a label identifier." |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2184 t '("goto") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2185 (java pike) (append '("break" "continue") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2186 (c-lang-const c-before-label-kwds)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2187 idl nil |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2188 awk nil) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2189 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2190 (c-lang-defconst c-constant-kwds |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2191 "Keywords for constants." |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2192 t nil |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2193 (c c++) '("NULL" ;; Not a keyword, but practically works as one. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2194 "false" "true") ; Defined in C99. |
103117
49b361ba00e8
Enhancements for Objective-C:
Alan Mackenzie <acm@muc.de>
parents:
102168
diff
changeset
|
2195 objc '("nil" "Nil" "YES" "NO" "NS_DURING" "NS_HANDLER" "NS_ENDHANDLER") |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2196 idl '("TRUE" "FALSE") |
78688
169408eb6887
(c-constant-kwds): Add java: null, true, false.
Glenn Morris <rgm@gnu.org>
parents:
78657
diff
changeset
|
2197 java '("true" "false" "null") ; technically "literals", not keywords |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2198 pike '("UNDEFINED")) ;; Not a keyword, but practically works as one. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2199 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2200 (c-lang-defconst c-primary-expr-kwds |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2201 "Keywords besides constants and operators that start primary expressions." |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2202 t nil |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2203 c++ '("operator" "this") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2204 objc '("super" "self") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2205 java '("this") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2206 pike '("this")) ;; Not really a keyword, but practically works as one. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2207 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2208 (c-lang-defconst c-expr-kwds |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2209 ;; Keywords that can occur anywhere in expressions. Built from |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2210 ;; `c-primary-expr-kwds' and all keyword operators in `c-operators'. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2211 t (delete-duplicates |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2212 (append (c-lang-const c-primary-expr-kwds) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2213 (c-filter-ops (c-lang-const c-operator-list) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2214 t |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2215 "\\`\\(\\w\\|\\s_\\)+\\'")) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2216 :test 'string-equal)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2217 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2218 (c-lang-defconst c-lambda-kwds |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2219 "Keywords that start lambda constructs, i.e. function definitions in |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2220 expressions." |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2221 t nil |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2222 pike '("lambda")) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2223 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2224 (c-lang-defconst c-inexpr-block-kwds |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2225 "Keywords that start constructs followed by statement blocks which can |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2226 be used in expressions \(the gcc extension for this in C and C++ is |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2227 handled separately by `c-recognize-paren-inexpr-blocks')." |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2228 t nil |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2229 pike '("catch" "gauge")) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2230 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2231 (c-lang-defconst c-inexpr-class-kwds |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2232 "Keywords that can start classes inside expressions." |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2233 t nil |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2234 java '("new") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2235 pike '("class")) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2236 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2237 (c-lang-defconst c-inexpr-brace-list-kwds |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2238 "Keywords that can start brace list blocks inside expressions. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2239 Note that Java specific rules are currently applied to tell this from |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2240 `c-inexpr-class-kwds'." |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2241 t nil |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2242 java '("new")) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2243 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2244 (c-lang-defconst c-opt-inexpr-brace-list-key |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2245 ;; Regexp matching the start of a brace list in an expression, or |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2246 ;; nil in languages that don't have such things. This should not |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2247 ;; match brace lists recognized through `c-special-brace-lists'. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2248 t (and (c-lang-const c-inexpr-brace-list-kwds) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2249 (c-make-keywords-re t (c-lang-const c-inexpr-brace-list-kwds)))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2250 (c-lang-defvar c-opt-inexpr-brace-list-key |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2251 (c-lang-const c-opt-inexpr-brace-list-key)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2252 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2253 (c-lang-defconst c-decl-block-key |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2254 ;; Regexp matching keywords in any construct that contain another |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2255 ;; declaration level, i.e. that isn't followed by a function block |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2256 ;; or brace list. When the first submatch matches, it's an |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2257 ;; unambiguous construct, otherwise it's an ambiguous match that |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2258 ;; might also be the return type of a function declaration. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2259 t (let* ((decl-kwds (append (c-lang-const c-class-decl-kwds) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2260 (c-lang-const c-other-block-decl-kwds) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2261 (c-lang-const c-inexpr-class-kwds))) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2262 (unambiguous (set-difference decl-kwds |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2263 (c-lang-const c-type-start-kwds) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2264 :test 'string-equal)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2265 (ambiguous (intersection decl-kwds |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2266 (c-lang-const c-type-start-kwds) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2267 :test 'string-equal))) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2268 (if ambiguous |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2269 (concat (c-make-keywords-re t unambiguous) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2270 "\\|" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2271 (c-make-keywords-re t ambiguous)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2272 (c-make-keywords-re t unambiguous)))) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2273 (c-lang-defvar c-decl-block-key (c-lang-const c-decl-block-key)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2274 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2275 (c-lang-defconst c-bitfield-kwds |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2276 "Keywords that can introduce bitfields." |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2277 t nil |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2278 (c c++ objc) '("char" "int" "long" "signed" "unsigned")) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2279 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2280 (c-lang-defconst c-opt-bitfield-key |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2281 ;; Regexp matching the start of a bitfield (not uniquely), or nil in |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2282 ;; languages without bitfield support. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2283 t nil |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2284 (c c++) (c-make-keywords-re t (c-lang-const c-bitfield-kwds))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2285 (c-lang-defvar c-opt-bitfield-key (c-lang-const c-opt-bitfield-key)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2286 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2287 (c-lang-defconst c-other-kwds |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2288 "Keywords not accounted for by any other `*-kwds' language constant." |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2289 t nil |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2290 idl '("truncatable" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2291 ;; In CORBA CIDL: (These are declaration keywords that never |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2292 ;; can start a declaration.) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2293 "entity" "process" "service" "session" "storage")) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2294 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2295 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2296 ;;; Constants built from keywords. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2297 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2298 ;; Note: No `*-kwds' language constants may be defined below this point. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2299 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2300 (eval-and-compile |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2301 (defconst c-kwds-lang-consts |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2302 ;; List of all the language constants that contain keyword lists. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2303 (let (list) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2304 (mapatoms (lambda (sym) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2305 (when (and (boundp sym) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2306 (string-match "-kwds\\'" (symbol-name sym))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2307 ;; Make the list of globally interned symbols |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2308 ;; instead of ones interned in `c-lang-constants'. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2309 (setq list (cons (intern (symbol-name sym)) list)))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2310 c-lang-constants) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2311 list))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2312 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2313 (c-lang-defconst c-keywords |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2314 ;; All keywords as a list. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2315 t (delete-duplicates |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2316 (c-lang-defconst-eval-immediately |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2317 `(append ,@(mapcar (lambda (kwds-lang-const) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2318 `(c-lang-const ,kwds-lang-const)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2319 c-kwds-lang-consts) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2320 nil)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2321 :test 'string-equal)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2322 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2323 (c-lang-defconst c-keywords-regexp |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2324 ;; All keywords as an adorned regexp. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2325 t (c-make-keywords-re t (c-lang-const c-keywords))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2326 (c-lang-defvar c-keywords-regexp (c-lang-const c-keywords-regexp)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2327 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2328 (c-lang-defconst c-keyword-member-alist |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2329 ;; An alist with all the keywords in the cars. The cdr for each |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2330 ;; keyword is a list of the symbols for the `*-kwds' lists that |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2331 ;; contains it. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2332 t (let ((kwd-list-alist |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2333 (c-lang-defconst-eval-immediately |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2334 `(list ,@(mapcar (lambda (kwds-lang-const) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2335 `(cons ',kwds-lang-const |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2336 (c-lang-const ,kwds-lang-const))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2337 c-kwds-lang-consts)))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2338 lang-const kwd-list kwd |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2339 result-alist elem) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2340 (while kwd-list-alist |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2341 (setq lang-const (caar kwd-list-alist) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2342 kwd-list (cdar kwd-list-alist) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2343 kwd-list-alist (cdr kwd-list-alist)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2344 (while kwd-list |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2345 (setq kwd (car kwd-list) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2346 kwd-list (cdr kwd-list)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2347 (unless (setq elem (assoc kwd result-alist)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2348 (setq result-alist (cons (setq elem (list kwd)) result-alist))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2349 (unless (memq lang-const (cdr elem)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2350 (setcdr elem (cons lang-const (cdr elem)))))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2351 result-alist)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2352 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2353 (c-lang-defvar c-keywords-obarray |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2354 ;; An obarray containing all keywords as symbols. The property list |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2355 ;; of each symbol has a non-nil entry for the specific `*-kwds' |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2356 ;; lists it's a member of. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2357 ;; |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2358 ;; E.g. to see whether the string str contains a keyword on |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2359 ;; `c-class-decl-kwds', one can do like this: |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2360 ;; (get (intern-soft str c-keyword-obarray) 'c-class-decl-kwds) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2361 ;; Which preferably is written using the associated functions in |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2362 ;; cc-engine: |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2363 ;; (c-keyword-member (c-keyword-sym str) 'c-class-decl-kwds) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2364 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2365 ;; The obarray is not stored directly as a language constant since |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2366 ;; the printed representation for obarrays used in .elc files isn't |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2367 ;; complete. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2368 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2369 (let* ((alist (c-lang-const c-keyword-member-alist)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2370 kwd lang-const-list |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2371 (obarray (make-vector (* (length alist) 2) 0))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2372 (while alist |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2373 (setq kwd (caar alist) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2374 lang-const-list (cdar alist) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2375 alist (cdr alist)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2376 (setplist (intern kwd obarray) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2377 ;; Emacs has an odd bug that causes `mapcan' to fail |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2378 ;; with unintelligible errors. (XEmacs works.) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2379 ;;(mapcan (lambda (lang-const) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2380 ;; (list lang-const t)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2381 ;; lang-const-list) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2382 (apply 'nconc (mapcar (lambda (lang-const) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2383 (list lang-const t)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2384 lang-const-list)))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2385 obarray)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2386 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2387 (c-lang-defconst c-regular-keywords-regexp |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2388 ;; Adorned regexp matching all keywords that should be fontified |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2389 ;; with the keywords face. I.e. that aren't types or constants. |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2390 t (c-make-keywords-re t |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2391 (set-difference (c-lang-const c-keywords) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2392 (append (c-lang-const c-primitive-type-kwds) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2393 (c-lang-const c-constant-kwds)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2394 :test 'string-equal))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2395 (c-lang-defvar c-regular-keywords-regexp |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2396 (c-lang-const c-regular-keywords-regexp)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2397 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2398 (c-lang-defconst c-primary-expr-regexp |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2399 ;; Regexp matching the start of any primary expression, i.e. any |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2400 ;; literal, symbol, prefix operator, and '('. It doesn't need to |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2401 ;; exclude keywords; they are excluded afterwards unless the second |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2402 ;; submatch matches. If the first but not the second submatch |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2403 ;; matches then it is an ambiguous primary expression; it could also |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2404 ;; be a match of e.g. an infix operator. (The case with ambiguous |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2405 ;; keyword operators isn't handled.) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2406 |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2407 t (let* ((prefix-ops |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2408 (c-filter-ops (c-lang-const c-operators) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2409 '(prefix) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2410 (lambda (op) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2411 ;; Filter out the special case prefix |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2412 ;; operators that are close parens. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2413 (not (string-match "\\s)" op))))) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2414 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2415 (nonkeyword-prefix-ops |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2416 (c-filter-ops prefix-ops |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2417 t |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2418 "\\`\\(\\s.\\|\\s(\\|\\s)\\)+\\'")) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2419 |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2420 (in-or-postfix-ops |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2421 (c-filter-ops (c-lang-const c-operators) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2422 '(postfix |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2423 postfix-if-paren |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2424 left-assoc |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2425 right-assoc |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2426 right-assoc-sequence) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2427 t)) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2428 |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2429 (unambiguous-prefix-ops (set-difference nonkeyword-prefix-ops |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2430 in-or-postfix-ops |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2431 :test 'string-equal)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2432 (ambiguous-prefix-ops (intersection nonkeyword-prefix-ops |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2433 in-or-postfix-ops |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2434 :test 'string-equal))) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2435 |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2436 (concat |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2437 "\\(" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2438 ;; Take out all symbol class operators from `prefix-ops' and make the |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2439 ;; first submatch from them together with `c-primary-expr-kwds'. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2440 (c-make-keywords-re t |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2441 (append (c-lang-const c-primary-expr-kwds) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2442 (set-difference prefix-ops nonkeyword-prefix-ops |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2443 :test 'string-equal))) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2444 |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2445 "\\|" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2446 ;; Match all ambiguous operators. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2447 (c-make-keywords-re nil |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2448 (intersection nonkeyword-prefix-ops in-or-postfix-ops |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2449 :test 'string-equal)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2450 "\\)" |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2451 |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2452 "\\|" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2453 ;; Now match all other symbols. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2454 (c-lang-const c-symbol-start) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2455 |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2456 "\\|" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2457 ;; The chars that can start integer and floating point |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2458 ;; constants. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2459 "\\.?[0-9]" |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2460 |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2461 "\\|" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2462 ;; The nonambiguous operators from `prefix-ops'. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2463 (c-make-keywords-re nil |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2464 (set-difference nonkeyword-prefix-ops in-or-postfix-ops |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2465 :test 'string-equal)) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2466 |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2467 "\\|" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2468 ;; Match string and character literals. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2469 "\\s\"" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2470 (if (memq 'gen-string-delim c-emacs-features) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2471 "\\|\\s|" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2472 "")))) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2473 (c-lang-defvar c-primary-expr-regexp (c-lang-const c-primary-expr-regexp)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2474 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2475 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2476 ;;; Additional constants for parser-level constructs. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2477 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2478 (c-lang-defconst c-decl-prefix-re |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2479 "Regexp matching something that might precede a declaration, cast or |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2480 label, such as the last token of a preceding statement or declaration. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2481 This is used in the common situation where a declaration or cast |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2482 doesn't start with any specific token that can be searched for. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2483 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2484 The regexp should not match bob; that is done implicitly. It can't |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2485 require a match longer than one token. The end of the token is taken |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2486 to be at the end of the first submatch, which is assumed to always |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2487 match. It's undefined whether identifier syntax (see |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2488 `c-identifier-syntax-table') is in effect or not. This regexp is |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2489 assumed to be a superset of `c-label-prefix-re' if |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2490 `c-recognize-colon-labels' is set. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2491 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2492 Besides this, `c-decl-start-kwds' is used to find declarations. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2493 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2494 Note: This variable together with `c-decl-start-re' and |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2495 `c-decl-start-kwds' is only used to detect \"likely\" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2496 declaration/cast/label starts. I.e. they might produce more matches |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2497 but should not miss anything (or else it's necessary to use text |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2498 properties - see the next note). Wherever they match, the following |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2499 construct is analyzed to see if it indeed is a declaration, cast or |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2500 label. That analysis is not cheap, so it's important that not too |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2501 many false matches are triggered. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2502 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2503 Note: If a declaration/cast/label start can't be detected with this |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2504 variable, it's necessary to use the `c-type' text property with the |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2505 value `c-decl-end' on the last char of the last token preceding the |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2506 declaration. See the comment blurb at the start of cc-engine.el for |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2507 more info." |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2508 |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2509 ;; We match a sequence of characters to skip over things like \"};\" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2510 ;; more quickly. We match ")" in C for K&R region declarations, and |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2511 ;; in all languages except Java for when a cpp macro definition |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2512 ;; begins with a declaration. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2513 t "\\([\{\}\(\);,]+\\)" |
109599
c18dffa2ba46
Enhance Java Mode to handle Java 5.0 (Tiger) and Java 6 (Mustang).
Alan Mackenzie <acm@muc.de>
parents:
107086
diff
changeset
|
2514 java "\\([\{\}\(;,<]+\\)" |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2515 ;; Match "<" in C++ to get the first argument in a template arglist. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2516 ;; In that case there's an additional check in `c-find-decl-spots' |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2517 ;; that it got open paren syntax. |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2518 c++ "\\([\{\}\(\);,<]+\\)" |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2519 ;; Additionally match the protection directives in Objective-C. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2520 ;; Note that this doesn't cope with the longer directives, which we |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2521 ;; would have to match from start to end since they don't end with |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2522 ;; any easily recognized characters. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2523 objc (concat "\\([\{\}\(\);,]+\\|" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2524 (c-make-keywords-re nil (c-lang-const c-protection-kwds)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2525 "\\)") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2526 ;; Pike is like C but we also match "[" for multiple value |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2527 ;; assignments and type casts. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2528 pike "\\([\{\}\(\)\[;,]+\\)") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2529 (c-lang-defvar c-decl-prefix-re (c-lang-const c-decl-prefix-re) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2530 'dont-doc) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2531 |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2532 (c-lang-defconst c-decl-start-re |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2533 "Regexp matching the start of any declaration, cast or label. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2534 It's used on the token after the one `c-decl-prefix-re' matched. This |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2535 regexp should not try to match those constructs accurately as it's |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2536 only used as a sieve to avoid spending more time checking other |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2537 constructs." |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2538 t (c-lang-const c-identifier-start)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2539 (c-lang-defvar c-decl-start-re (c-lang-const c-decl-start-re)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2540 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2541 (c-lang-defconst c-decl-prefix-or-start-re |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2542 ;; Regexp matching something that might precede or start a |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2543 ;; declaration, cast or label. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2544 ;; |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2545 ;; If the first submatch matches, it's taken to match the end of a |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2546 ;; token that might precede such a construct, e.g. ';', '}' or '{'. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2547 ;; It's built from `c-decl-prefix-re'. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2548 ;; |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2549 ;; If the first submatch did not match, the match of the whole |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2550 ;; regexp is taken to be at the first token in the declaration. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2551 ;; `c-decl-start-re' is not checked in this case. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2552 ;; |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2553 ;; Design note: The reason the same regexp is used to match both |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2554 ;; tokens that precede declarations and start them is to avoid an |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2555 ;; extra regexp search from the previous declaration spot in |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2556 ;; `c-find-decl-spots'. Users of `c-find-decl-spots' also count on |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2557 ;; that it finds all declaration/cast/label starts in approximately |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2558 ;; linear order, so we can't do the searches in two separate passes. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2559 t (if (c-lang-const c-decl-start-kwds) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2560 (concat (c-lang-const c-decl-prefix-re) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2561 "\\|" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2562 (c-make-keywords-re t (c-lang-const c-decl-start-kwds))) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2563 (c-lang-const c-decl-prefix-re))) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2564 (c-lang-defvar c-decl-prefix-or-start-re |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2565 (c-lang-const c-decl-prefix-or-start-re) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2566 'dont-doc) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2567 |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2568 (c-lang-defconst c-cast-parens |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2569 ;; List containing the paren characters that can open a cast, or nil in |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2570 ;; languages without casts. |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2571 t (c-filter-ops (c-lang-const c-operators) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2572 '(prefix) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2573 "\\`\\s\(\\'" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2574 (lambda (op) (elt op 0)))) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2575 (c-lang-defvar c-cast-parens (c-lang-const c-cast-parens)) |
36920 | 2576 |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2577 (c-lang-defconst c-block-prefix-disallowed-chars |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2578 "List of syntactically relevant characters that never can occur before |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2579 the open brace in any construct that contains a brace block, e.g. in |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2580 the \"class Foo: public Bar\" part of: |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2581 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2582 class Foo: public Bar {int x();} a, *b; |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2583 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2584 If parens can occur, the chars inside those aren't filtered with this |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2585 list. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2586 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2587 '<' and '>' should be disallowed even if angle bracket arglists can |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2588 occur. That since the search function needs to stop at them anyway to |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2589 ensure they are given paren syntax. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2590 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2591 This is used to skip backward from the open brace to find the region |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2592 in which to look for a construct like \"class\", \"enum\", |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2593 \"namespace\" or whatever. That skipping should be as tight as |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2594 possible for good performance." |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2595 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2596 ;; Default to all chars that only occurs in nonsymbol tokens outside |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2597 ;; identifiers. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2598 t (set-difference |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2599 (c-lang-const c-nonsymbol-token-char-list) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2600 (c-filter-ops (append (c-lang-const c-identifier-ops) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2601 (list (cons nil |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2602 (c-lang-const c-after-id-concat-ops)))) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2603 t |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2604 t |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2605 (lambda (op) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2606 (let ((pos 0) res) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2607 (while (string-match "\\(\\s.\\|\\s(\\|\\s)\\)" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2608 op pos) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2609 (setq res (cons (aref op (match-beginning 1)) res) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2610 pos (match-end 0))) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2611 res)))) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2612 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2613 ;; Allow cpp operatios (where applicable). |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2614 t (if (c-lang-const c-opt-cpp-prefix) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2615 (set-difference (c-lang-const c-block-prefix-disallowed-chars) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2616 '(?#)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2617 (c-lang-const c-block-prefix-disallowed-chars)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2618 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2619 ;; Allow ':' for inherit list starters. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2620 (c++ objc idl) (set-difference (c-lang-const c-block-prefix-disallowed-chars) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2621 '(?:)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2622 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2623 ;; Allow ',' for multiple inherits. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2624 (c++ java) (set-difference (c-lang-const c-block-prefix-disallowed-chars) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2625 '(?,)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2626 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2627 ;; Allow parentheses for anonymous inner classes in Java and class |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2628 ;; initializer lists in Pike. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2629 (java pike) (set-difference (c-lang-const c-block-prefix-disallowed-chars) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2630 '(?\( ?\))) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2631 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2632 ;; Allow '"' for extern clauses (e.g. extern "C" {...}). |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2633 (c c++ objc) (set-difference (c-lang-const c-block-prefix-disallowed-chars) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2634 '(?\" ?'))) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2635 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2636 (c-lang-defconst c-block-prefix-charset |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2637 ;; `c-block-prefix-disallowed-chars' as an inverted charset suitable |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2638 ;; for `c-syntactic-skip-backward'. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2639 t (c-make-bare-char-alt (c-lang-const c-block-prefix-disallowed-chars) t)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2640 (c-lang-defvar c-block-prefix-charset (c-lang-const c-block-prefix-charset)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2641 |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2642 (c-lang-defconst c-type-decl-prefix-key |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2643 "Regexp matching the declarator operators that might precede the |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2644 identifier in a declaration, e.g. the \"*\" in \"char *argv\". This |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2645 regexp should match \"(\" if parentheses are valid in declarators. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2646 The end of the first submatch is taken as the end of the operator. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2647 Identifier syntax is in effect when this is matched \(see |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2648 `c-identifier-syntax-table')." |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2649 t (if (c-lang-const c-type-modifier-kwds) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2650 (concat (regexp-opt (c-lang-const c-type-modifier-kwds) t) "\\>") |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2651 ;; Default to a regexp that never matches. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2652 "\\<\\>") |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2653 ;; Check that there's no "=" afterwards to avoid matching tokens |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2654 ;; like "*=". |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2655 (c objc) (concat "\\(" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2656 "[*\(]" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2657 "\\|" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2658 (c-lang-const c-type-decl-prefix-key) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2659 "\\)" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2660 "\\([^=]\\|$\\)") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2661 c++ (concat "\\(" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2662 "[*\(&]" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2663 "\\|" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2664 (concat "\\(" ; 2 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2665 ;; If this matches there's special treatment in |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2666 ;; `c-font-lock-declarators' and |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2667 ;; `c-font-lock-declarations' that check for a |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2668 ;; complete name followed by ":: *". |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2669 (c-lang-const c-identifier-start) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2670 "\\)") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2671 "\\|" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2672 (c-lang-const c-type-decl-prefix-key) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2673 "\\)" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2674 "\\([^=]\\|$\\)") |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2675 pike "\\(\\*\\)\\([^=]\\|$\\)") |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2676 (c-lang-defvar c-type-decl-prefix-key (c-lang-const c-type-decl-prefix-key) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2677 'dont-doc) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2678 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2679 (c-lang-defconst c-type-decl-suffix-key |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2680 "Regexp matching the declarator operators that might follow after the |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2681 identifier in a declaration, e.g. the \"[\" in \"char argv[]\". This |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2682 regexp should match \")\" if parentheses are valid in declarators. If |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2683 it matches an open paren of some kind, the type declaration check |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2684 continues at the corresponding close paren, otherwise the end of the |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2685 first submatch is taken as the end of the operator. Identifier syntax |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2686 is in effect when this is matched (see `c-identifier-syntax-table')." |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2687 ;; Default to a regexp that matches `c-type-modifier-kwds' and a |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2688 ;; function argument list parenthesis. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2689 t (if (c-lang-const c-type-modifier-kwds) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2690 (concat "\\(\(\\|" |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2691 (regexp-opt (c-lang-const c-type-modifier-kwds) t) "\\>" |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2692 "\\)") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2693 "\\(\(\\)") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2694 (c c++ objc) (concat |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2695 "\\(" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2696 "[\)\[\(]" |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2697 (if (c-lang-const c-type-modifier-kwds) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2698 (concat |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2699 "\\|" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2700 ;; "throw" in `c-type-modifier-kwds' is followed |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2701 ;; by a parenthesis list, but no extra measures |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2702 ;; are necessary to handle that. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2703 (regexp-opt (c-lang-const c-type-modifier-kwds) t) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2704 "\\>") |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2705 "") |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2706 "\\)") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2707 (java idl) "\\([\[\(]\\)") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2708 (c-lang-defvar c-type-decl-suffix-key (c-lang-const c-type-decl-suffix-key) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2709 'dont-doc) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2710 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2711 (c-lang-defconst c-after-suffixed-type-decl-key |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2712 "This regexp is matched after a declarator expression where |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2713 `c-type-decl-suffix-key' has matched. If it matches then the |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2714 construct is taken as a declaration. It's typically used to match the |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2715 beginning of a function body or whatever might occur after the |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2716 function header in a function declaration or definition. It's |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2717 undefined whether identifier syntax (see `c-identifier-syntax-table') |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2718 is in effect or not. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2719 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2720 Note that it's used in cases like after \"foo (bar)\" so it should |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2721 only match when it's certain that it's a declaration, e.g \"{\" but |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2722 not \",\" or \";\"." |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2723 t "{" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2724 ;; If K&R style declarations should be recognized then one could |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2725 ;; consider to match the start of any symbol since we want to match |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2726 ;; the start of the first declaration in the "K&R region". That |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2727 ;; could however produce false matches on code like "FOO(bar) x" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2728 ;; where FOO is a cpp macro, so it's better to leave it out and rely |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2729 ;; on the other heuristics in that case. |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2730 t (if (c-lang-const c-postfix-spec-kwds) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2731 ;; Add on the keywords in `c-postfix-spec-kwds'. |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2732 (concat (c-lang-const c-after-suffixed-type-decl-key) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2733 "\\|" |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2734 (c-make-keywords-re t (c-lang-const c-postfix-spec-kwds))) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2735 (c-lang-const c-after-suffixed-type-decl-key)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2736 ;; Also match the colon that starts a base class initializer list in |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2737 ;; C++. That can be confused with a function call before the colon |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2738 ;; in a ? : operator, but we count on that `c-decl-prefix-re' won't |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2739 ;; match before such a thing (as a declaration-level construct; |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2740 ;; matches inside arglist contexts are already excluded). |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2741 c++ "[{:]") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2742 (c-lang-defvar c-after-suffixed-type-decl-key |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2743 (c-lang-const c-after-suffixed-type-decl-key) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2744 'dont-doc) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2745 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2746 (c-lang-defconst c-after-suffixed-type-maybe-decl-key |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2747 ;; Regexp that in addition to `c-after-suffixed-type-decl-key' |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2748 ;; matches ";" and ",". |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2749 t (concat "\\(" (c-lang-const c-after-suffixed-type-decl-key) "\\)" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2750 "\\|[;,]")) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2751 (c-lang-defvar c-after-suffixed-type-maybe-decl-key |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2752 (c-lang-const c-after-suffixed-type-maybe-decl-key)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2753 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2754 (c-lang-defconst c-opt-type-concat-key |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2755 "Regexp matching operators that concatenate types, e.g. the \"|\" in |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2756 \"int|string\" in Pike. The end of the first submatch is taken as the |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2757 end of the operator. nil in languages without such operators. It's |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2758 undefined whether identifier syntax (see `c-identifier-syntax-table') |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2759 is in effect or not." |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2760 t nil |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2761 pike "\\([|.&]\\)\\($\\|[^|.&]\\)") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2762 (c-lang-defvar c-opt-type-concat-key (c-lang-const c-opt-type-concat-key) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2763 'dont-doc) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2764 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2765 (c-lang-defconst c-opt-type-suffix-key |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2766 "Regexp matching operators that might follow after a type, or nil in |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2767 languages that don't have such operators. The end of the first |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2768 submatch is taken as the end of the operator. This should not match |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2769 things like C++ template arglists if `c-recognize-<>-arglists' is set. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2770 It's undefined whether identifier syntax (see `c-identifier-syntax-table') |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2771 is in effect or not." |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2772 t nil |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2773 (c c++ objc pike) "\\(\\.\\.\\.\\)" |
109599
c18dffa2ba46
Enhance Java Mode to handle Java 5.0 (Tiger) and Java 6 (Mustang).
Alan Mackenzie <acm@muc.de>
parents:
107086
diff
changeset
|
2774 java (concat "\\(\\[" (c-lang-const c-simple-ws) "*\\]\\|\\.\\.\\.\\)")) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2775 (c-lang-defvar c-opt-type-suffix-key (c-lang-const c-opt-type-suffix-key)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2776 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2777 (c-lang-defvar c-known-type-key |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2778 ;; Regexp matching the known type identifiers. This is initialized |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2779 ;; from the type keywords and `*-font-lock-extra-types'. The first |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2780 ;; submatch is the one that matches the type. Note that this regexp |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2781 ;; assumes that symbol constituents like '_' and '$' have word |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2782 ;; syntax. |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2783 (let* ((extra-types |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2784 (when (boundp (c-mode-symbol "font-lock-extra-types")) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2785 (c-mode-var "font-lock-extra-types"))) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2786 (regexp-strings |
67278
cf00aa89f148
Relace a `mapcan' with an "apply (n-conc (mapcar ....... ))".
Alan Mackenzie <acm@muc.de>
parents:
67252
diff
changeset
|
2787 (apply 'nconc |
cf00aa89f148
Relace a `mapcan' with an "apply (n-conc (mapcar ....... ))".
Alan Mackenzie <acm@muc.de>
parents:
67252
diff
changeset
|
2788 (mapcar (lambda (re) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2789 (when (string-match "[][.*+?^$\\]" re) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2790 (list re))) |
67278
cf00aa89f148
Relace a `mapcan' with an "apply (n-conc (mapcar ....... ))".
Alan Mackenzie <acm@muc.de>
parents:
67252
diff
changeset
|
2791 extra-types))) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2792 (plain-strings |
67278
cf00aa89f148
Relace a `mapcan' with an "apply (n-conc (mapcar ....... ))".
Alan Mackenzie <acm@muc.de>
parents:
67252
diff
changeset
|
2793 (apply 'nconc |
cf00aa89f148
Relace a `mapcan' with an "apply (n-conc (mapcar ....... ))".
Alan Mackenzie <acm@muc.de>
parents:
67252
diff
changeset
|
2794 (mapcar (lambda (re) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2795 (unless (string-match "[][.*+?^$\\]" re) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2796 (list re))) |
67278
cf00aa89f148
Relace a `mapcan' with an "apply (n-conc (mapcar ....... ))".
Alan Mackenzie <acm@muc.de>
parents:
67252
diff
changeset
|
2797 extra-types)))) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2798 (concat "\\<\\(" |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2799 (c-concat-separated |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2800 (append (list (c-make-keywords-re nil |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2801 (append (c-lang-const c-primitive-type-kwds) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2802 plain-strings))) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2803 regexp-strings) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2804 "\\|") |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2805 "\\)\\>"))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2806 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2807 (c-lang-defconst c-special-brace-lists |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2808 "List of open- and close-chars that makes up a pike-style brace list, |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2809 i.e. for a ([ ]) list there should be a cons (?\\[ . ?\\]) in this |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2810 list." |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2811 t nil |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2812 pike '((?{ . ?}) (?\[ . ?\]) (?< . ?>))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2813 (c-lang-defvar c-special-brace-lists (c-lang-const c-special-brace-lists)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2814 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2815 (c-lang-defconst c-recognize-knr-p |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2816 "Non-nil means K&R style argument declarations are valid." |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2817 t nil |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2818 c t) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2819 (c-lang-defvar c-recognize-knr-p (c-lang-const c-recognize-knr-p)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2820 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2821 (c-lang-defconst c-recognize-typeless-decls |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2822 "Non-nil means function declarations without return type should be |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2823 recognized. That can introduce an ambiguity with parenthesized macro |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2824 calls before a brace block. This setting does not affect declarations |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2825 that are preceded by a declaration starting keyword, so |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2826 e.g. `c-typeless-decl-kwds' may still be used when it's set to nil." |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2827 t nil |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2828 (c c++ objc) t) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2829 (c-lang-defvar c-recognize-typeless-decls |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2830 (c-lang-const c-recognize-typeless-decls)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2831 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2832 (c-lang-defconst c-recognize-<>-arglists |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2833 "Non-nil means C++ style template arglists should be handled. More |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2834 specifically, this means a comma separated list of types or |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2835 expressions surrounded by \"<\" and \">\". It's always preceded by an |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2836 identifier or one of the keywords on `c-<>-type-kwds' or |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2837 `c-<>-arglist-kwds'. If there's an identifier before then the whole |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2838 expression is considered to be a type." |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2839 t (or (consp (c-lang-const c-<>-type-kwds)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2840 (consp (c-lang-const c-<>-arglist-kwds)))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2841 (c-lang-defvar c-recognize-<>-arglists (c-lang-const c-recognize-<>-arglists)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2842 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2843 (c-lang-defconst c-recognize-paren-inits |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2844 "Non-nil means that parenthesis style initializers exist, |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2845 i.e. constructs like |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2846 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2847 Foo bar (gnu); |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2848 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2849 in addition to the more classic |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2850 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2851 Foo bar = gnu;" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2852 t nil |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2853 c++ t) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2854 (c-lang-defvar c-recognize-paren-inits (c-lang-const c-recognize-paren-inits)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2855 |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2856 (c-lang-defconst c-recognize-paren-inexpr-blocks |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2857 "Non-nil to recognize gcc style in-expression blocks, |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2858 i.e. compound statements surrounded by parentheses inside expressions." |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2859 t nil |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2860 (c c++) t) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2861 (c-lang-defvar c-recognize-paren-inexpr-blocks |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2862 (c-lang-const c-recognize-paren-inexpr-blocks)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2863 |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2864 (c-lang-defconst c-opt-<>-arglist-start |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2865 ;; Regexp matching the start of angle bracket arglists in languages |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2866 ;; where `c-recognize-<>-arglists' is set. Does not exclude |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2867 ;; keywords outside `c-<>-arglist-kwds'. The first submatch is |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2868 ;; assumed to surround the preceding symbol. The whole match is |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2869 ;; assumed to end directly after the opening "<". |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2870 t (if (c-lang-const c-recognize-<>-arglists) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2871 (concat "\\(" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2872 (c-lang-const c-symbol-key) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2873 "\\)" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2874 (c-lang-const c-syntactic-ws) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2875 "<"))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2876 (c-lang-defvar c-opt-<>-arglist-start (c-lang-const c-opt-<>-arglist-start)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2877 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2878 (c-lang-defconst c-opt-<>-arglist-start-in-paren |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2879 ;; Regexp that in addition to `c-opt-<>-arglist-start' matches close |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2880 ;; parens. The first submatch is assumed to surround |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2881 ;; `c-opt-<>-arglist-start'. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2882 t (if (c-lang-const c-opt-<>-arglist-start) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2883 (concat "\\(" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2884 (c-lang-const c-opt-<>-arglist-start) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2885 "\\)\\|\\s\)"))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2886 (c-lang-defvar c-opt-<>-arglist-start-in-paren |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2887 (c-lang-const c-opt-<>-arglist-start-in-paren)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2888 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2889 (c-lang-defconst c-opt-postfix-decl-spec-key |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2890 ;; Regexp matching the beginning of a declaration specifier in the |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2891 ;; region between the header and the body of a declaration. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2892 ;; |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2893 ;; TODO: This is currently not used uniformly; c++-mode and |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2894 ;; java-mode each have their own ways of using it. |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2895 t nil |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2896 c++ (concat ":?" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2897 (c-lang-const c-simple-ws) "*" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2898 "\\(virtual" (c-lang-const c-simple-ws) "+\\)?\\(" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2899 (c-make-keywords-re nil (c-lang-const c-protection-kwds)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2900 "\\)" (c-lang-const c-simple-ws) "+" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2901 "\\(" (c-lang-const c-symbol-key) "\\)") |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2902 java (c-make-keywords-re t (c-lang-const c-postfix-spec-kwds))) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2903 (c-lang-defvar c-opt-postfix-decl-spec-key |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2904 (c-lang-const c-opt-postfix-decl-spec-key)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2905 |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2906 (c-lang-defconst c-recognize-colon-labels |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2907 "Non-nil if generic labels ending with \":\" should be recognized. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2908 That includes labels in code and access keys in classes. This does |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2909 not apply to labels recognized by `c-label-kwds' and |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2910 `c-opt-extra-label-key'." |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2911 t nil |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2912 (c c++ objc java pike) t) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2913 (c-lang-defvar c-recognize-colon-labels |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2914 (c-lang-const c-recognize-colon-labels)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2915 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2916 (c-lang-defconst c-label-prefix-re |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2917 "Regexp like `c-decl-prefix-re' that matches any token that can precede |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2918 a generic colon label. Not used if `c-recognize-colon-labels' is |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2919 nil." |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2920 t "\\([{};]+\\)") |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2921 (c-lang-defvar c-label-prefix-re |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2922 (c-lang-const c-label-prefix-re)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2923 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2924 (c-lang-defconst c-nonlabel-token-key |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2925 "Regexp matching things that can't occur in generic colon labels, |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2926 neither in a statement nor in a declaration context. The regexp is |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2927 tested at the beginning of every sexp in a suspected label, |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2928 i.e. before \":\". Only used if `c-recognize-colon-labels' is set." |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2929 t (concat |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2930 ;; Don't allow string literals. |
105206
60cf2b54da00
cc-langs.el (c-nonlabel-token-key): Allow quoted character constants (as
Alan Mackenzie <acm@muc.de>
parents:
103260
diff
changeset
|
2931 "\"\\|" |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2932 ;; All keywords except `c-label-kwds' and `c-protection-kwds'. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2933 (c-make-keywords-re t |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2934 (set-difference (c-lang-const c-keywords) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2935 (append (c-lang-const c-label-kwds) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2936 (c-lang-const c-protection-kwds)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2937 :test 'string-equal))) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2938 ;; Also check for open parens in C++, to catch member init lists in |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2939 ;; constructors. We normally allow it so that macros with arguments |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2940 ;; work in labels. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2941 c++ (concat "\\s\(\\|" (c-lang-const c-nonlabel-token-key))) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2942 (c-lang-defvar c-nonlabel-token-key (c-lang-const c-nonlabel-token-key)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2943 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2944 (c-lang-defconst c-opt-extra-label-key |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2945 "Optional regexp matching labels. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2946 Normally, labels are detected according to `c-nonlabel-token-key', |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2947 `c-decl-prefix-re' and `c-nonlabel-decl-prefix-re'. This regexp can |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2948 be used if there are additional labels that aren't recognized that |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2949 way." |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2950 t nil |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2951 objc (c-make-keywords-re t (c-lang-const c-protection-kwds))) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2952 (c-lang-defvar c-opt-extra-label-key (c-lang-const c-opt-extra-label-key)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2953 |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2954 (c-lang-defconst c-opt-friend-key |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2955 ;; Regexp describing friend declarations classes, or nil in |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2956 ;; languages that don't have such things. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2957 ;; |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2958 ;; TODO: Ought to use `c-prefix-spec-kwds-re' or similar, and the |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2959 ;; template skipping isn't done properly. This will disappear soon. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2960 t nil |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2961 c++ (concat "friend" (c-lang-const c-simple-ws) "+" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2962 "\\|" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2963 (concat "template" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2964 (c-lang-const c-simple-ws) "*" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2965 "<.+>" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2966 (c-lang-const c-simple-ws) "*" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2967 "friend" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2968 (c-lang-const c-simple-ws) "+"))) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2969 (c-lang-defvar c-opt-friend-key (c-lang-const c-opt-friend-key)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2970 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2971 (c-lang-defconst c-opt-method-key |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2972 ;; Special regexp to match the start of Objective-C methods. The |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2973 ;; first submatch is assumed to end after the + or - key. |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2974 t nil |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2975 objc (concat |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2976 ;; TODO: Ought to use a better method than anchoring on bol. |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2977 "^\\s *" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2978 "\\([+-]\\)" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2979 (c-lang-const c-simple-ws) "*" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2980 (concat "\\(" ; Return type. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2981 "([^\)]*)" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2982 (c-lang-const c-simple-ws) "*" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2983 "\\)?") |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2984 "\\(" (c-lang-const c-symbol-key) "\\)")) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2985 (c-lang-defvar c-opt-method-key (c-lang-const c-opt-method-key)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
2986 |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2987 (c-lang-defconst c-type-decl-end-used |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2988 ;; Must be set in buffers where the `c-type' text property might be |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2989 ;; used with the value `c-decl-end'. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2990 ;; |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2991 ;; `c-decl-end' is used to mark the ends of labels and access keys |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2992 ;; to make interactive refontification work better. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2993 t (or (c-lang-const c-recognize-colon-labels) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2994 (and (c-lang-const c-label-kwds) t)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2995 ;; `c-decl-end' is used to mark the end of the @-style directives in |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2996 ;; Objective-C. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2997 objc t) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2998 (c-lang-defvar c-type-decl-end-used (c-lang-const c-type-decl-end-used)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
2999 |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3000 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3001 ;;; Wrap up the `c-lang-defvar' system. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3002 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3003 ;; Compile in the list of language variables that has been collected |
72031
2b53c13e6121
* progmodes/cc-langs.el (c-emacs-variable-inits): new variable.
Alan Mackenzie <acm@muc.de>
parents:
71754
diff
changeset
|
3004 ;; with the `c-lang-defvar' and `c-lang-setvar' macros. Note that the |
2b53c13e6121
* progmodes/cc-langs.el (c-emacs-variable-inits): new variable.
Alan Mackenzie <acm@muc.de>
parents:
71754
diff
changeset
|
3005 ;; first element of each is nil. |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3006 (defconst c-lang-variable-inits (cc-eval-when-compile c-lang-variable-inits)) |
72031
2b53c13e6121
* progmodes/cc-langs.el (c-emacs-variable-inits): new variable.
Alan Mackenzie <acm@muc.de>
parents:
71754
diff
changeset
|
3007 (defconst c-emacs-variable-inits (cc-eval-when-compile c-emacs-variable-inits)) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3008 |
78354
d80d780fd6b4
Fix problem with modes derived from CC Mode: Move macro
Alan Mackenzie <acm@muc.de>
parents:
78234
diff
changeset
|
3009 ;; Make the `c-lang-setvar' variables buffer local in the current buffer. |
d80d780fd6b4
Fix problem with modes derived from CC Mode: Move macro
Alan Mackenzie <acm@muc.de>
parents:
78234
diff
changeset
|
3010 ;; These are typically standard emacs variables such as `comment-start'. |
d80d780fd6b4
Fix problem with modes derived from CC Mode: Move macro
Alan Mackenzie <acm@muc.de>
parents:
78234
diff
changeset
|
3011 (defmacro c-make-emacs-variables-local () |
d80d780fd6b4
Fix problem with modes derived from CC Mode: Move macro
Alan Mackenzie <acm@muc.de>
parents:
78234
diff
changeset
|
3012 `(progn |
d80d780fd6b4
Fix problem with modes derived from CC Mode: Move macro
Alan Mackenzie <acm@muc.de>
parents:
78234
diff
changeset
|
3013 ,@(mapcar (lambda (init) |
d80d780fd6b4
Fix problem with modes derived from CC Mode: Move macro
Alan Mackenzie <acm@muc.de>
parents:
78234
diff
changeset
|
3014 `(make-local-variable ',(car init))) |
d80d780fd6b4
Fix problem with modes derived from CC Mode: Move macro
Alan Mackenzie <acm@muc.de>
parents:
78234
diff
changeset
|
3015 (cdr c-emacs-variable-inits)))) |
d80d780fd6b4
Fix problem with modes derived from CC Mode: Move macro
Alan Mackenzie <acm@muc.de>
parents:
78234
diff
changeset
|
3016 |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3017 (defun c-make-init-lang-vars-fun (mode) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3018 "Create a function that initializes all the language dependent variables |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3019 for the given mode. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3020 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3021 This function should be evaluated at compile time, so that the |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3022 function it returns is byte compiled with all the evaluated results |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3023 from the language constants. Use the `c-init-language-vars' macro to |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
3024 accomplish that conveniently." |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3025 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3026 (if (and (not load-in-progress) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3027 (boundp 'byte-compile-dest-file) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3028 (stringp byte-compile-dest-file)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3029 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3030 ;; No need to byte compile this lambda since the byte compiler is |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3031 ;; smart enough to detect the `funcall' construct in the |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3032 ;; `c-init-language-vars' macro below and compile it all straight |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3033 ;; into the function that contains `c-init-language-vars'. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3034 `(lambda () |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3035 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3036 ;; This let sets up the context for `c-mode-var' and similar |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3037 ;; that could be in the result from `cl-macroexpand-all'. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3038 (let ((c-buffer-is-cc-mode ',mode) |
69140
3d8b060d10fb
cc-align.el, cc-awk.el, cc-bytecomp.el, cc-cmds.el, cc-compat.el,
Alan Mackenzie <acm@muc.de>
parents:
68773
diff
changeset
|
3039 current-var source-eval) |
78354
d80d780fd6b4
Fix problem with modes derived from CC Mode: Move macro
Alan Mackenzie <acm@muc.de>
parents:
78234
diff
changeset
|
3040 (c-make-emacs-variables-local) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3041 (condition-case err |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3042 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3043 (if (eq c-version-sym ',c-version-sym) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3044 (setq ,@(let ((c-buffer-is-cc-mode mode) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3045 (c-lang-const-expansion 'immediate)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3046 ;; `c-lang-const' will expand to the evaluated |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3047 ;; constant immediately in `cl-macroexpand-all' |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3048 ;; below. |
72031
2b53c13e6121
* progmodes/cc-langs.el (c-emacs-variable-inits): new variable.
Alan Mackenzie <acm@muc.de>
parents:
71754
diff
changeset
|
3049 (mapcan |
2b53c13e6121
* progmodes/cc-langs.el (c-emacs-variable-inits): new variable.
Alan Mackenzie <acm@muc.de>
parents:
71754
diff
changeset
|
3050 (lambda (init) |
2b53c13e6121
* progmodes/cc-langs.el (c-emacs-variable-inits): new variable.
Alan Mackenzie <acm@muc.de>
parents:
71754
diff
changeset
|
3051 `(current-var ',(car init) |
2b53c13e6121
* progmodes/cc-langs.el (c-emacs-variable-inits): new variable.
Alan Mackenzie <acm@muc.de>
parents:
71754
diff
changeset
|
3052 ,(car init) ,(cl-macroexpand-all |
2b53c13e6121
* progmodes/cc-langs.el (c-emacs-variable-inits): new variable.
Alan Mackenzie <acm@muc.de>
parents:
71754
diff
changeset
|
3053 (elt init 1)))) |
2b53c13e6121
* progmodes/cc-langs.el (c-emacs-variable-inits): new variable.
Alan Mackenzie <acm@muc.de>
parents:
71754
diff
changeset
|
3054 ;; Note: The following `append' copies the |
2b53c13e6121
* progmodes/cc-langs.el (c-emacs-variable-inits): new variable.
Alan Mackenzie <acm@muc.de>
parents:
71754
diff
changeset
|
3055 ;; first argument. That list is small, so |
2b53c13e6121
* progmodes/cc-langs.el (c-emacs-variable-inits): new variable.
Alan Mackenzie <acm@muc.de>
parents:
71754
diff
changeset
|
3056 ;; this doesn't matter too much. |
2b53c13e6121
* progmodes/cc-langs.el (c-emacs-variable-inits): new variable.
Alan Mackenzie <acm@muc.de>
parents:
71754
diff
changeset
|
3057 (append (cdr c-emacs-variable-inits) |
2b53c13e6121
* progmodes/cc-langs.el (c-emacs-variable-inits): new variable.
Alan Mackenzie <acm@muc.de>
parents:
71754
diff
changeset
|
3058 (cdr c-lang-variable-inits))))) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3059 |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
3060 ;; This diagnostic message isn't useful for end |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
3061 ;; users, so it's disabled. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
3062 ;;(unless (get ',mode 'c-has-warned-lang-consts) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
3063 ;; (message ,(concat "%s compiled with CC Mode %s " |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
3064 ;; "but loaded with %s - evaluating " |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
3065 ;; "language constants from source") |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
3066 ;; ',mode ,c-version c-version) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
3067 ;; (put ',mode 'c-has-warned-lang-consts t)) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3068 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3069 (require 'cc-langs) |
69140
3d8b060d10fb
cc-align.el, cc-awk.el, cc-bytecomp.el, cc-cmds.el, cc-compat.el,
Alan Mackenzie <acm@muc.de>
parents:
68773
diff
changeset
|
3070 (setq source-eval t) |
72031
2b53c13e6121
* progmodes/cc-langs.el (c-emacs-variable-inits): new variable.
Alan Mackenzie <acm@muc.de>
parents:
71754
diff
changeset
|
3071 (let ((init (append (cdr c-emacs-variable-inits) |
2b53c13e6121
* progmodes/cc-langs.el (c-emacs-variable-inits): new variable.
Alan Mackenzie <acm@muc.de>
parents:
71754
diff
changeset
|
3072 (cdr c-lang-variable-inits)))) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3073 (while init |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3074 (setq current-var (caar init)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3075 (set (caar init) (eval (cadar init))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3076 (setq init (cdr init))))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3077 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3078 (error |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3079 (if current-var |
72031
2b53c13e6121
* progmodes/cc-langs.el (c-emacs-variable-inits): new variable.
Alan Mackenzie <acm@muc.de>
parents:
71754
diff
changeset
|
3080 (message "Eval error in the `c-lang-defvar' or `c-lang-setvar' for `%s'%s: %S" |
69140
3d8b060d10fb
cc-align.el, cc-awk.el, cc-bytecomp.el, cc-cmds.el, cc-compat.el,
Alan Mackenzie <acm@muc.de>
parents:
68773
diff
changeset
|
3081 current-var |
3d8b060d10fb
cc-align.el, cc-awk.el, cc-bytecomp.el, cc-cmds.el, cc-compat.el,
Alan Mackenzie <acm@muc.de>
parents:
68773
diff
changeset
|
3082 (if source-eval |
3d8b060d10fb
cc-align.el, cc-awk.el, cc-bytecomp.el, cc-cmds.el, cc-compat.el,
Alan Mackenzie <acm@muc.de>
parents:
68773
diff
changeset
|
3083 (format "\ |
3d8b060d10fb
cc-align.el, cc-awk.el, cc-bytecomp.el, cc-cmds.el, cc-compat.el,
Alan Mackenzie <acm@muc.de>
parents:
68773
diff
changeset
|
3084 (fallback source eval - %s compiled with CC Mode %s but loaded with %s)" |
3d8b060d10fb
cc-align.el, cc-awk.el, cc-bytecomp.el, cc-cmds.el, cc-compat.el,
Alan Mackenzie <acm@muc.de>
parents:
68773
diff
changeset
|
3085 ',mode ,c-version c-version) |
3d8b060d10fb
cc-align.el, cc-awk.el, cc-bytecomp.el, cc-cmds.el, cc-compat.el,
Alan Mackenzie <acm@muc.de>
parents:
68773
diff
changeset
|
3086 "") |
3d8b060d10fb
cc-align.el, cc-awk.el, cc-bytecomp.el, cc-cmds.el, cc-compat.el,
Alan Mackenzie <acm@muc.de>
parents:
68773
diff
changeset
|
3087 err) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3088 (signal (car err) (cdr err))))))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3089 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3090 ;; Being evaluated from source. Always use the dynamic method to |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3091 ;; work well when `c-lang-defvar's in this file are reevaluated |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3092 ;; interactively. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3093 `(lambda () |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3094 (require 'cc-langs) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3095 (let ((c-buffer-is-cc-mode ',mode) |
72031
2b53c13e6121
* progmodes/cc-langs.el (c-emacs-variable-inits): new variable.
Alan Mackenzie <acm@muc.de>
parents:
71754
diff
changeset
|
3096 (init (append (cdr c-emacs-variable-inits) |
2b53c13e6121
* progmodes/cc-langs.el (c-emacs-variable-inits): new variable.
Alan Mackenzie <acm@muc.de>
parents:
71754
diff
changeset
|
3097 (cdr c-lang-variable-inits))) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3098 current-var) |
78354
d80d780fd6b4
Fix problem with modes derived from CC Mode: Move macro
Alan Mackenzie <acm@muc.de>
parents:
78234
diff
changeset
|
3099 (c-make-emacs-variables-local) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3100 (condition-case err |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3101 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3102 (while init |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3103 (setq current-var (caar init)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3104 (set (caar init) (eval (cadar init))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3105 (setq init (cdr init))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3106 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3107 (error |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3108 (if current-var |
69140
3d8b060d10fb
cc-align.el, cc-awk.el, cc-bytecomp.el, cc-cmds.el, cc-compat.el,
Alan Mackenzie <acm@muc.de>
parents:
68773
diff
changeset
|
3109 (message |
72031
2b53c13e6121
* progmodes/cc-langs.el (c-emacs-variable-inits): new variable.
Alan Mackenzie <acm@muc.de>
parents:
71754
diff
changeset
|
3110 "Eval error in the `c-lang-defvar' or `c-lang-setver' for `%s' (source eval): %S" |
69140
3d8b060d10fb
cc-align.el, cc-awk.el, cc-bytecomp.el, cc-cmds.el, cc-compat.el,
Alan Mackenzie <acm@muc.de>
parents:
68773
diff
changeset
|
3111 current-var err) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3112 (signal (car err) (cdr err))))))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3113 )) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3114 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3115 (defmacro c-init-language-vars (mode) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3116 "Initialize all the language dependent variables for the given mode. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3117 This macro is expanded at compile time to a form tailored for the mode |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3118 in question, so MODE must be a constant. Therefore MODE is not |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
3119 evaluated and should not be quoted." |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
50983
diff
changeset
|
3120 `(funcall ,(c-make-init-lang-vars-fun mode))) |
36920 | 3121 |
19250 | 3122 |
36920 | 3123 (cc-provide 'cc-langs) |
38422
7a94f1c588c4
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
36920
diff
changeset
|
3124 |
93975
1e3a407766b9
Fix up comment convention on the arch-tag lines.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
93803
diff
changeset
|
3125 ;; arch-tag: 1ab57482-cfc2-4c5b-b628-3539c3098822 |
18720 | 3126 ;;; cc-langs.el ends here |