annotate lisp/progmodes/cc-langs.el @ 54190:6a7a401e1598

Doc fix.
author Vinicius Jose Latorre <viniciusjl@ig.com.br>
date Sat, 28 Feb 2004 21:37:17 +0000
parents 28b12b0193f6
children b7446b6f097d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
36920
32a4317c6aa5 Update to version 5.28.
Gerd Moellmann <gerd@gnu.org>
parents: 34342
diff changeset
1 ;;; cc-langs.el --- language specific settings for CC Mode
18720
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2
51714
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
3 ;; Copyright (C) 1985,1987,1992-2003 Free Software Foundation, Inc.
18720
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4
51714
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
5 ;; Authors: 1998- Martin Stjernholm
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
6 ;; 1992-1999 Barry A. Warsaw
18720
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
7 ;; 1987 Dave Detlefs and Stewart Clamen
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
8 ;; 1985 Richard M. Stallman
24282
5b0864259a4b Installed CC Mode 5.25.
Barry A. Warsaw <barry@zope.org>
parents: 22423
diff changeset
9 ;; Maintainer: bug-cc-mode@gnu.org
18720
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
10 ;; Created: 22-Apr-1997 (split from cc-mode.el)
20141
1a85b213eb6d Remove version number.
Karl Heuer <kwzh@gnu.org>
parents: 20138
diff changeset
11 ;; Version: See cc-mode.el
18720
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
12 ;; Keywords: c languages oop
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
13
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
14 ;; This file is part of GNU Emacs.
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
15
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
16 ;; GNU Emacs is free software; you can redistribute it and/or modify
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
17 ;; it under the terms of the GNU General Public License as published by
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
18 ;; the Free Software Foundation; either version 2, or (at your option)
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
19 ;; any later version.
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
20
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
21 ;; GNU Emacs is distributed in the hope that it will be useful,
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
22 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
23 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
24 ;; GNU General Public License for more details.
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
25
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
26 ;; You should have received a copy of the GNU General Public License
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
27 ;; along with GNU Emacs; see the file COPYING. If not, write to
36920
32a4317c6aa5 Update to version 5.28.
Gerd Moellmann <gerd@gnu.org>
parents: 34342
diff changeset
28 ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18720
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
29 ;; Boston, MA 02111-1307, USA.
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
30
38422
7a94f1c588c4 Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 36920
diff changeset
31 ;;; Commentary:
7a94f1c588c4 Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 36920
diff changeset
32
51714
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
33 ;; 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
34 ;; 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
35 ;; 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
36 ;; this:
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
37 ;;
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
38 ;; 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
39 ;; 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
40 ;; cc-mode.el) is byte compiled.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
41 ;; 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
42 ;; `*-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
43 ;; 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
44 ;; 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
45 ;; 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
46
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
47 ;;; 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
48 ;;
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
49 ;; 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
50 ;; 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
51 ;; 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
52 ;; 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
53 ;; code can be shared.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
54 ;;
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
55 ;; 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
56 ;; 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
57 ;; 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
58 ;; 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
59 ;; the code at runtime.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
60 ;;
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
61 ;; 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
62 ;; 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
63 ;; 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
64 ;; 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
65 ;; 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
66 ;; 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
67 ;; 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
68 ;; 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
69 ;; 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
70 ;; 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
71 ;; 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
72 ;;
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
73 ;; 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
74 ;; 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
75 ;; 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
76 ;; 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
77 ;; 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
78 ;; 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
79 ;; 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
80 ;; 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
81 ;; 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
82 ;; 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
83 ;;
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
84 ;; 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
85 ;; 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
86 ;; 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
87 ;; 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
88 ;; 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
89 ;; 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
90 ;; 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
91 ;; 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
92 ;; 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
93 ;; 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
94 ;;
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
95 ;; 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
96 ;; <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
97 ;; 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
98
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
99 ;;; Using language variables:
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 ;; 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
102 ;; 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
103 ;; `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
104 ;; 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
105 ;; 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
106 ;; 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
107 ;; 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
108 ;; `c-init-language-vars' macro.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
109
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
110 ;; 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
111 ;; 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
112 ;; language constants are requested.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
113
38422
7a94f1c588c4 Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 36920
diff changeset
114 ;;; Code:
7a94f1c588c4 Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 36920
diff changeset
115
26817
03befb219d03 Installed version 5.26
Gerd Moellmann <gerd@gnu.org>
parents: 24282
diff changeset
116 (eval-when-compile
03befb219d03 Installed version 5.26
Gerd Moellmann <gerd@gnu.org>
parents: 24282
diff changeset
117 (let ((load-path
36920
32a4317c6aa5 Update to version 5.28.
Gerd Moellmann <gerd@gnu.org>
parents: 34342
diff changeset
118 (if (and (boundp 'byte-compile-dest-file)
32a4317c6aa5 Update to version 5.28.
Gerd Moellmann <gerd@gnu.org>
parents: 34342
diff changeset
119 (stringp byte-compile-dest-file))
32a4317c6aa5 Update to version 5.28.
Gerd Moellmann <gerd@gnu.org>
parents: 34342
diff changeset
120 (cons (file-name-directory byte-compile-dest-file) load-path)
26817
03befb219d03 Installed version 5.26
Gerd Moellmann <gerd@gnu.org>
parents: 24282
diff changeset
121 load-path)))
51714
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
122 (load "cc-bytecomp" nil t)))
26817
03befb219d03 Installed version 5.26
Gerd Moellmann <gerd@gnu.org>
parents: 24282
diff changeset
123
36920
32a4317c6aa5 Update to version 5.28.
Gerd Moellmann <gerd@gnu.org>
parents: 34342
diff changeset
124 (cc-require 'cc-defs)
32a4317c6aa5 Update to version 5.28.
Gerd Moellmann <gerd@gnu.org>
parents: 34342
diff changeset
125 (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
126
18720
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
127
51714
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
128 ;;; 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
129
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
130 (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
131 ;; These are used to collect the init forms from the subsequent
51714
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
132 ;; `c-lang-defvar'. They are used to build the lambda in
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
133 ;; `c-make-init-lang-vars-fun' below.
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
134 (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
135 (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
136 (setq c-lang-variable-inits (list 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
137 c-lang-variable-inits-tail c-lang-variable-inits))
36920
32a4317c6aa5 Update to version 5.28.
Gerd Moellmann <gerd@gnu.org>
parents: 34342
diff changeset
138
51714
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
139 (defmacro c-lang-defvar (var val &optional doc)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
140 "Declares the buffer local variable VAR to get the value VAL at mode
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
141 initialization, at which point VAL is evaluated. More accurately, VAL
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
142 is evaluated and bound to VAR when the result from the macro
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
143 `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
144
51714
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
145 `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
146 language being initialized, and such calls will be macro expanded to
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
147 the evaluated constant value at compile time.
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
148
51714
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
149 This macro does not do any hidden buffer changes."
36920
32a4317c6aa5 Update to version 5.28.
Gerd Moellmann <gerd@gnu.org>
parents: 34342
diff changeset
150
51714
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
151 (when (and (not doc)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
152 (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
153 (eq (nth 1 val) var)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
154 (not (nth 2 val)))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
155 ;; 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
156 ;; 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
157 ;; 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
158 (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
159 'variable-documentation)))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
160 (or (stringp doc)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
161 (setq doc nil))
18720
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
162
51714
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
163 (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
164 (if elem
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
165 (setcdr elem (list val doc))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
166 (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
167 (setq c-lang-variable-inits-tail (cdr c-lang-variable-inits-tail))))
18720
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
168
51714
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
169 ;; 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
170 `',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
171
51714
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
172 (put 'c-lang-defvar 'lisp-indent-function 'defun)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
173 (eval-after-load "edebug"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
174 '(def-edebug-spec c-lang-defvar
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
175 (&define name def-form &optional stringp)))
18720
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
176
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
177
51714
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
178 ;;; 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
179
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
180 (c-lang-defconst c-mode-menu
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
181 ;; 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
182 ;; 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
183 t `(["Comment Out Region" comment-region
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
184 (c-fn-region-is-active-p)]
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
185 ["Uncomment Region" (comment-region (region-beginning)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
186 (region-end) '(4))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
187 (c-fn-region-is-active-p)]
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
188 ["Indent Expression" c-indent-exp
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
189 (memq (char-after) '(?\( ?\[ ?\{))]
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
190 ["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
191 ["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
192 "----"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
193 ["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
194 ["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
195 ,@(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
196 ;; 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
197 `(["Up Conditional" c-up-conditional t]
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
198 ["Backward Conditional" c-backward-conditional t]
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
199 ["Forward Conditional" c-forward-conditional t]
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
200 "----"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
201 ["Macro Expand Region" c-macro-expand
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
202 (c-fn-region-is-active-p)]
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
203 ["Backslashify" c-backslash-region
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
204 (c-fn-region-is-active-p)]))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
205 "----"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
206 ("Toggle..."
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
207 ["Syntactic indentation" c-toggle-syntactic-indentation t]
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
208 ["Auto newline" c-toggle-auto-state t]
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
209 ["Hungry delete" c-toggle-hungry-state t])))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
210
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
211
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
212 ;;; Syntax tables.
18720
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
213
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
214 (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
215 "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
216 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
217 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
218 \"/*\" \"*/\" comments."
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
219
18720
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
220 (modify-syntax-entry ?_ "_" table)
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
221 (modify-syntax-entry ?\\ "\\" table)
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
222 (modify-syntax-entry ?+ "." table)
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
223 (modify-syntax-entry ?- "." table)
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
224 (modify-syntax-entry ?= "." table)
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
225 (modify-syntax-entry ?% "." table)
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
226 (modify-syntax-entry ?< "." table)
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
227 (modify-syntax-entry ?> "." table)
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
228 (modify-syntax-entry ?& "." table)
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
229 (modify-syntax-entry ?| "." table)
19300
b07fa43938cc (c-mode-base-map, c++-mode-map):
Richard M. Stallman <rms@gnu.org>
parents: 19250
diff changeset
230 (modify-syntax-entry ?\' "\"" table)
51714
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
231 (modify-syntax-entry ?\240 "." table)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
232
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
233 ;; 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
234 ;; 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
235 ;; 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
236 ;; default.
18720
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
237 (cond
51714
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
238 ;; XEmacs
18720
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
239 ((memq '8-bit c-emacs-features)
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
240 (modify-syntax-entry ?/ ". 1456" table)
19300
b07fa43938cc (c-mode-base-map, c++-mode-map):
Richard M. Stallman <rms@gnu.org>
parents: 19250
diff changeset
241 (modify-syntax-entry ?* ". 23" table))
51714
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
242 ;; Emacs
18720
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
243 ((memq '1-bit c-emacs-features)
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
244 (modify-syntax-entry ?/ ". 124b" table)
19300
b07fa43938cc (c-mode-base-map, c++-mode-map):
Richard M. Stallman <rms@gnu.org>
parents: 19250
diff changeset
245 (modify-syntax-entry ?* ". 23" table))
18720
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
246 ;; incompatible
51714
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
247 (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
248
19300
b07fa43938cc (c-mode-base-map, c++-mode-map):
Richard M. Stallman <rms@gnu.org>
parents: 19250
diff changeset
249 (modify-syntax-entry ?\n "> b" table)
b07fa43938cc (c-mode-base-map, c++-mode-map):
Richard M. Stallman <rms@gnu.org>
parents: 19250
diff changeset
250 ;; 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
251 (modify-syntax-entry ?\^m "> b" table))
b07fa43938cc (c-mode-base-map, c++-mode-map):
Richard M. Stallman <rms@gnu.org>
parents: 19250
diff changeset
252
51714
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
253 (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
254 "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
255 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
256 t `(lambda ()
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
257 (let ((table (make-syntax-table)))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
258 (c-populate-syntax-table table)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
259 ;; Mode specific syntaxes.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
260 ,(cond ((c-major-mode-is 'objc-mode)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
261 `(modify-syntax-entry ?@ "_" table))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
262 ((c-major-mode-is 'pike-mode)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
263 `(modify-syntax-entry ?@ "." table)))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
264 table)))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
265
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
266 (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
267 ;; 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
268 ;; 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
269 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
270
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
271 (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
272 ;; 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
273 ;; 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
274 ;; 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
275 ;; 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
276 ;; '<' 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
277 ;; 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
278 t nil
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
279 c++ `(lambda ()
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
280 (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
281 (modify-syntax-entry ?< "(>" table)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
282 (modify-syntax-entry ?> ")<" table)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
283 table)))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
284 (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
285 (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
286 (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
287
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
288 (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
289 "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
290 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
291 and keywords as words.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
292
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
293 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
294 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
295 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
296 ;; 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
297 ;; 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
298 ;; 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
299 ;; machine generated identifiers.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
300 t '((?_ . "w") (?$ . "w"))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
301 objc (append '((?@ . "w"))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
302 (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
303 awk '((?_ . "w")))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
304 (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
305 (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
306
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
307 (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
308 (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
309 (mods c-identifier-syntax-modifications)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
310 mod)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
311 (while mods
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
312 (setq mod (car mods)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
313 mods (cdr mods))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
314 (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
315 table)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
316 "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
317 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
318 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
319
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
320
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
321 ;;; Lexer-level syntax (identifiers, tokens etc).
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
322
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
323 (c-lang-defconst c-symbol-start
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
324 "Regexp that matches the start of a symbol, i.e. any identifier or
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
325 keyword. It's unspecified how far it matches. Does not contain a \\|
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
326 operator at the top level."
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
327 t (concat "[" c-alpha "_]")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
328 pike (concat "[" c-alpha "_`]"))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
329 (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
330
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
331 (c-lang-defconst c-symbol-chars
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
332 "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
333 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
334 ;; 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
335 ;; 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
336 t (concat c-alnum "_$")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
337 objc (concat c-alnum "_$@"))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
338
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
339 (c-lang-defconst c-symbol-key
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
340 "Regexp matching identifiers and keywords. Assumed to match if
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
341 `c-symbol-start' matches on the same position."
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
342 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
343 "[" (c-lang-const c-symbol-chars) "]*")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
344 pike (concat
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
345 ;; 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
346 ;; covered by the other alternative.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
347 (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
348 "\\|"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
349 (c-make-keywords-re nil
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
350 (c-lang-const c-overloadable-operators))))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
351 (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
352
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
353 (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
354 ;; Number of regexp grouping parens in `c-symbol-key'.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
355 t (c-regexp-opt-depth (c-lang-const c-symbol-key)))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
356
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
357 (c-lang-defconst c-nonsymbol-chars
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
358 "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
359 negation of `c-symbol-chars'."
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
360 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
361 (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
362
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
363 (c-lang-defconst c-nonsymbol-key
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
364 "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
365 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
366 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
367 ;; 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
368 ;; `c-symbol-key'.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
369 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
370
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
371 (c-lang-defconst c-opt-identifier-concat-key
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
372 "Regexp matching the operators that join symbols to fully qualified
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
373 identifiers, or nil in languages that don't have such things. Does
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
374 not contain a \\| operator at the top level."
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
375 t nil
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
376 c++ "::"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
377 java "\\."
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
378 idl "::"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
379 pike "\\(::\\|\\.\\)")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
380 (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
381 (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
382 'dont-doc)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
383
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
384 (c-lang-defconst c-opt-after-id-concat-key
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
385 "Regexp that must match the token after `c-opt-identifier-concat-key'
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
386 for it to be considered an identifier concatenation operator (which
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
387 e.g. causes the preceding identifier to be fontified as a reference).
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
388 Assumed to be a string if `c-opt-identifier-concat-key' is."
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
389 t (if (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
390 (c-lang-const c-symbol-start))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
391 c++ (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
392 "\\|[~*]")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
393 java (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
394 "\\|\\*"))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
395
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
396 (c-lang-defconst c-identifier-start
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
397 "Regexp that matches the start of an \(optionally qualified)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
398 identifier. It should also match all keywords. It's unspecified how
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
399 far it matches."
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
400 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
401 (if (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
402 (concat "\\|" (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
403 ""))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
404 c++ (concat (c-lang-const c-identifier-start)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
405 "\\|"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
406 "[~*][ \t\n\r\f\v]*" (c-lang-const c-symbol-start))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
407 ;; Java does not allow a leading qualifier operator.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
408 java (c-lang-const c-symbol-start))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
409 (c-lang-defvar c-identifier-start (c-lang-const c-identifier-start))
18720
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
410
51714
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
411 (c-lang-defconst c-identifier-key
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
412 "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
413 C++. It does not recognize the full range of syntactic whitespace
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
414 between the tokens; `c-forward-name' has to be used for that."
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
415 t (c-lang-const c-symbol-key) ; Default to `c-symbol-key'.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
416 ;; C++ allows a leading qualifier operator and a `~' before the last
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
417 ;; symbol. This regexp is more complex than strictly necessary to
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
418 ;; ensure that it can be matched with a minimum of backtracking.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
419 c++ (concat
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
420 "\\(" (c-lang-const c-opt-identifier-concat-key) "[ \t\n\r\f\v]*\\)?"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
421 (concat
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
422 "\\("
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
423 ;; The submatch below is depth of `c-opt-identifier-concat-key' + 3.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
424 "\\(" (c-lang-const c-symbol-key) "\\)"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
425 (concat "\\("
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
426 "[ \t\n\r\f\v]*"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
427 (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
428 "[ \t\n\r\f\v]*"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
429 ;; The submatch below is: `c-symbol-key-depth' +
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
430 ;; 2 * depth of `c-opt-identifier-concat-key' + 5.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
431 "\\(" (c-lang-const c-symbol-key) "\\)"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
432 "\\)*")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
433 (concat "\\("
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
434 "[ \t\n\r\f\v]*"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
435 (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
436 "[ \t\n\r\f\v]*"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
437 "[~*]"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
438 "[ \t\n\r\f\v]*"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
439 ;; The submatch below is: 2 * `c-symbol-key-depth' +
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
440 ;; 3 * depth of `c-opt-identifier-concat-key' + 7.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
441 "\\(" (c-lang-const c-symbol-key) "\\)"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
442 "\\)?")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
443 "\\|"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
444 "~[ \t\n\r\f\v]*"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
445 ;; The submatch below is: 3 * `c-symbol-key-depth' +
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
446 ;; 3 * depth of `c-opt-identifier-concat-key' + 8.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
447 "\\(" (c-lang-const c-symbol-key) "\\)"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
448 "\\)"))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
449 ;; IDL and Pike allows a leading qualifier operator.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
450 (idl pike) (concat
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
451 "\\("
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
452 (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
453 "[ \t\n\r\f\v]*"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
454 "\\)?"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
455 ;; The submatch below is depth of
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
456 ;; `c-opt-identifier-concat-key' + 2.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
457 "\\(" (c-lang-const c-symbol-key) "\\)"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
458 (concat "\\("
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
459 "[ \t\n\r\f\v]*"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
460 (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
461 "[ \t\n\r\f\v]*"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
462 ;; The submatch below is: `c-symbol-key-depth' +
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
463 ;; 2 * depth of `c-opt-identifier-concat-key' + 4.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
464 "\\(" (c-lang-const c-symbol-key) "\\)"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
465 "\\)*"))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
466 ;; Java does not allow a leading qualifier operator. If it ends
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
467 ;; with ".*" (used in import declarations) we also consider that as
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
468 ;; part of the name. ("*" is actually recognized in any position
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
469 ;; except the first by this regexp, but we don't bother.)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
470 java (concat "\\(" (c-lang-const c-symbol-key) "\\)" ; 1
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
471 (concat "\\("
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
472 "[ \t\n\r\f\v]*"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
473 (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
474 "[ \t\n\r\f\v]*"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
475 (concat "\\("
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
476 ;; The submatch below is `c-symbol-key-depth' +
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
477 ;; depth of `c-opt-identifier-concat-key' + 4.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
478 "\\(" (c-lang-const c-symbol-key) "\\)"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
479 "\\|\\*\\)")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
480 "\\)*")))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
481 (c-lang-defvar c-identifier-key (c-lang-const c-identifier-key))
18720
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
482
51714
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
483 (c-lang-defconst c-identifier-last-sym-match
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
484 "Used to identify the submatch in `c-identifier-key' that surrounds
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
485 the last symbol in the qualified identifier. It's a list of submatch
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
486 numbers, of which the first that has a match is taken. It's assumed
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
487 that at least one does when the regexp has matched."
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
488 t '(0)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
489 c++ (list (+ (* 3 (c-lang-const c-symbol-key-depth))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
490 (* 3 (c-regexp-opt-depth
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
491 (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
492 8)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
493 (+ (* 2 (c-lang-const c-symbol-key-depth))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
494 (* 3 (c-regexp-opt-depth
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
495 (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
496 7)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
497 (+ (c-lang-const c-symbol-key-depth)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
498 (* 2 (c-regexp-opt-depth
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
499 (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
500 5)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
501 (+ (c-regexp-opt-depth
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
502 (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
503 3))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
504 (idl pike) (list (+ (c-lang-const c-symbol-key-depth)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
505 (* 2 (c-regexp-opt-depth
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
506 (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
507 4)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
508 (+ (c-regexp-opt-depth
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
509 (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
510 2))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
511 java (list (+ (c-lang-const c-symbol-key-depth)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
512 (c-regexp-opt-depth
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
513 (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
514 4)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
515 1))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
516 (c-lang-defvar c-identifier-last-sym-match
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
517 (c-lang-const c-identifier-last-sym-match)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
518 'dont-doc)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
519
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
520 (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
521 "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
522 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
523 Assumed to not contain any submatches or \\| operators."
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
524 t "\\s *#\\s *"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
525 (java awk) nil)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
526 (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
527
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
528 (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
529 "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
530 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
531 submatch surrounds the directive name."
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
532 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
533 (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
534 "\\([" c-alnum "]+\\)"))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
535 ;; 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
536 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
537 "\\([" c-alnum "]+\\|!\\)"))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
538 (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
539
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
540 (c-lang-defconst c-cpp-defined-fns
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
541 ;; Name of functions in cpp expressions that take an identifier as
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
542 ;; the argument.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
543 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
544 '("defined"))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
545 pike '("defined" "efun" "constant"))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
546
52341
6a060e586596 (c-lineup-math): Don't align the operators "!=", "<=" and ">=" as assignment
Martin Stjernholm <mast@lysator.liu.se>
parents: 51946
diff changeset
547 (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
548 "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
549 t '("=" "*=" "/=" "%=" "+=" "-=" ">>=" "<<=" "&=" "^=" "|=")
6a060e586596 (c-lineup-math): Don't align the operators "!=", "<=" and ">=" as assignment
Martin Stjernholm <mast@lysator.liu.se>
parents: 51946
diff changeset
550 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
551 '(">>>="))
6a060e586596 (c-lineup-math): Don't align the operators "!=", "<=" and ">=" as assignment
Martin Stjernholm <mast@lysator.liu.se>
parents: 51946
diff changeset
552 c++ (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
553 '("and_eq" "or_eq" "xor_eq"))
6a060e586596 (c-lineup-math): Don't align the operators "!=", "<=" and ">=" as assignment
Martin Stjernholm <mast@lysator.liu.se>
parents: 51946
diff changeset
554 idl nil)
6a060e586596 (c-lineup-math): Don't align the operators "!=", "<=" and ">=" as assignment
Martin Stjernholm <mast@lysator.liu.se>
parents: 51946
diff changeset
555
51714
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
556 (c-lang-defconst c-operators
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
557 "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
558 associativity. The order in the list corresponds to the precedence of
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
559 the operators: The operators in each element is a group with the same
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
560 precedence, and the group has higher precedence than the groups in all
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
561 following elements. The car of each element describes the type of of
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
562 the operator group, and the cdr is a list of the operator tokens in
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
563 it. The operator group types are:
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
564
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
565 'prefix Unary prefix operators.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
566 'postfix Unary postfix operators.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
567 '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
568 '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
569 'right-assoc-sequence
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
570 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
571 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
572 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
573 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
574 order between them is therefore significant.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
575
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
576 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
577 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
578 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
579 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
580 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
581
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
582 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
583 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
584 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
585
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
586 ;; 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
587 ;; 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
588 ;; preparation for future work.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
589
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
590 t `(;; Preprocessor.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
591 ,@(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
592 `((prefix "#"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
593 ,@(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
594 '("%:" "??=")))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
595 (left-assoc "##"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
596 ,@(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
597 '("%:%:" "??=??=")))))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
598
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
599 ;; Primary. Info duplicated in `c-opt-identifier-concat-key'
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
600 ;; and `c-identifier-key'.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
601 ,@(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
602 `((postfix-if-paren "<" ">") ; Templates.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
603 (prefix "~" "??-" "compl")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
604 (right-assoc "::")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
605 (prefix "::")))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
606 ((c-major-mode-is 'pike-mode)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
607 `((left-assoc "::")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
608 (prefix "::" "global" "predef")))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
609 ((c-major-mode-is 'java-mode)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
610 `(;; Not necessary since it's also in the postfix group below.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
611 ;;(left-assoc ".")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
612 (prefix "super"))))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
613
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
614 ;; Postfix.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
615 ,@(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
616 ;; The following need special treatment.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
617 `((prefix "dynamic_cast" "static_cast"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
618 "reinterpret_cast" "const_cast" "typeid")))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
619 (left-assoc "."
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
620 ,@(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
621 '("->")))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
622 (postfix "++" "--" "[" "]" "(" ")"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
623 ,@(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
624 '("<:" ":>" "??(" "??)")))
26817
03befb219d03 Installed version 5.26
Gerd Moellmann <gerd@gnu.org>
parents: 24282
diff changeset
625
51714
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
626 ;; Unary.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
627 (prefix "++" "--" "+" "-" "!" "~"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
628 ,@(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
629 ,@(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
630 '("*" "&" "sizeof" "??-"))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
631 ,@(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
632 '("@selector" "@protocol" "@encode"))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
633 ;; The following need special treatment.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
634 ,@(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
635 '("new" "delete"))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
636 ((c-major-mode-is 'java-mode)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
637 '("new"))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
638 ((c-major-mode-is 'pike-mode)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
639 '("class" "lambda" "catch" "throw" "gauge")))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
640 "(" ")" ; Cast.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
641 ,@(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
642 '("[" "]"))) ; Type cast.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
643
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
644 ;; Member selection.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
645 ,@(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
646 `((left-assoc ".*" "->*")))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
647
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
648 ;; Multiplicative.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
649 (left-assoc "*" "/" "%")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
650
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
651 ;; Additive.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
652 (left-assoc "+" "-")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
653
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
654 ;; Shift.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
655 (left-assoc "<<" ">>"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
656 ,@(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
657 '(">>>")))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
658
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
659 ;; Relational.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
660 (left-assoc "<" ">" "<=" ">="
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
661 ,@(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
662 '("instanceof")))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
663
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
664 ;; Equality.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
665 (left-assoc "==" "!="
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
666 ,@(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
667
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
668 ;; Bitwise and.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
669 (left-assoc "&"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
670 ,@(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
671
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
672 ;; Bitwise exclusive or.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
673 (left-assoc "^"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
674 ,@(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
675 '("??'"))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
676 ,@(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
677
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
678 ;; Bitwise or.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
679 (left-assoc "|"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
680 ,@(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
681 '("??!"))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
682 ,@(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
683
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
684 ;; Logical and.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
685 (left-assoc "&&"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
686 ,@(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
687
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
688 ;; Logical or.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
689 (left-assoc "||"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
690 ,@(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
691 '("??!??!"))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
692 ,@(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
693
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
694 ;; Conditional.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
695 (right-assoc-sequence "?" ":")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
696
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
697 ;; Assignment.
52341
6a060e586596 (c-lineup-math): Don't align the operators "!=", "<=" and ">=" as assignment
Martin Stjernholm <mast@lysator.liu.se>
parents: 51946
diff changeset
698 (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
699
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
700 ;; Exception.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
701 ,@(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
702 '((prefix "throw")))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
703
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
704 ;; Sequence.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
705 (left-assoc ","))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
706
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
707 ;; 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
708 ;; set than the other languages.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
709 idl `(;; Preprocessor.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
710 (prefix "#")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
711 (left-assoc "##")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
712 ;; Primary. Info duplicated in `c-opt-identifier-concat-key'
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
713 ;; and `c-identifier-key'.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
714 (left-assoc "::")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
715 (prefix "::")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
716 ;; Unary.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
717 (prefix "+" "-" "~")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
718 ;; Multiplicative.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
719 (left-assoc "*" "/" "%")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
720 ;; Additive.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
721 (left-assoc "+" "-")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
722 ;; Shift.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
723 (left-assoc "<<" ">>")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
724 ;; And.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
725 (left-assoc "&")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
726 ;; Xor.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
727 (left-assoc "^")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
728 ;; Or.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
729 (left-assoc "|")))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
730
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
731 (c-lang-defconst c-operator-list
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
732 ;; The operators as a flat list (without duplicates).
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
733 t (delete-duplicates (mapcan (lambda (elem) (append (cdr elem) nil))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
734 (c-lang-const c-operators))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
735 :test 'string-equal))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
736
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
737 (c-lang-defconst c-overloadable-operators
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
738 "List of the operators that are overloadable, in their \"identifier form\"."
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
739 t nil
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
740 ;; The preceding "operator" keyword is treated separately in C++.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
741 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
742 "+" "-" "*" "/" "%"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
743 "^" "??'" "xor" "&" "bitand" "|" "??!" "bitor" "~" "??-" "compl"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
744 "!" "=" "<" ">" "+=" "-=" "*=" "/=" "%=" "^="
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
745 "??'=" "xor_eq" "&=" "and_eq" "|=" "??!=" "or_eq"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
746 "<<" ">>" ">>=" "<<=" "==" "!=" "not_eq" "<=" ">="
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
747 "&&" "and" "||" "??!??!" "or" "++" "--" "," "->*" "->"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
748 "()" "[]" "<::>" "??(??)")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
749 ;; These work like identifiers in Pike.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
750 pike '("`+" "`-" "`&" "`|" "`^" "`<<" "`>>" "`*" "`/" "`%" "`~"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
751 "`==" "`<" "`>" "`!" "`[]" "`[]=" "`->" "`->=" "`()" "``+"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
752 "``-" "``&" "``|" "``^" "``<<" "``>>" "``*" "``/" "``%"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
753 "`+="))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
754
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
755 (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
756 ;; 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
757 t nil
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
758 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
759 (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
760 (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
761
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
762 (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
763 "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
764 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
765 operators."
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
766 t '("{" "}" "(" ")" "[" "]" ";" ":" "," "=" "/*" "*/" "//")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
767 (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
768 "::" "...")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
769 (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
770 (c c++) (append '("<%" "%>" "<:" ":>" "%:" "%:%:" "*")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
771 (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
772 c++ (append '("&") (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
773 objc (append '("#" "##" ; Used by cpp.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
774 "+" "-") (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
775 idl (append '("#" "##") ; Used by cpp.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
776 (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
777 pike (append '("..")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
778 (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
779 (c-lang-const c-overloadable-operators))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
780 awk '("{" "}" "(" ")" "[" "]" ";" "," "=" "/"))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
781
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
782 (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
783 ;; 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
784 ;; 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
785 ;; a float.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
786 t (c-make-keywords-re nil
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
787 (c-with-syntax-table (c-lang-const c-mode-syntax-table)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
788 (mapcan (lambda (op)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
789 (if (string-match "\\`\\(\\s.\\|\\s\(\\|\\s\)\\)+\\'" op)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
790 (list op)))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
791 (append (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
792 (c-lang-const c-operator-list))))))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
793 (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
794 (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
795
52341
6a060e586596 (c-lineup-math): Don't align the operators "!=", "<=" and ">=" as assignment
Martin Stjernholm <mast@lysator.liu.se>
parents: 51946
diff changeset
796 (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
797 ;; 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
798 ;; 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
799 ;; 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
800 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
801 (concat
6a060e586596 (c-lineup-math): Don't align the operators "!=", "<=" and ">=" as assignment
Martin Stjernholm <mast@lysator.liu.se>
parents: 51946
diff changeset
802 ;; 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
803 "=\\([^=]\\|$\\)"
6a060e586596 (c-lineup-math): Don't align the operators "!=", "<=" and ">=" as assignment
Martin Stjernholm <mast@lysator.liu.se>
parents: 51946
diff changeset
804 "\\|"
6a060e586596 (c-lineup-math): Don't align the operators "!=", "<=" and ">=" as assignment
Martin Stjernholm <mast@lysator.liu.se>
parents: 51946
diff changeset
805 (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
806 (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
807 '("=")
6a060e586596 (c-lineup-math): Don't align the operators "!=", "<=" and ">=" as assignment
Martin Stjernholm <mast@lysator.liu.se>
parents: 51946
diff changeset
808 :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
809 "\\<\\>"))
6a060e586596 (c-lineup-math): Don't align the operators "!=", "<=" and ">=" as assignment
Martin Stjernholm <mast@lysator.liu.se>
parents: 51946
diff changeset
810 (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
811 (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
812
51714
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
813 (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
814 ;; 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
815 ;; multicharacter tokens that begin with "<".
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
816 t (c-make-keywords-re nil
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
817 (mapcan (lambda (op)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
818 (if (string-match "\\`<." op)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
819 (list (substring op 1))))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
820 (append (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
821 (c-lang-const c-operator-list)))))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
822 (c-lang-defvar c-<-op-cont-regexp (c-lang-const c-<-op-cont-regexp))
18720
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
823
51714
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
824 (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
825 ;; 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
826 ;; multicharacter tokens that begin with ">".
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
827 t (c-make-keywords-re nil
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
828 (mapcan (lambda (op)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
829 (if (string-match "\\`>." op)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
830 (list (substring op 1))))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
831 (append (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
832 (c-lang-const c-operator-list)))))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
833 (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
834
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
835 (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
836 ;; 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
837 ;; 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
838 ;; 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
839 ;; 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
840 t "^;{}?:"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
841 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
842 (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
843
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
844 (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
845 ;; 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
846 t "^;,{}?:"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
847 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
848 (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
849 (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
850
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 ;;; Syntactic whitespace.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
853
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
854 (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
855 ;; Regexp to match the start of any type of comment.
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 ;; TODO: Ought to use `c-comment-prefix-regexp' with some
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
858 ;; modifications instead of this.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
859 t "/[/*]"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
860 awk "#")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
861 (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
862
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
863 (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
864 ;; 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
865 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
866 "\\|"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
867 (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
868 "\"|"
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 (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
871
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
872 (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
873 "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
874 t "\\<\\>"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
875 ;; 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
876 (c c++ objc) "/\\*[*!]"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
877 java "/\\*\\*"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
878 pike "/[/*]!")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
879 (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
880 (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
881
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
882 (c-lang-defconst comment-start
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
883 "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
884 `comment-start' is initialized from this."
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
885 t "// "
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
886 c "/* "
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
887 awk "# ")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
888 (c-lang-defvar comment-start (c-lang-const comment-start)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
889 'dont-doc)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
890
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
891 (c-lang-defconst comment-end
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
892 "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
893 `comment-end' is initialized from this."
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
894 t ""
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
895 c " */")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
896 (c-lang-defvar comment-end (c-lang-const comment-end)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
897 'dont-doc)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
898
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
899 (c-lang-defconst comment-start-skip
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
900 "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
901 `comment-start-skip' is initialized from this."
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
902 t "/\\*+ *\\|//+ *"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
903 awk "#+ *")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
904 (c-lang-defvar comment-start-skip (c-lang-const comment-start-skip)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
905 'dont-doc)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
906
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
907 (c-lang-defconst c-syntactic-ws-start
51714
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
908 "Regexp matching any sequence that can start syntactic whitespace.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
909 The only uncertain case is '#' when there are cpp directives."
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
910 t "[ \n\t\r\v\f#]\\|/[/*]\\|\\\\[\n\r]"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
911 awk "[ \n\t\r\v\f#]\\|\\\\[\n\r]")
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
912 (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
913 'dont-doc)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
914
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
915 (c-lang-defconst c-syntactic-ws-end
51714
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
916 "Regexp matching any single character that might end syntactic whitespace."
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
917 t "[ \n\t\r\v\f/]"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
918 awk "[ \n\t\r\v\f]")
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
919 (c-lang-defvar c-syntactic-ws-end (c-lang-const c-syntactic-ws-end)
51714
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
920 'dont-doc)
18720
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
921
51714
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
922 (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
923 ;; 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
924 ;; 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
925 ;; `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
926 ;; directives as syntactic whitespace.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
927 t (concat "/" (concat
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
928 "\\("
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
929 "/[^\n\r]*[\n\r]" ; Line comment.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
930 "\\|"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
931 ;; Block comment. We intentionally don't allow line
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
932 ;; breaks in them to avoid going very far and risk
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
933 ;; running out of regexp stack; this regexp is
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
934 ;; intended to handle only short comments that
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
935 ;; might be put in the middle of limited constructs
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
936 ;; like declarations.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
937 "\\*\\([^*\n\r]\\|\\*[^/\n\r]\\)*\\*/"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
938 "\\)")
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 "\\\\[\n\r]") ; Line continuations.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
941 awk ("#.*[\n\r]\\|\\\\[\n\r]"))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
942
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
943 (c-lang-defconst c-syntactic-ws
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
944 ;; 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
945 ;; 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
946 ;; 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
947 ;; not contain a \| operator at the top level.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
948 t (concat "[ \t\n\r\f\v]*\\("
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
949 "\\(" (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
950 "[ \t\n\r\f\v]*\\)*"))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
951
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
952 (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
953 ;; Number of regexp grouping parens in `c-syntactic-ws'.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
954 t (c-regexp-opt-depth (c-lang-const c-syntactic-ws)))
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 (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
957 ;; 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
958 ;; 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
959 ;; 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
960 ;; not contain a \| operator at the top level.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
961 t (concat "\\([ \t\n\r\f\v]\\|"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
962 (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
963 "\\)+"))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
964
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
965 (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
966 ;; Number of regexp grouping parens in `c-nonempty-syntactic-ws'.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
967 t (c-regexp-opt-depth (c-lang-const c-nonempty-syntactic-ws)))
19250
23f71af4d504 (c-symbol-key):
Richard M. Stallman <rms@gnu.org>
parents: 18842
diff changeset
968
51714
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
969 (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
970 ;; 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
971 ;; 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
972 ;; 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
973 ;; a \| operator at the top level.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
974 t (concat "[ \t]*\\("
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
975 "/\\*\\([^*\n\r]\\|\\*[^/\n\r]\\)*\\*/" ; Block comment
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
976 "[ \t]*\\)*")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
977 awk ("[ \t]*\\(#.*$\\)?"))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
978
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
979 (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
980 ;; Number of regexp grouping parens in `c-single-line-syntactic-ws'.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
981 t (c-regexp-opt-depth (c-lang-const c-single-line-syntactic-ws)))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
982
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
983 (c-lang-defvar c-syntactic-eol
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
984 ;; 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
985 ;; 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
986 ;; significant text here.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
987 (concat (concat
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
988 ;; Match horizontal whitespace and block comments that
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
989 ;; don't contain newlines.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
990 "\\(\\s \\|"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
991 (concat "/\\*"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
992 "\\([^*\n\r]\\|\\*[^/\n\r]\\)*"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
993 "\\*/")
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 (concat
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
996 ;; Match eol (possibly inside a block comment or preceded
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
997 ;; by a line continuation backslash), or the beginning of a
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
998 ;; line comment. Note: This has to be modified for awk
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
999 ;; where line comments start with '#'.
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 (concat "\\("
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1002 "/\\*\\([^*\n\r]\\|\\*[^/\n\r]\\)*"
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 "\\|//\\)")))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1008
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1009
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1010 ;;; In-comment text handling.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1011
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1012 (c-lang-defconst c-paragraph-start
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1013 "Regexp to append to `paragraph-start'."
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1014 t "$"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1015 java "\\(@[a-zA-Z]+\\>\\|$\\)" ; For Javadoc.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1016 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
1017 (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
1018
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1019 (c-lang-defconst c-paragraph-separate
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1020 "Regexp to append to `paragraph-separate'."
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1021 t "$"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1022 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
1023 (c-lang-defvar c-paragraph-separate (c-lang-const c-paragraph-separate))
24282
5b0864259a4b Installed CC Mode 5.25.
Barry A. Warsaw <barry@zope.org>
parents: 22423
diff changeset
1024
36920
32a4317c6aa5 Update to version 5.28.
Gerd Moellmann <gerd@gnu.org>
parents: 34342
diff changeset
1025
51714
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1026 ;;; Keyword lists.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1027
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1028 ;; 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
1029 ;; 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
1030 ;; `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
1031
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1032 (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
1033 "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
1034 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
1035 keyword face.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1036
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1037 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
1038 `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
1039 `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
1040 will be handled.
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 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
1043 `*-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
1044 the appropriate place for that."
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1045 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
1046 "unsigned" "void")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1047 c (append
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1048 '("_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
1049 (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
1050 c++ (append
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1051 '("bool" "wchar_t")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1052 (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
1053 ;; 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
1054 objc (append
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1055 '("id" "Class" "SEL" "IMP" "BOOL")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1056 (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
1057 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
1058 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
1059 "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
1060 ;; In CORBA PSDL:
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1061 "ref"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1062 ;; 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
1063 ;; 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
1064 ;; doesn't matter that much.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1065 "unsigned" "strong")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1066 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
1067 ;; used as a builtin type.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1068 "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
1069 "object" "program" "string" "this_program" "void"))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1070
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1071 (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
1072 ;; 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
1073 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
1074 (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
1075
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1076 (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
1077 "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
1078 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
1079 t nil
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1080 (c c++) '("long" "short" "signed" "unsigned")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1081 idl '("long" "unsigned"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1082 ;; In CORBA PSDL:
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1083 "strong"))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1084
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1085 (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
1086 "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
1087 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
1088 declarations.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1089
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1090 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
1091 `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
1092 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
1093 t nil
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1094 c '("struct" "union" "enum")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1095 c++ (append '("class" "typename")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1096 (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
1097
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1098 (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
1099 ;; 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
1100 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
1101 (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
1102
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1103 (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
1104 "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
1105 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
1106 `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
1107 not the type face."
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1108 t nil
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1109 c '("const" "restrict" "volatile")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1110 c++ '("const" "volatile" "throw")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1111 objc '("const" "volatile"))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1112
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1113 (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
1114 ;; 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
1115 ;; languages without such keywords.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1116 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
1117 (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
1118 (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
1119
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1120 (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
1121 ;; 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
1122 ;; `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
1123 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
1124 (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
1125 (c-make-keywords-re t
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1126 (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
1127 (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
1128 (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
1129 (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
1130
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1131 (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
1132 "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
1133 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
1134
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1135 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
1136 `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
1137 `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
1138 will be handled.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1139
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1140 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
1141 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
1142 `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
1143 t nil
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1144 c '("struct" "union")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1145 c++ '("class" "struct" "union")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1146 objc '("struct" "union"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1147 "@interface" "@implementation" "@protocol")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1148 java '("class" "interface")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1149 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
1150 "union" "valuetype"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1151 ;; In CORBA PSDL:
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1152 "storagehome" "storagetype"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1153 ;; In CORBA CIDL:
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1154 "catalog" "executor" "manages" "segment")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1155 pike '("class"))
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 (c-lang-defconst c-class-key
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1158 ;; 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
1159 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
1160 (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
1161
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1162 (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
1163 "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
1164 any) is a brace list.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1165
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1166 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
1167 `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
1168 `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
1169 will be handled."
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1170 t '("enum")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1171 (java awk) nil)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1172
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1173 (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
1174 ;; 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
1175 ;; block is a brace list.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1176 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
1177 (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
1178
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1179 (c-lang-defconst c-other-block-decl-kwds
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1180 "Keywords where the following block (if any) contain another
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1181 declaration level that should not be considered a class.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1182
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1183 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
1184 `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
1185 `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
1186 will be handled."
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1187 t nil
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1188 c '("extern")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1189 c++ '("namespace" "extern")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1190 idl '("module"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1191 ;; In CORBA CIDL:
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1192 "composition"))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1193
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1194 (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
1195 ;; 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
1196 ;; another declaration level.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1197 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
1198 (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
1199
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1200 (c-lang-defconst c-typedef-decl-kwds
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1201 "Keywords introducing declarations where the identifiers are defined
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1202 to be types.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1203
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1204 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
1205 `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
1206 `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
1207 will be handled."
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1208 t '("typedef")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1209 (java awk) nil)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1210
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1211 (c-lang-defconst c-typeless-decl-kwds
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1212 "Keywords introducing declarations where the identifier (declarator)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1213 list follows directly after the keyword, without any type.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1214
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1215 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
1216 `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
1217 `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
1218 will be handled."
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1219 t nil
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1220 ;; Unlike most other languages, exception names are not handled as
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1221 ;; types in IDL since they only can occur in "raises" specs.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1222 idl '("exception" "factory" "finder" "native"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1223 ;; In CORBA PSDL:
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1224 "key" "stores"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1225 ;; In CORBA CIDL:
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1226 ;; Note that "manages" here clashes with its presence on
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1227 ;; `c-type-list-kwds' for IDL.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1228 "executor" "facet" "manages" "segment")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1229 pike '("constant"))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1230
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1231 (c-lang-defconst c-modifier-kwds
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1232 "Keywords that can prefix normal declarations of identifiers
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1233 \(and typically acts as flags). Things like argument declarations
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1234 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
1235 sense.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1236
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1237 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
1238 `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
1239 `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
1240 will be handled."
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1241 t nil
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1242 (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
1243 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
1244 (c-lang-const c-modifier-kwds))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1245 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
1246 ;; 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
1247 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
1248 "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
1249 "public" "publishes" "readonly" "typeid" "typeprefix" "uses"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1250 ;; In CORBA PSDL:
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1251 "primary" "state"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1252 ;; In CORBA CIDL:
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1253 "bindsTo" "delegatesTo" "implements" "proxy" "storedOn")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1254 ;; 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
1255 java '("abstract" "const" "final" "native" "private" "protected" "public"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1256 "static" "strictfp" "synchronized" "transient" "volatile")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1257 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
1258 "public" "static" "variant"))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1259
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1260 (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
1261 "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
1262 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
1263 `c-other-block-decl-kwds', `c-typedef-decl-kwds',
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1264 `c-typeless-decl-kwds' and `c-modifier-kwds'. In a declaration, these
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1265 keywords are also recognized inside or after the identifiers that
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1266 makes up the type.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1267
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1268 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
1269 `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
1270 `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
1271 will be handled."
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1272 t nil
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1273 (c c++) '("__declspec") ; MSVC extension.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1274 objc '("@class" "@end" "@defs")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1275 java '("import" "package")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1276 pike '("import" "inherit"))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1277
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1278 (c-lang-defconst c-specifier-key
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1279 ;; Adorned regexp matching keywords that can start a declaration but
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1280 ;; not a type.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1281 t (c-make-keywords-re t
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1282 (set-difference (append (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
1283 (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
1284 (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
1285 (c-lang-const c-typedef-decl-kwds)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1286 (c-lang-const c-typeless-decl-kwds)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1287 (c-lang-const c-modifier-kwds)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1288 (c-lang-const c-other-decl-kwds))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1289 (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
1290 (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
1291 (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
1292 :test 'string-equal)))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1293 (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
1294
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1295 (c-lang-defconst c-protection-kwds
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1296 "Protection label keywords in classes."
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1297 t nil
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1298 c++ '("private" "protected" "public")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1299 objc '("@private" "@protected" "@public"))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1300
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1301 (c-lang-defconst c-opt-access-key
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1302 ;; Regexp matching an access protection label in a class, or nil in
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1303 ;; 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
1304 t (if (c-lang-const c-protection-kwds)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1305 (c-make-keywords-re t (c-lang-const c-protection-kwds)))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1306 c++ (concat "\\("
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1307 (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
1308 "\\)[ \t\n\r\f\v]*:"))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1309 (c-lang-defvar c-opt-access-key (c-lang-const c-opt-access-key))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1310
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1311 (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
1312 "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
1313 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
1314 \"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
1315 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
1316
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1317 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
1318 `*-decl-kwds' lists."
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1319 t nil
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1320 (c objc) '("struct" "union" "enum" "typedef")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1321 c++ '("class" "struct" "union" "enum" "typedef"))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1322
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1323 (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
1324 ;; 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
1325 ;; languages without such constructs.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1326 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
1327 (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
1328 (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
1329 (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
1330
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1331 (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
1332 "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
1333 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
1334 declarations."
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1335 t nil
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1336 (c c++) '("__attribute__") ; GCC extension.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1337 java '("extends" "implements" "throws")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1338 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
1339 "supports"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1340 ;; In CORBA PSDL:
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1341 "as" "const" "implements" "of" "ref"))
36920
32a4317c6aa5 Update to version 5.28.
Gerd Moellmann <gerd@gnu.org>
parents: 34342
diff changeset
1342
51714
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1343 (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
1344 "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
1345 construct it's part of continues."
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1346 t nil
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1347 (c c++ objc) '("extern"))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1348
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1349 (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
1350 "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
1351 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
1352 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
1353 element.)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1354
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1355 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
1356 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
1357 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
1358 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
1359 the keywords on `c-modifier-kwds' should normally not be listed here
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1360 too.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1361
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1362 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
1363 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
1364 t '("struct" "union" "enum")
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
1365 (c awk) nil
28b12b0193f6 (c-type-list-kwds): If "operator" is followed by an identifier in C++
Martin Stjernholm <mast@lysator.liu.se>
parents: 52401
diff changeset
1366 c++ '("operator")
51714
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1367 objc (append '("@class" "@interface" "@implementation" "@protocol")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1368 (c-lang-const c-type-list-kwds))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1369 java '("class" "import" "interface" "new" "extends" "implements" "throws")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1370 idl (append '("component" "eventtype" "home" "interface" "manages" "native"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1371 "primarykey" "supports" "valuetype"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1372 ;; In CORBA PSDL:
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1373 "as" "implements" "of" "scope" "storagehome" "storagetype")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1374 (c-lang-const c-type-list-kwds))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1375 pike '("class" "enum" "inherit"))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1376
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1377 (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
1378 "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
1379 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
1380 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
1381 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
1382 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
1383
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1384 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
1385 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
1386 t nil
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1387 c++ '("namespace")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1388 java '("package")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1389 idl '("import" "module"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1390 ;; In CORBA CIDL:
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1391 "composition")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1392 pike '("import"))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1393
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1394 (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
1395 "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
1396 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
1397 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
1398 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
1399 t nil
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1400 c++ '("class" "struct")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1401 idl '("component" "eventtype" "home" "interface" "valuetype"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1402 ;; In CORBA PSDL:
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1403 "storagehome" "storagetype"))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1404
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1405 (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
1406 "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
1407 forward to the colon. The end of the match is assumed to be directly
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1408 after the colon, so the regexp should end with \":\" although that
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1409 isn't necessary. Must be a regexp if `c-colon-type-list-kwds' isn't
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1410 nil."
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1411 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
1412 ;; 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
1413 ;; 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
1414 ;; 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
1415 ;; languages.)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1416 "[^\]\[{}();,/#=:]*:"))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1417 (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
1418
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1419 (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
1420 "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
1421 contain type identifiers."
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1422 t nil
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1423 (c c++) '("__declspec")) ; MSVC extension.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1424
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1425 (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
1426 "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
1427 type identifiers separated by arbitrary tokens."
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1428 t nil
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1429 c++ '("throw")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1430 objc '("@defs")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1431 idl '("switch")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1432 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
1433
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1434 (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
1435 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
1436 (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
1437 :test 'string-equal))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1438
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1439 (c-lang-defconst c-<>-type-kwds
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1440 "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
1441 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
1442 `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
1443 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
1444 if this isn't nil."
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1445 t nil
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1446 objc '("id")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1447 idl '("sequence"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1448 ;; In CORBA PSDL:
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1449 "ref"))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1450
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1451 (c-lang-defconst c-<>-arglist-kwds
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1452 "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
1453 `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
1454 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
1455 t nil
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1456 c++ '("template")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1457 idl '("fixed" "string" "wstring"))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1458
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1459 (c-lang-defconst c-<>-sexp-kwds
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1460 ;; 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
1461 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
1462 (c-lang-const c-<>-arglist-kwds))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1463 :test 'string-equal))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1464
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1465 (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
1466 ;; 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
1467 ;; 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
1468 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
1469 (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
1470 (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
1471
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1472 (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
1473 "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
1474 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
1475 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
1476 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
1477
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1478 (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
1479 "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
1480 t '("do" "else")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1481 c++ '("do" "else" "try")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1482 java '("do" "else" "finally" "try")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1483 idl nil)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1484
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1485 (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
1486 ;; 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
1487 ;; 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
1488 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
1489 (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
1490
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1491 (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
1492 "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
1493 t '("for" "if" "switch" "while")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1494 c++ '("for" "if" "switch" "while" "catch")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1495 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
1496 idl nil
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1497 pike '("for" "if" "switch" "while" "foreach")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1498 awk '("for" "if" "while"))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1499
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1500 (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
1501 ;; 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
1502 ;; and then by a substatement.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1503 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
1504 (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
1505
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1506 (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
1507 ;; 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
1508 ;; 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
1509 ;; don't have such constructs.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1510 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
1511 (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
1512 (c-make-keywords-re t
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1513 (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
1514 (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
1515 (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
1516
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1517 (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
1518 "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
1519 t '("break" "continue" "goto" "return")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1520 ;; 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
1521 java '("break" "continue" "goto" "return" "throw")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1522 idl nil
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1523 pike '("break" "continue" "return")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1524 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
1525 "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
1526 "nextfile" "print" "printf"))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1527
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1528 (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
1529 ;; 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
1530 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
1531 (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
1532
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1533 (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
1534 "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
1535 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
1536 t '("for")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1537 idl nil)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1538
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1539 (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
1540 ;; 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
1541 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
1542 (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
1543
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1544 (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
1545 "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
1546 t nil
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1547 (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
1548
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1549 (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
1550 ;; 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
1551 ;; languages that don't support that.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1552 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
1553 (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
1554 (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
1555
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1556 (c-lang-defconst c-label-kwds
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1557 "Keywords introducing labels in blocks."
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1558 t '("case" "default")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1559 awk nil)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1560
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1561 (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
1562 "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
1563 t '("goto")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1564 (java pike) (append '("break" "continue")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1565 (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
1566 idl nil
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1567 awk nil)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1568
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1569 (c-lang-defconst c-label-kwds-regexp
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1570 ;; Regexp matching any keyword that introduces a label.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1571 t (c-make-keywords-re t (c-lang-const c-label-kwds)))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1572 (c-lang-defvar c-label-kwds-regexp (c-lang-const c-label-kwds-regexp))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1573
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1574 (c-lang-defconst c-constant-kwds
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1575 "Keywords for constants."
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 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
1578 "false" "true") ; Defined in C99.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1579 objc '("nil" "Nil")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1580 idl '("TRUE" "FALSE")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1581 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
1582
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1583 (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
1584 "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
1585 t nil
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1586 c++ '("operator" "this")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1587 objc '("super" "self")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1588 java '("this")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1589 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
1590
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1591 (c-lang-defconst c-expr-kwds
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1592 ;; 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
1593 ;; `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
1594 t (delete-duplicates
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1595 (append (c-lang-const c-primary-expr-kwds)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1596 (c-with-syntax-table (c-lang-const c-mode-syntax-table)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1597 (mapcan (lambda (op)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1598 (and (string-match "\\`\\(\\w\\|\\s_\\)+\\'" op)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1599 (list op)))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1600 (c-lang-const c-operator-list))))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1601 :test 'string-equal))
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-lambda-kwds
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1604 "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
1605 expressions."
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1606 t nil
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1607 pike '("lambda"))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1608
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1609 (c-lang-defconst c-opt-lambda-key
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1610 ;; Adorned regexp matching the start of lambda constructs, or nil in
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1611 ;; 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
1612 t (and (c-lang-const c-lambda-kwds)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1613 (c-make-keywords-re t (c-lang-const c-lambda-kwds))))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1614 (c-lang-defvar c-opt-lambda-key (c-lang-const c-opt-lambda-key))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1615
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1616 (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
1617 "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
1618 be used in expressions \(the gcc extension for this in C and C++ is
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1619 handled separately)."
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1620 t nil
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1621 pike '("catch" "gauge"))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1622
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1623 (c-lang-defconst c-opt-inexpr-block-key
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1624 ;; Regexp matching the start of in-expression statements, or nil in
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1625 ;; 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
1626 t nil
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1627 pike (c-make-keywords-re t (c-lang-const c-inexpr-block-kwds)))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1628 (c-lang-defvar c-opt-inexpr-block-key (c-lang-const c-opt-inexpr-block-key))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1629
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1630 (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
1631 "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
1632 t nil
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1633 java '("new")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1634 pike '("class"))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1635
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1636 (c-lang-defconst c-opt-inexpr-class-key
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1637 ;; Regexp matching the start of a class in an expression, or nil in
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1638 ;; 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
1639 t (and (c-lang-const c-inexpr-class-kwds)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1640 (c-make-keywords-re t (c-lang-const c-inexpr-class-kwds))))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1641 (c-lang-defvar c-opt-inexpr-class-key (c-lang-const c-opt-inexpr-class-key))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1642
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1643 (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
1644 "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
1645 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
1646 `c-inexpr-class-kwds'."
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1647 t nil
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1648 java '("new"))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1649
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1650 (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
1651 ;; 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
1652 ;; 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
1653 ;; 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
1654 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
1655 (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
1656 (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
1657 (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
1658
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1659 (c-lang-defconst c-any-class-key
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1660 ;; Regexp matching the start of any class, both at top level and in
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1661 ;; expressions.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1662 t (c-make-keywords-re t
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1663 (append (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
1664 (c-lang-const c-inexpr-class-kwds))))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1665 (c-lang-defvar c-any-class-key (c-lang-const c-any-class-key))
24282
5b0864259a4b Installed CC Mode 5.25.
Barry A. Warsaw <barry@zope.org>
parents: 22423
diff changeset
1666
51714
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1667 (c-lang-defconst c-decl-block-key
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1668 ;; Regexp matching the start of any declaration-level block that
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1669 ;; contain another declaration level, i.e. that isn't a function
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1670 ;; block or brace list.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1671 t (c-make-keywords-re t
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1672 (append (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
1673 (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
1674 (c-lang-const c-inexpr-class-kwds)))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1675 ;; In Pike modifiers might be followed by a block
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1676 ;; to apply to several declarations.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1677 pike (concat (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
1678 "\\|"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1679 "\\(" (c-make-keywords-re nil
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1680 (c-lang-const c-modifier-kwds)) "\\)"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1681 (c-lang-const c-syntactic-ws)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1682 "{"))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1683 (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
1684
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1685 (c-lang-defconst c-bitfield-kwds
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1686 "Keywords that can introduce bitfields."
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1687 t nil
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1688 (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
1689
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1690 (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
1691 ;; 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
1692 ;; languages without bitfield support.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1693 t nil
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1694 (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
1695 (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
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-kwds
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1698 "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
1699 t nil
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1700 idl '("truncatable"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1701 ;; 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
1702 ;; can start a declaration.)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1703 "entity" "process" "service" "session" "storage"))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1704
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1705
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1706 ;;; Constants built from keywords.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1707
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1708 ;; 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
1709
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1710 (eval-and-compile
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1711 (defconst c-kwds-lang-consts
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1712 ;; 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
1713 (let (list)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1714 (mapatoms (lambda (sym)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1715 (when (and (boundp sym)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1716 (string-match "-kwds\\'" (symbol-name sym)))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1717 ;; 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
1718 ;; 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
1719 (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
1720 c-lang-constants)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1721 list)))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1722
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1723 (c-lang-defconst c-keywords
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1724 ;; All keywords as a list.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1725 t (delete-duplicates
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1726 (c-lang-defconst-eval-immediately
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1727 `(append ,@(mapcar (lambda (kwds-lang-const)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1728 `(c-lang-const ,kwds-lang-const))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1729 c-kwds-lang-consts)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1730 nil))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1731 :test 'string-equal))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1732
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1733 (c-lang-defconst c-keywords-regexp
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1734 ;; All keywords as an adorned regexp.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1735 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
1736 (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
1737
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1738 (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
1739 ;; 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
1740 ;; 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
1741 ;; contains it.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1742 t (let ((kwd-list-alist
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1743 (c-lang-defconst-eval-immediately
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1744 `(list ,@(mapcar (lambda (kwds-lang-const)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1745 `(cons ',kwds-lang-const
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1746 (c-lang-const ,kwds-lang-const)))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1747 c-kwds-lang-consts))))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1748 lang-const kwd-list kwd
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1749 result-alist elem)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1750 (while kwd-list-alist
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1751 (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
1752 kwd-list (cdar kwd-list-alist)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1753 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
1754 (while kwd-list
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1755 (setq kwd (car kwd-list)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1756 kwd-list (cdr kwd-list))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1757 (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
1758 (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
1759 (unless (memq lang-const (cdr elem))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1760 (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
1761 result-alist))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1762
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1763 (c-lang-defvar c-keywords-obarray
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1764 ;; 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
1765 ;; 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
1766 ;; lists it's a member of.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1767 ;;
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1768 ;; 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
1769 ;; `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
1770 ;; (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
1771 ;; 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
1772 ;; cc-engine:
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1773 ;; (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
1774
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1775 ;; 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
1776 ;; 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
1777 ;; complete.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1778
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1779 (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
1780 kwd lang-const-list
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1781 (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
1782 (while alist
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1783 (setq kwd (caar alist)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1784 lang-const-list (cdar alist)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1785 alist (cdr alist))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1786 (setplist (intern kwd obarray)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1787 ;; Emacs has an odd bug that causes `mapcan' to fail
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1788 ;; with unintelligible errors. (XEmacs >= 20 works.)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1789 ;;(mapcan (lambda (lang-const)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1790 ;; (list lang-const t))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1791 ;; lang-const-list)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1792 (apply 'nconc (mapcar (lambda (lang-const)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1793 (list lang-const t))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1794 lang-const-list))))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1795 obarray))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1796
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1797 (c-lang-defconst c-regular-keywords-regexp
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1798 ;; Adorned regexp matching all keywords that aren't types or
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1799 ;; constants.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1800 t (c-make-keywords-re t
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1801 (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
1802 (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
1803 (c-lang-const c-constant-kwds))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1804 :test 'string-equal)))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1805 (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
1806 (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
1807
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1808 (c-lang-defconst c-not-decl-init-keywords
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1809 ;; Adorned regexp matching all keywords that can't appear at the
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1810 ;; start of a declaration.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1811 t (c-make-keywords-re t
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1812 (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
1813 (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
1814 (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
1815 (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
1816 (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
1817 (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
1818 (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
1819 (c-lang-const c-typedef-decl-kwds)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1820 (c-lang-const c-typeless-decl-kwds)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1821 (c-lang-const c-modifier-kwds)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1822 (c-lang-const c-other-decl-kwds))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1823 :test 'string-equal)))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1824 (c-lang-defvar c-not-decl-init-keywords
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1825 (c-lang-const c-not-decl-init-keywords))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1826
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1827 (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
1828 ;; 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
1829 ;; 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
1830 ;; 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
1831 ;; 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
1832 ;; 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
1833 ;; 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
1834 ;; keyword operators isn't handled.)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1835
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1836 t (c-with-syntax-table (c-lang-const c-mode-syntax-table)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1837 (let* ((prefix-ops
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1838 (mapcan (lambda (op)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1839 ;; Filter out the special case prefix
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1840 ;; operators that are close parens.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1841 (unless (string-match "\\s\)" op)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1842 (list op)))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1843 (mapcan
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1844 (lambda (opclass)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1845 (when (eq (car opclass) 'prefix)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1846 (append (cdr opclass) nil)))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1847 (c-lang-const c-operators))))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1848
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1849 (nonkeyword-prefix-ops
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1850 (mapcan (lambda (op)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1851 (unless (string-match "\\`\\(\\w\\|\\s_\\)+\\'" op)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1852 (list op)))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1853 prefix-ops))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1854
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1855 (in-or-postfix-ops
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1856 (mapcan (lambda (opclass)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1857 (when (memq (car opclass)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1858 '(postfix
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1859 left-assoc
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1860 right-assoc
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1861 right-assoc-sequence))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1862 (append (cdr opclass) nil)))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1863 (c-lang-const c-operators)))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1864
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1865 (unambiguous-prefix-ops (set-difference nonkeyword-prefix-ops
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1866 in-or-postfix-ops
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1867 :test 'string-equal))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1868 (ambiguous-prefix-ops (intersection nonkeyword-prefix-ops
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1869 in-or-postfix-ops
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1870 :test 'string-equal)))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1871
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1872 (concat
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1873 "\\("
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1874 ;; Take out all symbol class operators from `prefix-ops' and make the
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1875 ;; first submatch from them together with `c-primary-expr-kwds'.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1876 (c-make-keywords-re t
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1877 (append (c-lang-const c-primary-expr-kwds)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1878 (set-difference prefix-ops nonkeyword-prefix-ops
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1879 :test 'string-equal)))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1880
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1881 "\\|"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1882 ;; Match all ambiguous operators.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1883 (c-make-keywords-re nil
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1884 (intersection nonkeyword-prefix-ops in-or-postfix-ops
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1885 :test 'string-equal))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1886 "\\)"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1887
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1888 "\\|"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1889 ;; Now match all other symbols.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1890 (c-lang-const c-symbol-start)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1891
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1892 "\\|"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1893 ;; The chars that can start integer and floating point
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1894 ;; constants.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1895 "\\.?[0-9]"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1896
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1897 "\\|"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1898 ;; The nonambiguous operators from `prefix-ops'.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1899 (c-make-keywords-re nil
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1900 (set-difference nonkeyword-prefix-ops in-or-postfix-ops
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1901 :test 'string-equal))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1902
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1903 "\\|"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1904 ;; Match string and character literals.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1905 "\\s\""
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1906 (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
1907 "\\|\\s|"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1908 "")))))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1909 (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
1910
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1911
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1912 ;;; Additional constants for parser-level constructs.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1913
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1914 (c-lang-defconst c-decl-prefix-re
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1915 "Regexp matching something that might precede a declaration or a cast,
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1916 such as the last token of a preceding statement or declaration. It
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1917 should not match bob, though. It can't require a match longer than
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1918 one token. The end of the token is taken to be at the end of the
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1919 first submatch. It must not include any following whitespace. It's
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1920 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
1921 is in effect or not."
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1922 ;; 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
1923 ;; 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
1924 ;; 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
1925 ;; begins with a declaration.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1926 t "\\([\{\}\(\);,]+\\)"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1927 java "\\([\{\}\(;,]+\\)"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1928 ;; 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
1929 ;; 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
1930 ;; that it got open paren syntax.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1931 ;;
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1932 ;; Also match a single ":" for protection labels. We cheat a little
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1933 ;; and require a symbol immediately before to avoid false matches
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1934 ;; when starting directly on a single ":", which can be the start of
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1935 ;; the base class initializer list in a constructor.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1936 c++ "\\([\{\}\(\);,<]+\\|\\(\\w\\|\\s_\\):\\)\\([^:]\\|\\'\\)"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1937 ;; 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
1938 ;; 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
1939 ;; 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
1940 ;; any easily recognized characters.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1941 objc (concat "\\([\{\}\(\);,]+\\|"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1942 (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
1943 "\\)")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1944 ;; Match ":" for switch labels inside union declarations in IDL.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1945 idl "\\([\{\}\(\);:,]+\\)\\([^:]\\|\\'\\)"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1946 ;; 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
1947 ;; assignments and type casts.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1948 pike "\\([\{\}\(\)\[;,]+\\)")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1949 (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
1950 'dont-doc)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1951
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1952 (c-lang-defconst c-cast-parens
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1953 ;; 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
1954 ;; languages without casts.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1955 t (c-with-syntax-table (c-lang-const c-mode-syntax-table)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1956 (mapcan (lambda (opclass)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1957 (when (eq (car opclass) 'prefix)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1958 (mapcan (lambda (op)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1959 (when (string-match "\\`\\s\(\\'" op)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1960 (list (elt op 0))))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1961 (cdr opclass))))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1962 (c-lang-const c-operators))))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1963 (c-lang-defvar c-cast-parens (c-lang-const c-cast-parens))
36920
32a4317c6aa5 Update to version 5.28.
Gerd Moellmann <gerd@gnu.org>
parents: 34342
diff changeset
1964
51714
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1965 (c-lang-defconst c-type-decl-prefix-key
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1966 "Regexp matching the operators that might precede the identifier in a
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1967 declaration, e.g. the \"*\" in \"char *argv\". This regexp should
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1968 match \"(\" if parentheses are valid in type declarations. The end of
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1969 the first submatch is taken as the end of the operator. Identifier
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1970 syntax 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
1971 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
1972 (concat (c-regexp-opt (c-lang-const c-type-modifier-kwds) t) "\\>")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1973 ;; 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
1974 "\\<\\>")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1975 (c objc) (concat "\\("
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1976 "[*\(]"
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 (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
1979 "\\)"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1980 "\\([^=]\\|$\\)")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1981 c++ (concat "\\("
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1982 "[*\(&]"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1983 "\\|"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1984 (concat "\\(" ; 2
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1985 ;; 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
1986 ;; `c-font-lock-declarators' and
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1987 ;; `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
1988 ;; complete name followed by ":: *".
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1989 (c-lang-const c-identifier-start)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1990 "\\)")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1991 "\\|"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1992 (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
1993 "\\)"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1994 "\\([^=]\\|$\\)")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1995 pike "\\([*\(!~]\\)\\([^=]\\|$\\)")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
1996 (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
1997 'dont-doc)
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-type-decl-suffix-key
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2000 "Regexp matching the operators that might follow after the identifier
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2001 in a declaration, e.g. the \"[\" in \"char argv[]\". This regexp
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2002 should match \")\" if parentheses are valid in type declarations. If
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2003 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
2004 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
2005 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
2006 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
2007 ;; 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
2008 ;; function argument list parenthesis.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2009 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
2010 (concat "\\(\(\\|"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2011 (c-regexp-opt (c-lang-const c-type-modifier-kwds) t) "\\>"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2012 "\\)")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2013 "\\(\(\\)")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2014 (c c++ objc) (concat
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2015 "\\("
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2016 "[\)\[\(]"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2017 "\\|"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2018 ;; "throw" in `c-type-modifier-kwds' is followed by a
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2019 ;; parenthesis list, but no extra measures are
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2020 ;; necessary to handle that.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2021 (c-regexp-opt (c-lang-const c-type-modifier-kwds) t) "\\>"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2022 "\\)")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2023 (java idl) "\\([\[\(]\\)")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2024 (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
2025 'dont-doc)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2026
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2027 (c-lang-defconst c-after-suffixed-type-decl-key
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2028 "This regexp is matched after a type declaration expression where
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2029 `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
2030 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
2031 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
2032 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
2033 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
2034 is in effect or not.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2035
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2036 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
2037 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
2038 not \",\" or \";\"."
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2039 t "{"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2040 ;; 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
2041 ;; 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
2042 ;; 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
2043 ;; 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
2044 ;; 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
2045 ;; on the other heuristics in that case.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2046 t (if (c-lang-const c-postfix-decl-spec-kwds)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2047 ;; Add on the keywords in `c-postfix-decl-spec-kwds'.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2048 (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
2049 "\\|"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2050 (c-make-keywords-re t (c-lang-const c-postfix-decl-spec-kwds)))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2051 (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
2052 ;; 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
2053 ;; 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
2054 ;; 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
2055 ;; 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
2056 ;; 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
2057 c++ "[{:]")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2058 (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
2059 (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
2060 'dont-doc)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2061
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2062 (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
2063 ;; 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
2064 ;; matches ";" and ",".
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2065 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
2066 "\\|[;,]"))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2067 (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
2068 (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
2069
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2070 (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
2071 "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
2072 \"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
2073 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
2074 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
2075 is in effect or not."
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2076 t nil
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2077 pike "\\([|.&]\\)\\($\\|[^|.&]\\)")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2078 (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
2079 'dont-doc)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2080
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2081 (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
2082 "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
2083 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
2084 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
2085 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
2086 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
2087 is in effect or not."
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2088 t nil
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2089 (c c++ objc pike) "\\(\\.\\.\\.\\)"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2090 java "\\(\\[[ \t\n\r\f\v]*\\]\\)")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2091 (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
2092
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2093 (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
2094 ;; 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
2095 ;; 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
2096 ;; 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
2097 ;; 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
2098 ;; syntax.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2099 (let ((extra-types (when (boundp (c-mode-symbol "font-lock-extra-types"))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2100 (c-mode-var "font-lock-extra-types"))))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2101 (concat "\\<\\("
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2102 (c-make-keywords-re nil (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
2103 (if (consp extra-types)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2104 (concat "\\|" (mapconcat 'identity extra-types "\\|"))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2105 "")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2106 "\\)\\>")))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2107
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2108 (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
2109 "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
2110 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
2111 list."
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2112 t nil
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2113 pike '((?{ . ?}) (?\[ . ?\]) (?< . ?>)))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2114 (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
2115
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2116 (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
2117 "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
2118 t nil
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2119 c t)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2120 (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
2121
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2122 (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
2123 "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
2124 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
2125 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
2126 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
2127 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
2128 t nil
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2129 (c c++ objc) t)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2130 (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
2131 (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
2132
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2133 (c-lang-defconst c-recognize-<>-arglists
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2134 "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
2135 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
2136 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
2137 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
2138 `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
2139 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
2140 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
2141 (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
2142 (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
2143
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2144 (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
2145 "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
2146 i.e. constructs like
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2147
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2148 Foo bar (gnu);
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2149
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2150 in addition to the more classic
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2151
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2152 Foo bar = gnu;"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2153 t nil
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2154 c++ t)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2155 (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
2156
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2157 (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
2158 ;; 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
2159 ;; 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
2160 ;; 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
2161 ;; 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
2162 ;; 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
2163 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
2164 (concat "\\("
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2165 (c-lang-const c-symbol-key)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2166 "\\)"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2167 (c-lang-const c-syntactic-ws)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2168 "<")))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2169 (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
2170
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2171 (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
2172 ;; 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
2173 ;; 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
2174 ;; `c-opt-<>-arglist-start'.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2175 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
2176 (concat "\\("
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2177 (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
2178 "\\)\\|\\s\)")))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2179 (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
2180 (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
2181
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2182 (c-lang-defconst c-label-key
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2183 "Regexp matching a normal label, i.e. a label that doesn't begin with
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2184 a keyword like switch labels. It's only used at the beginning of a
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2185 statement."
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2186 t "\\<\\>"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2187 (c c++ objc java pike) (concat "\\(" (c-lang-const c-symbol-key) "\\)"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2188 "[ \t\n\r\f\v]*:\\([^:]\\|$\\)"))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2189 (c-lang-defvar c-label-key (c-lang-const c-label-key)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2190 'dont-doc)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2191
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2192 (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
2193 ;; 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
2194 ;; 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
2195 ;;
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2196 ;; 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
2197 ;; java-mode each have their own ways of using it.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2198 t nil
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2199 c++ (concat ":?[ \t\n\r\f\v]*\\(virtual[ \t\n\r\f\v]+\\)?\\("
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2200 (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
2201 "\\)[ \t\n\r\f\v]+"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2202 "\\(" (c-lang-const c-symbol-key) "\\)")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2203 java (c-make-keywords-re t (c-lang-const c-postfix-decl-spec-kwds)))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2204 (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
2205 (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
2206
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2207 (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
2208 ;; 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
2209 ;; 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
2210 ;;
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2211 ;; TODO: Ought to use `c-specifier-key' or similar, and the template
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2212 ;; skipping isn't done properly. This will disappear soon.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2213 t nil
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2214 c++ "friend[ \t]+\\|template[ \t]*<.+>[ \t]*friend[ \t]+")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2215 (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
2216
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2217 (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
2218 ;; 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
2219 ;; first submatch is assumed to end after the + or - key.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2220 t nil
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2221 objc (concat
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2222 ;; TODO: Ought to use a better method than anchoring on bol.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2223 "^[ \t]*\\([+-]\\)[ \t\n\r\f\v]*"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2224 "\\(([^)]*)[ \t\n\r\f\v]*\\)?" ; return type
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2225 "\\(" (c-lang-const c-symbol-key) "\\)"))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2226 (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
2227
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2228
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2229 ;;; 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
2230
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2231 ;; Compile in the list of language variables that has been collected
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2232 ;; with the `c-lang-defvar' macro. Note that the first element is
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2233 ;; nil.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2234 (defconst c-lang-variable-inits (cc-eval-when-compile c-lang-variable-inits))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2235
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2236 (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
2237 "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
2238 for the given mode.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2239
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2240 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
2241 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
2242 from the language constants. Use the `c-init-language-vars' macro to
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2243 accomplish that conveniently.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2244
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2245 This function does not do any hidden buffer changes."
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2246
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2247 (if (and (not load-in-progress)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2248 (boundp 'byte-compile-dest-file)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2249 (stringp byte-compile-dest-file))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2250
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2251 ;; 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
2252 ;; 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
2253 ;; `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
2254 ;; 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
2255 `(lambda ()
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2256
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2257 ;; 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
2258 ;; 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
2259 (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
2260 current-var)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2261 (condition-case err
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2262
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2263 (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
2264 (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
2265 (c-lang-const-expansion 'immediate))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2266 ;; `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
2267 ;; constant immediately in `cl-macroexpand-all'
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2268 ;; below.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2269 (mapcan
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2270 (lambda (init)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2271 `(current-var ',(car init)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2272 ,(car init) ,(cl-macroexpand-all
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2273 (elt init 1))))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2274 (cdr c-lang-variable-inits))))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2275
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2276 (unless (get ',mode 'c-has-warned-lang-consts)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2277 (message ,(concat "%s compiled with CC Mode %s "
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2278 "but loaded with %s - evaluating "
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2279 "language constants from source")
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2280 ',mode ,c-version c-version)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2281 (put ',mode 'c-has-warned-lang-consts t))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2282
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2283 (require 'cc-langs)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2284 (let ((init (cdr c-lang-variable-inits)))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2285 (while init
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2286 (setq current-var (caar init))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2287 (set (caar init) (eval (cadar init)))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2288 (setq init (cdr init)))))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2289
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2290 (error
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2291 (if current-var
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2292 (message "Eval error in the `c-lang-defvar' for `%s': %S"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2293 current-var err)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2294 (signal (car err) (cdr err)))))))
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 ;; 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
2297 ;; 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
2298 ;; interactively.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2299 `(lambda ()
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2300 (require 'cc-langs)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2301 (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
2302 (init (cdr c-lang-variable-inits))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2303 current-var)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2304 (condition-case err
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2305
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2306 (while init
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2307 (setq current-var (caar init))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2308 (set (caar init) (eval (cadar init)))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2309 (setq init (cdr init)))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2310
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2311 (error
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2312 (if current-var
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2313 (message "Eval error in the `c-lang-defvar' for `%s': %S"
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2314 current-var err)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2315 (signal (car err) (cdr err)))))))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2316 ))
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2317
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2318 (defmacro c-init-language-vars (mode)
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2319 "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
2320 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
2321 in question, so MODE must be a constant. Therefore MODE is not
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2322 evaluated and should not be quoted.
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2323
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2324 This macro does not do any hidden buffer changes."
bc91cbf50c24 Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents: 50983
diff changeset
2325 `(funcall ,(c-make-init-lang-vars-fun mode)))
36920
32a4317c6aa5 Update to version 5.28.
Gerd Moellmann <gerd@gnu.org>
parents: 34342
diff changeset
2326
19250
23f71af4d504 (c-symbol-key):
Richard M. Stallman <rms@gnu.org>
parents: 18842
diff changeset
2327
36920
32a4317c6aa5 Update to version 5.28.
Gerd Moellmann <gerd@gnu.org>
parents: 34342
diff changeset
2328 (cc-provide 'cc-langs)
38422
7a94f1c588c4 Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 36920
diff changeset
2329
52401
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 52341
diff changeset
2330 ;;; arch-tag: 1ab57482-cfc2-4c5b-b628-3539c3098822
18720
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2331 ;;; cc-langs.el ends here