diff options
Diffstat (limited to 'lisp/progmodes')
| -rw-r--r-- | lisp/progmodes/cc-awk.el | 6 | ||||
| -rw-r--r-- | lisp/progmodes/cc-langs.el | 10 |
2 files changed, 8 insertions, 8 deletions
diff --git a/lisp/progmodes/cc-awk.el b/lisp/progmodes/cc-awk.el index f44b34ac351..ef67a18d807 100644 --- a/lisp/progmodes/cc-awk.el +++ b/lisp/progmodes/cc-awk.el @@ -894,9 +894,9 @@ std\\(err\\|in\\|out\\)\\|user\\)\\)\\>\ ;; Keywords. (concat "\\<" (regexp-opt - '("BEGIN" "END" "break" "continue" "delete" "do" "else" - "exit" "for" "getline" "if" "in" "next" "nextfile" - "return" "while") + '("BEGIN" "END" "break" "case" "continue" "default" "delete" + "do" "else" "exit" "for" "getline" "if" "in" "next" + "nextfile" "return" "switch" "while") t) "\\>") ;; Builtins. diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el index 0bfca84cd96..96f0887eec0 100644 --- a/lisp/progmodes/cc-langs.el +++ b/lisp/progmodes/cc-langs.el @@ -2242,8 +2242,7 @@ This construct is \"<keyword> <expression> :\"." (c-lang-defconst c-label-kwds "Keywords introducing colon terminated labels in blocks." - t '("case" "default") - awk nil) + t '("case" "default")) (c-lang-defconst c-label-kwds-regexp ;; Adorned regexp matching any keyword that introduces a label. @@ -2998,18 +2997,19 @@ neither in a statement nor in a declaration context. The regexp is tested at the beginning of every sexp in a suspected label, i.e. before \":\". Only used if `c-recognize-colon-labels' is set." t (concat - ;; Don't allow string literals. - "\"\\|" ;; All keywords except `c-label-kwds' and `c-protection-kwds'. (c-make-keywords-re t (set-difference (c-lang-const c-keywords) (append (c-lang-const c-label-kwds) (c-lang-const c-protection-kwds)) :test 'string-equal))) + ;; Don't allow string literals, except in AWK. Character constants are OK. + (c objc java pike idl) (concat "\"\\|" + (c-lang-const c-nonlabel-token-key)) ;; Also check for open parens in C++, to catch member init lists in ;; constructors. We normally allow it so that macros with arguments ;; work in labels. - c++ (concat "\\s\(\\|" (c-lang-const c-nonlabel-token-key))) + c++ (concat "\\s\(\\|\"\\|" (c-lang-const c-nonlabel-token-key))) (c-lang-defvar c-nonlabel-token-key (c-lang-const c-nonlabel-token-key)) (c-lang-defconst c-nonlabel-token-2-key |
