Fix fontification of first declaration within a C++ lambda form.
* lisp/progmodes/cc-engine.el (c-looking-at-or-maybe-in-bracelist): Cease spuriously recognizing the braces of a lambda form as a brace list when there is an "=" preceding the introductory brackets.
This commit is contained in:
parent
aa66da220c
commit
e220d6e112
1 changed files with 12 additions and 1 deletions
|
@ -10440,7 +10440,7 @@ comment at the start of cc-engine.el for more info."
|
||||||
c-decl-block-key))
|
c-decl-block-key))
|
||||||
(braceassignp 'dontknow)
|
(braceassignp 'dontknow)
|
||||||
inexpr-brace-list bufpos macro-start res pos after-type-id-pos
|
inexpr-brace-list bufpos macro-start res pos after-type-id-pos
|
||||||
in-paren)
|
in-paren parens-before-brace)
|
||||||
|
|
||||||
(setq res (c-backward-token-2 1 t lim))
|
(setq res (c-backward-token-2 1 t lim))
|
||||||
;; Checks to do only on the first sexp before the brace.
|
;; Checks to do only on the first sexp before the brace.
|
||||||
|
@ -10458,6 +10458,9 @@ comment at the start of cc-engine.el for more info."
|
||||||
((and (looking-at c-symbol-start)
|
((and (looking-at c-symbol-start)
|
||||||
(not (looking-at c-keywords-regexp)))
|
(not (looking-at c-keywords-regexp)))
|
||||||
(setq after-type-id-pos (point)))
|
(setq after-type-id-pos (point)))
|
||||||
|
((eq (char-after) ?\()
|
||||||
|
(setq parens-before-brace t)
|
||||||
|
nil)
|
||||||
(t nil))
|
(t nil))
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(cond
|
(cond
|
||||||
|
@ -10506,6 +10509,14 @@ comment at the start of cc-engine.el for more info."
|
||||||
;; Single identifier between '(' and '{'. We have a bracelist.
|
;; Single identifier between '(' and '{'. We have a bracelist.
|
||||||
(cons after-type-id-pos 'in-paren))
|
(cons after-type-id-pos 'in-paren))
|
||||||
|
|
||||||
|
;; Are we at the parens of a C++ lambda expression?
|
||||||
|
((and parens-before-brace
|
||||||
|
(save-excursion
|
||||||
|
(and
|
||||||
|
(zerop (c-backward-token-2 1 t lim))
|
||||||
|
(c-looking-at-c++-lambda-capture-list))))
|
||||||
|
nil) ; a lambda expression isn't a brace list.
|
||||||
|
|
||||||
(t
|
(t
|
||||||
(goto-char pos)
|
(goto-char pos)
|
||||||
;; Checks to do on all sexps before the brace, up to the
|
;; Checks to do on all sexps before the brace, up to the
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue