[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 9b99532: C++ Mode: recognize brace blocks without the hitherto re
From: |
Alan Mackenzie |
Subject: |
master 9b99532: C++ Mode: recognize brace blocks without the hitherto required = sign |
Date: |
Fri, 3 Apr 2020 16:39:37 -0400 (EDT) |
branch: master
commit 9b995320c853a45d785896fb25f788f9248658f4
Author: Alan Mackenzie <address@hidden>
Commit: Alan Mackenzie <address@hidden>
C++ Mode: recognize brace blocks without the hitherto required = sign
* lisp/progmodes/cc-engine.el (c-looking-at-or-maybe-in-bracelist): Add code
to recognize a literal brace expression following an array declaration for
C++.
(c-looking-at-inexpr-block): Replace c-symbol-chars with c-symbol-char-key,
fixing a coding error.
---
lisp/progmodes/cc-engine.el | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index bccef68..aa3f7d3 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -11685,7 +11685,16 @@ comment at the start of cc-engine.el for more info."
(not (c-in-literal))
))))
nil)
- (t t))))))
+ (t t)))))
+ ((and
+ (c-major-mode-is 'c++-mode)
+ (eq (char-after) ?\[)
+ ;; Be careful of "operator []"
+ (not (save-excursion
+ (c-backward-token-2 1 nil lim)
+ (looking-at c-opt-op-identifier-prefix))))
+ (setq braceassignp t)
+ nil))
(when (eq braceassignp 'dontknow)
(cond ((and
(not (eq (char-after) ?,))
@@ -12057,7 +12066,7 @@ comment at the start of cc-engine.el for more info."
(c-backward-token-2 1 nil lim)
(and
(not (and (c-on-identifier)
- (looking-at c-symbol-chars)))
+ (looking-at c-symbol-char-key)))
(not (looking-at c-opt-op-identifier-prefix)))))))
(cons 'inlambda bracket-pos))
((and c-recognize-paren-inexpr-blocks
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 9b99532: C++ Mode: recognize brace blocks without the hitherto required = sign,
Alan Mackenzie <=