diff options
author | Alan Mackenzie <acm@muc.de> | 2022-09-29 15:22:42 +0000 |
---|---|---|
committer | Alan Mackenzie <acm@muc.de> | 2022-09-29 15:22:42 +0000 |
commit | a18918df0bd0ddd9c8b05b99c302e26b226af5d3 (patch) | |
tree | f6dc68cd4a98a9ec0b89a07266f1c05f712b9d24 /test/lisp/emacs-lisp/memory-report-tests.el | |
parent | 48c9f9d31d3eab756595c05cd2d3aced0fd856ca (diff) | |
download | emacs-a18918df0bd0ddd9c8b05b99c302e26b226af5d3.tar.gz emacs-a18918df0bd0ddd9c8b05b99c302e26b226af5d3.tar.bz2 emacs-a18918df0bd0ddd9c8b05b99c302e26b226af5d3.zip |
CC Mode: Refactor c-forward-delarator and callers
c-forward-declarator now moves over a complete declarator, including any
arglist expression, but possibly not including certain C++20 constructs.
* lisp/progmodes/cc-engine.el (c-forward-decl-arglist): New function,
extracted from c-do-declarators.
(c-forward-declarator): Extend the result list by one element, denoting
whether the function parsed an argument list. Insert special handling for a
C++ operator<op> construct. If there is a parenthesis expression, and it is
an argument list, move forward over it.
(c-do-declarators): Append an optional parameter, cdd-anon-accepted
instructing the function to handle declarators without identifiers. Extract
c-forward-decl-arglist.
* lisp/progmodes/cc-fonts.el (c-font-lock-declarators): New &optional
parameter accept-anon, as above. Analyze and use the identifier location
returned by c-do-declarators, rather than using c-last-identifier-range.
(c-font-lock-single-decl): Determine accept-anon from the context, passing it
as argument to c-font-lock-declarators.
* lisp/progmodes/cc-langs.el (c-opt-identifier-prefix-key): Make a
c-lang-defvar out of this existing c-lang-defconst.
* lisp/progmodes/cc-mode.el (c-fl-decl-end): Adapt for the new
c-forward-declarator which now moves over arglists. Amend better to handle
certain syntactically invalid constructs in C++.
Diffstat (limited to 'test/lisp/emacs-lisp/memory-report-tests.el')
0 files changed, 0 insertions, 0 deletions