[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master b3a5ad1: CC Mode: minor amendments more accurately to handle virt
From: |
Alan Mackenzie |
Subject: |
master b3a5ad1: CC Mode: minor amendments more accurately to handle virtual semicolons, etc. |
Date: |
Tue, 26 Oct 2021 16:14:56 -0400 (EDT) |
branch: master
commit b3a5ad14c1f047786fb71ff6f181b529ffc6ed9e
Author: Alan Mackenzie <acm@muc.de>
Commit: Alan Mackenzie <acm@muc.de>
CC Mode: minor amendments more accurately to handle virtual semicolons, etc.
* lisp/progmodes/cc-engine.el (c-laomib-loop): Check for a virtual semicolon
as well as a ;.
(c-guess-basic-syntax): CASE 5D - Use c-crosses-statement-barrier-p to check
whether we've gone back past a virtual semicolon.
---
lisp/progmodes/cc-engine.el | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index 75487bd..a4568bd 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -12102,7 +12102,10 @@ comment at the start of cc-engine.el for more info."
(and (c-major-mode-is 'pike-mode)
c-decl-block-key)))
(while (eq braceassignp 'dontknow)
- (cond ((eq (char-after) ?\;)
+ (cond ((or (eq (char-after) ?\;)
+ (save-excursion
+ (progn (c-backward-syntactic-ws)
+ (c-at-vsemi-p))))
(setq braceassignp nil))
((and class-key
(looking-at class-key))
@@ -14026,7 +14029,8 @@ comment at the start of cc-engine.el for more info."
;; clause - we assume only C++ needs it.
(c-syntactic-skip-backward "^;,=" lim t))
(setq placeholder (point))
- (memq (char-before) '(?, ?= ?<)))
+ (and (memq (char-before) '(?, ?= ?<))
+ (not (c-crosses-statement-barrier-p (point) indent-point))))
(cond
;; CASE 5D.6: Something like C++11's "using foo = <type-exp>"
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master b3a5ad1: CC Mode: minor amendments more accurately to handle virtual semicolons, etc.,
Alan Mackenzie <=