aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Mackenzie2017-12-14 21:04:39 +0000
committerAlan Mackenzie2017-12-14 21:04:39 +0000
commite220d6e112e33f3f897c305d0d5d278d83191774 (patch)
tree9210a82e193b3d6ab37d97537b559bc0eaa74188
parentaa66da220cdb6aaab5b347093fd40f0e1580913b (diff)
downloademacs-e220d6e112e33f3f897c305d0d5d278d83191774.tar.gz
emacs-e220d6e112e33f3f897c305d0d5d278d83191774.zip
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.
-rw-r--r--lisp/progmodes/cc-engine.el13
1 files changed, 12 insertions, 1 deletions
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index 881209c286e..12ec8f74fea 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -10440,7 +10440,7 @@ comment at the start of cc-engine.el for more info."
10440 c-decl-block-key)) 10440 c-decl-block-key))
10441 (braceassignp 'dontknow) 10441 (braceassignp 'dontknow)
10442 inexpr-brace-list bufpos macro-start res pos after-type-id-pos 10442 inexpr-brace-list bufpos macro-start res pos after-type-id-pos
10443 in-paren) 10443 in-paren parens-before-brace)
10444 10444
10445 (setq res (c-backward-token-2 1 t lim)) 10445 (setq res (c-backward-token-2 1 t lim))
10446 ;; Checks to do only on the first sexp before the brace. 10446 ;; 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."
10458 ((and (looking-at c-symbol-start) 10458 ((and (looking-at c-symbol-start)
10459 (not (looking-at c-keywords-regexp))) 10459 (not (looking-at c-keywords-regexp)))
10460 (setq after-type-id-pos (point))) 10460 (setq after-type-id-pos (point)))
10461 ((eq (char-after) ?\()
10462 (setq parens-before-brace t)
10463 nil)
10461 (t nil)) 10464 (t nil))
10462 (save-excursion 10465 (save-excursion
10463 (cond 10466 (cond
@@ -10506,6 +10509,14 @@ comment at the start of cc-engine.el for more info."
10506 ;; Single identifier between '(' and '{'. We have a bracelist. 10509 ;; Single identifier between '(' and '{'. We have a bracelist.
10507 (cons after-type-id-pos 'in-paren)) 10510 (cons after-type-id-pos 'in-paren))
10508 10511
10512 ;; Are we at the parens of a C++ lambda expression?
10513 ((and parens-before-brace
10514 (save-excursion
10515 (and
10516 (zerop (c-backward-token-2 1 t lim))
10517 (c-looking-at-c++-lambda-capture-list))))
10518 nil) ; a lambda expression isn't a brace list.
10519
10509 (t 10520 (t
10510 (goto-char pos) 10521 (goto-char pos)
10511 ;; Checks to do on all sexps before the brace, up to the 10522 ;; Checks to do on all sexps before the brace, up to the