diff options
| author | Alan Mackenzie | 2016-01-23 19:38:49 +0000 |
|---|---|---|
| committer | Alan Mackenzie | 2016-01-23 19:38:49 +0000 |
| commit | a1865bcf966eafdce28f50fb8a19c1bfd831079a (patch) | |
| tree | dcb1e7f0a1d41a1328e0e3d2a1649f31dfd9488f | |
| parent | 76045f7d6f654ea20e09412e5054f9159d1bb142 (diff) | |
| download | emacs-a1865bcf966eafdce28f50fb8a19c1bfd831079a.tar.gz emacs-a1865bcf966eafdce28f50fb8a19c1bfd831079a.zip | |
Distinguish the two meanings of Java's keyword "default". Fixes bug #22358.
* lisp/progmodes/cc-engine.el (c-guess-basic-syntax CASE 14): Check the
context of case labels (including "default") more rigorously.
(c-guess-basic-syntax CASE 15): Consequential amendment.
* lisp/progmodes/cc-langs.el (c-modifier-kwds): Add "default" to Java's value.
| -rw-r--r-- | lisp/progmodes/cc-engine.el | 15 | ||||
| -rw-r--r-- | lisp/progmodes/cc-langs.el | 4 |
2 files changed, 16 insertions, 3 deletions
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index 8113446e4d3..815bd7216f2 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el | |||
| @@ -10072,7 +10072,19 @@ comment at the start of cc-engine.el for more info." | |||
| 10072 | paren-state))) | 10072 | paren-state))) |
| 10073 | 10073 | ||
| 10074 | ;; CASE 14: A case or default label | 10074 | ;; CASE 14: A case or default label |
| 10075 | ((looking-at c-label-kwds-regexp) | 10075 | ((save-excursion |
| 10076 | (and (looking-at c-label-kwds-regexp) | ||
| 10077 | (or (c-major-mode-is 'idl-mode) | ||
| 10078 | (and | ||
| 10079 | containing-sexp | ||
| 10080 | (goto-char containing-sexp) | ||
| 10081 | (eq (char-after) ?{) | ||
| 10082 | (progn (c-backward-syntactic-ws) t) | ||
| 10083 | (eq (char-before) ?\)) | ||
| 10084 | (c-go-list-backward) | ||
| 10085 | (progn (c-backward-syntactic-ws) t) | ||
| 10086 | (c-simple-skip-symbol-backward) | ||
| 10087 | (looking-at c-block-stmt-2-key))))) | ||
| 10076 | (if containing-sexp | 10088 | (if containing-sexp |
| 10077 | (progn | 10089 | (progn |
| 10078 | (goto-char containing-sexp) | 10090 | (goto-char containing-sexp) |
| @@ -10088,6 +10100,7 @@ comment at the start of cc-engine.el for more info." | |||
| 10088 | ((save-excursion | 10100 | ((save-excursion |
| 10089 | (back-to-indentation) | 10101 | (back-to-indentation) |
| 10090 | (and (not (looking-at c-syntactic-ws-start)) | 10102 | (and (not (looking-at c-syntactic-ws-start)) |
| 10103 | (not (looking-at c-label-kwds-regexp)) | ||
| 10091 | (c-forward-label))) | 10104 | (c-forward-label))) |
| 10092 | (cond (containing-decl-open | 10105 | (cond (containing-decl-open |
| 10093 | (setq placeholder (c-add-class-syntax 'inclass | 10106 | (setq placeholder (c-add-class-syntax 'inclass |
diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el index 48dd9960886..8a1d43c627c 100644 --- a/lisp/progmodes/cc-langs.el +++ b/lisp/progmodes/cc-langs.el | |||
| @@ -1980,8 +1980,8 @@ will be handled." | |||
| 1980 | ;; In CORBA CIDL: | 1980 | ;; In CORBA CIDL: |
| 1981 | "bindsTo" "delegatesTo" "implements" "proxy" "storedOn") | 1981 | "bindsTo" "delegatesTo" "implements" "proxy" "storedOn") |
| 1982 | ;; Note: "const" is not used in Java, but it's still a reserved keyword. | 1982 | ;; Note: "const" is not used in Java, but it's still a reserved keyword. |
| 1983 | java '("abstract" "const" "final" "native" "private" "protected" "public" | 1983 | java '("abstract" "const" "default" "final" "native" "private" "protected" |
| 1984 | "static" "strictfp" "synchronized" "transient" "volatile") | 1984 | "public" "static" "strictfp" "synchronized" "transient" "volatile") |
| 1985 | pike '("final" "inline" "local" "nomask" "optional" "private" "protected" | 1985 | pike '("final" "inline" "local" "nomask" "optional" "private" "protected" |
| 1986 | "public" "static" "variant")) | 1986 | "public" "static" "variant")) |
| 1987 | 1987 | ||