commit/cc-mode: acm: CC Mode: Fix an enum intro being parsed as
defun-block-intro
6 years, 8 months
Bitbucket
1 new commit in cc-mode:
https://bitbucket.org/xemacs/cc-mode/commits/32021e4326fe/
Changeset: 32021e4326fe
User: acm
Date: 2018-02-02 20:34:04+00:00
Summary: CC Mode: Fix an enum intro being parsed as defun-block-intro
* cc-engine.el (c-inside-bracelist-p): Return a bufpos rather than t for the
enum case.
(c-add-stmt-syntax, c-guess-continued-construct): Replace
c-looking-at-or-maybe-in-bracelist by c-inside-bracelist-p, since the former
does not recognize enum brace lists, but the latter does.
* cc-fonts.el (c-get-fontification-context): Replace
c-looking-at-or-maybe-in-bracelist by c-inside-bracelist-p.
Affected #: 2 files
diff -r 9d8620fddb42529768dabcd93d50e191bda75a42 -r 32021e4326fe35ba7e142824d8942e40728bbeb3 cc-engine.el
--- a/cc-engine.el
+++ b/cc-engine.el
@@ -10674,7 +10674,8 @@
;; This will pick up brace list declarations.
(save-excursion
(goto-char containing-sexp)
- (c-backward-over-enum-header))
+ (and (c-backward-over-enum-header)
+ (point)))
;; this will pick up array/aggregate init lists, even if they are nested.
(save-excursion
(let ((bufpos t)
@@ -11299,9 +11300,7 @@
(cdr (assoc (match-string 1)
c-other-decl-block-key-in-symbols-alist))
(max (c-point 'boi paren-pos) (point))))
- ((save-excursion
- (goto-char paren-pos)
- (c-looking-at-or-maybe-in-bracelist containing-sexp))
+ ((c-inside-bracelist-p paren-pos paren-state nil)
(if (save-excursion
(goto-char paren-pos)
(c-looking-at-statement-block))
@@ -11393,10 +11392,9 @@
;; CASE B.2: brace-list-open
((or (consp special-brace-list)
- (consp
- (c-looking-at-or-maybe-in-bracelist
- containing-sexp beg-of-same-or-containing-stmt))
- )
+ (c-inside-bracelist-p (point)
+ (cons containing-sexp paren-state)
+ nil))
;; The most semantically accurate symbol here is
;; brace-list-open, but we normally report it simply as a
;; statement-cont. The reason is that one normally adjusts
@@ -11942,7 +11940,7 @@
(cond
((c-backward-over-enum-header)
(setq placeholder (c-point 'boi)))
- ((consp (setq placeholder
+ ((consp (setq placeholder
(c-looking-at-or-maybe-in-bracelist
containing-sexp lim)))
(setq tmpsymbol (and (cdr placeholder) 'topmost-intro-cont))
diff -r 9d8620fddb42529768dabcd93d50e191bda75a42 -r 32021e4326fe35ba7e142824d8942e40728bbeb3 cc-fonts.el
--- a/cc-fonts.el
+++ b/cc-fonts.el
@@ -1234,10 +1234,9 @@
(cons 'decl nil))
;; We're inside a brace list.
((and (eq (char-before match-pos) ?{)
- (save-excursion
- (goto-char (1- match-pos))
- (consp
- (c-looking-at-or-maybe-in-bracelist))))
+ (c-inside-bracelist-p (1- match-pos)
+ (cdr (c-parse-state))
+ nil))
(c-put-char-property (1- match-pos) 'c-type
'c-not-decl)
(cons 'not-decl nil))
Repository URL: https://bitbucket.org/xemacs/cc-mode/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.