]> git.eshelyaron.com Git - emacs.git/commit
CC Mode: Fontify cast types without adding them to c-found-types
authorAlan Mackenzie <acm@muc.de>
Fri, 28 Oct 2022 17:50:33 +0000 (17:50 +0000)
committerAlan Mackenzie <acm@muc.de>
Fri, 28 Oct 2022 17:50:33 +0000 (17:50 +0000)
commit622724e95d6bcf858c52922e7d85423c8337bc06
treec60bf2a29bc4167fe33b0fa4b4026077493f65a0
parentd79cdcd4ff6687c2f0dcfde83ba36732408e52e8
CC Mode: Fontify cast types without adding them to c-found-types

* lisp/progmodes/cc-engine.el (c-forward-type): Test for the special new
value `just-one' of c-promote-possible-types, and if found, fontify the type,
but don't add it to c-found-types.
(c-forward-decl-or-cast-1): Add the new &optional parameter inside-macro.
Whilst checking for a cast construct, analyze the text following the closing
paren more rigorously.
Check for, and allow, the closing paren of a macro arglist before the putative
cast construct.

* lisp/progmodes/cc-fonts.el (c-font-lock-declarations): In the lambda
function, pass the parameter inside-macro to c-forward-decl-or-cast-1.

* lisp/progmodes/cc-langs.el (c-primary-expr-regexp-details): New
c-lang-defvar which calculates `c-primary-expr-regexp' and three match
numbers for various sub-expressions in the regexp.
(c-primary-expr-regexp): Now extracted from `c-primary-expr-regexp-details'.
(c-per-++---match, c-per-&*+--match, c-per-\(-match): New
c-lang-defconsts/vars extracted from `c-primary-expr-regexp-details'.
lisp/progmodes/cc-engine.el
lisp/progmodes/cc-fonts.el
lisp/progmodes/cc-langs.el