Commit 2075864c authored by Alan Mackenzie's avatar Alan Mackenzie
Browse files

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.
parent 0220391c
Pipeline #249 failed with stage
in 5 minutes and 22 seconds
......@@ -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) ?\()
(goto-char match-pos)
(and (zerop (c-backward-token-2 2))
(looking-at c-arithmetic-op-regexp))))
(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) ?,)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment