diff options
| author | Alan Mackenzie | 2011-12-13 21:13:51 +0000 |
|---|---|---|
| committer | Alan Mackenzie | 2011-12-13 21:13:51 +0000 |
| commit | 898169a2d88c3538cdfd41feb0b16267165065bd (patch) | |
| tree | cb1baea0c5c1232e07d49bbe54d0a4a333f19c4c /lisp/progmodes | |
| parent | 13d49cbb266f0ead789944508ad0872129885609 (diff) | |
| download | emacs-898169a2d88c3538cdfd41feb0b16267165065bd.tar.gz emacs-898169a2d88c3538cdfd41feb0b16267165065bd.zip | |
Add the switch statement to AWK Mode.
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\\)\\)\\>\ | |||
| 894 | ;; Keywords. | 894 | ;; Keywords. |
| 895 | (concat "\\<" | 895 | (concat "\\<" |
| 896 | (regexp-opt | 896 | (regexp-opt |
| 897 | '("BEGIN" "END" "break" "continue" "delete" "do" "else" | 897 | '("BEGIN" "END" "break" "case" "continue" "default" "delete" |
| 898 | "exit" "for" "getline" "if" "in" "next" "nextfile" | 898 | "do" "else" "exit" "for" "getline" "if" "in" "next" |
| 899 | "return" "while") | 899 | "nextfile" "return" "switch" "while") |
| 900 | t) "\\>") | 900 | t) "\\>") |
| 901 | 901 | ||
| 902 | ;; Builtins. | 902 | ;; 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> :\"." | |||
| 2242 | 2242 | ||
| 2243 | (c-lang-defconst c-label-kwds | 2243 | (c-lang-defconst c-label-kwds |
| 2244 | "Keywords introducing colon terminated labels in blocks." | 2244 | "Keywords introducing colon terminated labels in blocks." |
| 2245 | t '("case" "default") | 2245 | t '("case" "default")) |
| 2246 | awk nil) | ||
| 2247 | 2246 | ||
| 2248 | (c-lang-defconst c-label-kwds-regexp | 2247 | (c-lang-defconst c-label-kwds-regexp |
| 2249 | ;; Adorned regexp matching any keyword that introduces a label. | 2248 | ;; 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 | |||
| 2998 | tested at the beginning of every sexp in a suspected label, | 2997 | tested at the beginning of every sexp in a suspected label, |
| 2999 | i.e. before \":\". Only used if `c-recognize-colon-labels' is set." | 2998 | i.e. before \":\". Only used if `c-recognize-colon-labels' is set." |
| 3000 | t (concat | 2999 | t (concat |
| 3001 | ;; Don't allow string literals. | ||
| 3002 | "\"\\|" | ||
| 3003 | ;; All keywords except `c-label-kwds' and `c-protection-kwds'. | 3000 | ;; All keywords except `c-label-kwds' and `c-protection-kwds'. |
| 3004 | (c-make-keywords-re t | 3001 | (c-make-keywords-re t |
| 3005 | (set-difference (c-lang-const c-keywords) | 3002 | (set-difference (c-lang-const c-keywords) |
| 3006 | (append (c-lang-const c-label-kwds) | 3003 | (append (c-lang-const c-label-kwds) |
| 3007 | (c-lang-const c-protection-kwds)) | 3004 | (c-lang-const c-protection-kwds)) |
| 3008 | :test 'string-equal))) | 3005 | :test 'string-equal))) |
| 3006 | ;; Don't allow string literals, except in AWK. Character constants are OK. | ||
| 3007 | (c objc java pike idl) (concat "\"\\|" | ||
| 3008 | (c-lang-const c-nonlabel-token-key)) | ||
| 3009 | ;; Also check for open parens in C++, to catch member init lists in | 3009 | ;; Also check for open parens in C++, to catch member init lists in |
| 3010 | ;; constructors. We normally allow it so that macros with arguments | 3010 | ;; constructors. We normally allow it so that macros with arguments |
| 3011 | ;; work in labels. | 3011 | ;; work in labels. |
| 3012 | c++ (concat "\\s\(\\|" (c-lang-const c-nonlabel-token-key))) | 3012 | c++ (concat "\\s\(\\|\"\\|" (c-lang-const c-nonlabel-token-key))) |
| 3013 | (c-lang-defvar c-nonlabel-token-key (c-lang-const c-nonlabel-token-key)) | 3013 | (c-lang-defvar c-nonlabel-token-key (c-lang-const c-nonlabel-token-key)) |
| 3014 | 3014 | ||
| 3015 | (c-lang-defconst c-nonlabel-token-2-key | 3015 | (c-lang-defconst c-nonlabel-token-2-key |