aboutsummaryrefslogtreecommitdiffstats
path: root/src/coding.c
diff options
context:
space:
mode:
authorAlan Mackenzie2025-05-01 16:12:18 +0000
committerAlan Mackenzie2025-05-01 16:12:18 +0000
commit8ddb8b0e45f150a5866c86af8ed2054b792761ff (patch)
treec2dd78f1b2c1c66c5cee481ea6ec75cc690a443b /src/coding.c
parentb589fa9e23d896ce76b64016e0a5750f2131c393 (diff)
downloademacs-8ddb8b0e45f150a5866c86af8ed2054b792761ff.tar.gz
emacs-8ddb8b0e45f150a5866c86af8ed2054b792761ff.zip
Implement C23 features:
Improve the handling of #error and #warning in C and C++ Modes. * lisp/progmodes/cc-engine.el (c-looking-at-c++-attribute) (c-enclosing-c++-attribute, c-forward-sws, c-backward-sws): Handle attributes in C as they have been handled in C++. (c-forward-align-clause-throw-if-invalid): New macro. (c-forward-type): Handle alignas, alignof, and _BitInt, putting a catch block around most of the function to catch invalid uses of these new keywords. (c-in-id-arglist): New function. (c-forward-decl-or-cast-1): Recognize a "maybe" type identifier as a type in arglists when there is no parameter identifier associated with it. * lisp/progmodes/cc-fonts.el (c-font-lock-cpp-messages): New function. (c-cpp-matchers): Move the handling of "invalid" comment delimiters outside of the block handling CPP directives. Remove the inline handling of #error and #warning, using the new function c-font-lock-cpp-messages instead. (c-get-fontification-context): Handle alignof, alignas, _BitInt. (c-font-lock-declarations): Adapt fontification of K&R parameters to the C23 nameless parameter scheme. * lisp/progmodes/cc-langs.el (c-has-quoted-numbers) (c-stmt-boundary-skip-chars) (c-recognize-post-brace-list-type-p, c-modifier-kwds) (c-constant-kwds): Handle C the same as the existing C++ handling. (c-cpp-message-directives-re, noncontinued-line-end) (c-cpp-messages-re, c-cpp-message-match-no): New c-lang-consts/vars. (c-cpp-include-directives): New directive embed. (c-cpp-expr-directives): New directives elifdef, elifndef. (c-primitive-type-kwds): New types, _Decimal*, bool, char*_t, nullptr_t. (c-typeof-kwds): New keyword typeof_unqual. (c-type-with-paren-kwds, c-type-with-paren-key): New c-lang-const/vars. (c-type-modifier-with-parens-kwds) (c-type-modifier-with-parens-key, c-type-internal-paren-kwds) (c-type-internal-paren-key): New c-lang-const/vars. (c-type-modifier-prefix-kwds, c-type-start-kwds): Amend with the above new c-lang-consts. (c-no-type-with-equals-kwds, c-no-type-with-equals-key): New c-lang-const/vars. (c-modifier-kwds): Add constexpr, auto, and thread_local to the C value. (c-paren-nontype-kwds): Add static_assert to the C value. (c-constant-kwds): Add nullptr to the C value. (c-regular-keywords-regexp): Include c-type-with-paren-kwds. (c-recognize-nameless-type-decls): New c-lang-const/var. * lisp/progmodes/cc-mode.el (c-leave-cc-mode-mode): Also clear c-digit-separator properties.
Diffstat (limited to 'src/coding.c')
0 files changed, 0 insertions, 0 deletions