diff options
| author | Stefan Monnier | 2001-10-24 16:07:06 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2001-10-24 16:07:06 +0000 |
| commit | 174acba338eda851ad10c9f0e5372c68ff9fa8ba (patch) | |
| tree | 41a33dff87072ffaabb93b3373d52dfcbd226e83 | |
| parent | d9e3b8c640991828f244e4dd0a72133fe51baf25 (diff) | |
| download | emacs-174acba338eda851ad10c9f0e5372c68ff9fa8ba.tar.gz emacs-174acba338eda851ad10c9f0e5372c68ff9fa8ba.zip | |
(c-beginning-of-member-init-list):
Better handling of C++ template args to avoid confusion with `<'
and `>' used as operators in member init expressions.
From Martin Stjernholm <bug-cc-mode@gnu.org>.
| -rw-r--r-- | lisp/progmodes/cc-engine.el | 47 |
1 files changed, 23 insertions, 24 deletions
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index f76e1e38912..a30798d4b0f 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el | |||
| @@ -1028,31 +1028,30 @@ brace." | |||
| 1028 | (if (eq (char-after) ?,) | 1028 | (if (eq (char-after) ?,) |
| 1029 | (forward-char 1) | 1029 | (forward-char 1) |
| 1030 | (c-backward-syntactic-ws limit)) | 1030 | (c-backward-syntactic-ws limit)) |
| 1031 | (c-with-syntax-table (if (c-major-mode-is 'c++-mode) | 1031 | (while (and (< limit (point)) |
| 1032 | c++-template-syntax-table | 1032 | (eq (char-before) ?,)) |
| 1033 | (syntax-table)) | 1033 | ;; this will catch member inits with multiple |
| 1034 | (while (and (< limit (point)) | 1034 | ;; line arglists |
| 1035 | (eq (char-before) ?,)) | 1035 | (forward-char -1) |
| 1036 | ;; this will catch member inits with multiple | 1036 | (c-backward-syntactic-ws limit) |
| 1037 | ;; line arglists | 1037 | (if (eq (char-before) ?\)) |
| 1038 | (forward-char -1) | ||
| 1039 | (c-backward-syntactic-ws) | ||
| 1040 | (if (eq (char-before) ?\)) | ||
| 1041 | (c-backward-sexp 2) | ||
| 1042 | (c-backward-sexp 1)) | 1038 | (c-backward-sexp 1)) |
| 1043 | ;; Skip over any template arg to the class. | 1039 | (c-backward-syntactic-ws limit) |
| 1044 | (if (eq (char-after) ?<) | 1040 | ;; Skip over any template arg to the class. |
| 1045 | (c-backward-sexp 1)) | 1041 | (if (eq (char-before) ?>) |
| 1046 | ;; Skip backwards over a fully::qualified::name. | 1042 | (c-with-syntax-table c++-template-syntax-table |
| 1047 | (c-backward-syntactic-ws limit) | 1043 | (c-backward-sexp 1))) |
| 1048 | (while (and (eq (char-before) ?:) | 1044 | (c-backward-sexp 1) |
| 1049 | (save-excursion | 1045 | (c-backward-syntactic-ws limit) |
| 1050 | (forward-char -1) | 1046 | ;; Skip backwards over a fully::qualified::name. |
| 1051 | (eq (char-before) ?:))) | 1047 | (while (and (eq (char-before) ?:) |
| 1052 | (backward-char 2) | 1048 | (save-excursion |
| 1053 | (c-backward-sexp 1)) | 1049 | (forward-char -1) |
| 1054 | ;; now continue checking | 1050 | (eq (char-before) ?:))) |
| 1055 | (c-backward-syntactic-ws limit))) | 1051 | (backward-char 2) |
| 1052 | (c-backward-sexp 1)) | ||
| 1053 | ;; now continue checking | ||
| 1054 | (c-backward-syntactic-ws limit)) | ||
| 1056 | (and (< limit (point)) | 1055 | (and (< limit (point)) |
| 1057 | (eq (char-before) ?:))) | 1056 | (eq (char-before) ?:))) |
| 1058 | 1057 | ||