1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-27 07:37:33 +00:00

CC Mode: stop extra parens on expression causing false fontification as type

* lisp/progmodes/cc-fonts.el (c-get-fontification-context): recognize
arithmetic operator followed by several open parentheses, not just one, as not
being an argument list.
This commit is contained in:
Alan Mackenzie 2018-12-10 14:30:40 +00:00
parent 0220391c00
commit 2075864c77

View File

@ -1279,12 +1279,14 @@ casts and declarations are fontified. Used on level 2 and higher."
(c-put-char-property (1- match-pos)
'c-type 'c-decl-arg-start)
(cons 'decl nil))
;; Got an open paren preceded by an arith operator.
;; Got (an) open paren(s) preceded by an arith operator.
((and (eq (char-before match-pos) ?\()
(save-excursion
(goto-char match-pos)
(and (zerop (c-backward-token-2 2))
(looking-at c-arithmetic-op-regexp))))
(while
(progn (c-backward-token-2)
(eq (char-after) ?\()))
(looking-at c-arithmetic-op-regexp)))
(cons nil nil))
;; In a C++ member initialization list.
((and (eq (char-before match-pos) ?,)