]> code.delx.au - gnu-emacs/commit
Fix spurious fontification of "for (; a * b;)" in CC Mode.
authorAlan Mackenzie <acm@muc.de>
Mon, 16 May 2016 11:27:39 +0000 (11:27 +0000)
committerAlan Mackenzie <acm@muc.de>
Mon, 16 May 2016 11:27:39 +0000 (11:27 +0000)
commit116acebfbd28649b6ccf34e5c9046738d57aa28e
treebc1bd43469ba4fdbe316d709bdeb4d9e85fe45bf
parent65c8c7cb96c14f9c6accd03cc8851b5a3459049e
Fix spurious fontification of "for (; a * b;)" in CC Mode.

This fixes bug #7918 (again).

* lisp/progmodes/cc-engine.el (c-delq-from-dotted-list): New function.
(c-forward-decl-or-cast-1): Return a 4 element list in place of the previous
cons cell - additionally, return a flag indicating whether the declaration
parsed might have been an expression, and the position of the type identifier
in the said declaration.

* lisp/progmodes/cc-fonts.el (c-font-lock-declarations): When
c-forward-decl-or-cast-1 has indicated it might have parsed an expression,
check for it being a spurious declaration in a "for" statement.
lisp/progmodes/cc-engine.el
lisp/progmodes/cc-fonts.el