mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2025-01-19 18:13:55 +00:00
(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>.
This commit is contained in:
parent
d9e3b8c640
commit
174acba338
@ -1028,31 +1028,30 @@ brace."
|
|||||||
(if (eq (char-after) ?,)
|
(if (eq (char-after) ?,)
|
||||||
(forward-char 1)
|
(forward-char 1)
|
||||||
(c-backward-syntactic-ws limit))
|
(c-backward-syntactic-ws limit))
|
||||||
(c-with-syntax-table (if (c-major-mode-is 'c++-mode)
|
(while (and (< limit (point))
|
||||||
c++-template-syntax-table
|
(eq (char-before) ?,))
|
||||||
(syntax-table))
|
;; this will catch member inits with multiple
|
||||||
(while (and (< limit (point))
|
;; line arglists
|
||||||
(eq (char-before) ?,))
|
(forward-char -1)
|
||||||
;; this will catch member inits with multiple
|
(c-backward-syntactic-ws limit)
|
||||||
;; line arglists
|
(if (eq (char-before) ?\))
|
||||||
(forward-char -1)
|
|
||||||
(c-backward-syntactic-ws)
|
|
||||||
(if (eq (char-before) ?\))
|
|
||||||
(c-backward-sexp 2)
|
|
||||||
(c-backward-sexp 1))
|
(c-backward-sexp 1))
|
||||||
;; Skip over any template arg to the class.
|
(c-backward-syntactic-ws limit)
|
||||||
(if (eq (char-after) ?<)
|
;; Skip over any template arg to the class.
|
||||||
(c-backward-sexp 1))
|
(if (eq (char-before) ?>)
|
||||||
;; Skip backwards over a fully::qualified::name.
|
(c-with-syntax-table c++-template-syntax-table
|
||||||
(c-backward-syntactic-ws limit)
|
(c-backward-sexp 1)))
|
||||||
(while (and (eq (char-before) ?:)
|
(c-backward-sexp 1)
|
||||||
(save-excursion
|
(c-backward-syntactic-ws limit)
|
||||||
(forward-char -1)
|
;; Skip backwards over a fully::qualified::name.
|
||||||
(eq (char-before) ?:)))
|
(while (and (eq (char-before) ?:)
|
||||||
(backward-char 2)
|
(save-excursion
|
||||||
(c-backward-sexp 1))
|
(forward-char -1)
|
||||||
;; now continue checking
|
(eq (char-before) ?:)))
|
||||||
(c-backward-syntactic-ws limit)))
|
(backward-char 2)
|
||||||
|
(c-backward-sexp 1))
|
||||||
|
;; now continue checking
|
||||||
|
(c-backward-syntactic-ws limit))
|
||||||
(and (< limit (point))
|
(and (< limit (point))
|
||||||
(eq (char-before) ?:)))
|
(eq (char-before) ?:)))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user