emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-26 e220d6e: Fix fontification of first declaration w


From: Alan Mackenzie
Subject: [Emacs-diffs] emacs-26 e220d6e: Fix fontification of first declaration within a C++ lambda form.
Date: Thu, 14 Dec 2017 16:07:30 -0500 (EST)

branch: emacs-26
commit e220d6e112e33f3f897c305d0d5d278d83191774
Author: Alan Mackenzie <address@hidden>
Commit: Alan Mackenzie <address@hidden>

    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.
---
 lisp/progmodes/cc-engine.el | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index 881209c..12ec8f7 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."
                c-decl-block-key))
          (braceassignp 'dontknow)
          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))
       ;; 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)
                      (not (looking-at c-keywords-regexp)))
                 (setq after-type-id-pos (point)))
+               ((eq (char-after) ?\()
+                (setq parens-before-brace t)
+                nil)
                (t nil))
               (save-excursion
                 (cond
@@ -10506,6 +10509,14 @@ comment at the start of cc-engine.el for more info."
        ;; Single identifier between '(' and '{'.  We have a bracelist.
        (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
        (goto-char pos)
        ;; Checks to do on all sexps before the brace, up to the



reply via email to

[Prev in Thread] Current Thread [Next in Thread]