diff lisp/progmodes/cc-langs.el @ 102168:4f3b9ebc200a

cc-engine.el (c-beginning-of-statement-1): Enhance to parse case clauses with (compile-time) expressions. cc-langs.el (c-case-kwds-regexp): New variable for the above.
author Alan Mackenzie <acm@muc.de>
date Sat, 21 Feb 2009 16:10:39 +0000
parents c7dad4ac139c
children 49b361ba00e8
line wrap: on
line diff
--- a/lisp/progmodes/cc-langs.el	Sat Feb 21 16:08:29 2009 +0000
+++ b/lisp/progmodes/cc-langs.el	Sat Feb 21 16:10:39 2009 +0000
@@ -2115,6 +2115,17 @@
 	(c-make-keywords-re t (c-lang-const c-asm-stmt-kwds))))
 (c-lang-defvar c-opt-asm-stmt-key (c-lang-const c-opt-asm-stmt-key))
 
+(c-lang-defconst c-case-kwds
+  "The keyword\(s) which introduce a \"case\" like construct.
+This construct is \"<keyword> <expression> :\"."
+  t '("case")
+  awk nil)
+
+(c-lang-defconst c-case-kwds-regexp
+  ;; Adorned regexp matching any "case"-like keyword.
+  t (c-make-keywords-re t (c-lang-const c-case-kwds)))
+(c-lang-defvar c-case-kwds-regexp (c-lang-const c-case-kwds-regexp))
+
 (c-lang-defconst c-label-kwds
   "Keywords introducing colon terminated labels in blocks."
   t '("case" "default")