]> git.eshelyaron.com Git - emacs.git/commit
Improve C++ concept indentation.
authorAlan Mackenzie <acm@muc.de>
Fri, 14 Apr 2023 16:37:33 +0000 (16:37 +0000)
committerAlan Mackenzie <acm@muc.de>
Fri, 14 Apr 2023 16:37:33 +0000 (16:37 +0000)
commitdc842a71ed035dab1115f2e67d35dd07410e18be
tree61d9c45eaa61e6e6efd10bf4fd7520aacf397c1d
parent7974a9349fc59a79b420f54cda9878792e69a239
Improve C++ concept indentation.

This fixes bug #62386.

* lisp/progmodes/cc-engine.el (c-forward-over-compound-identifier): Don't
move forward over whitespace following the identifier.
(c-forward-primary-expression): Add parameter stop-at-end meaning don't move
forward over whitespace after the construct when non-nil.  Don't recognise a
primary expression when an open brace follows a parenthesized expression.
(c-forward-constraint-clause): Extracted from c-forward-c++-requires-clause.
Add parameter stop-at-end as above.
(c-forward-c++-requires-clause): New stop-at-end parameter as above.  Call the
new function c-forward-constraint-clause.
(c-forward-concept-fragment, c-looking-at-concept)
(c-in-requires-or-at-end-of-clause, c-c++-vsemi-p): New functions.
(c-guess-basic-syntax): New CASE 5A.7: "defun" open in a requires expression.
CASE 5F: Close of a non-class declaration level block: Move to earlier in the
function.
CASE 5D: Also check for being in or at end of a constraint.
New CASE 20: A C++ requires sub-clause.
New CASE 16G: The closing brace of a requires clause.
New CASE 17J: First "statement" inside a requires "function".
(c-forward-primary-expression, c-forward-declarator, c-forward-decl-or-cast-1)
(c-looking-at-or-maybe-in-bracelist): Amend the method of detecting end of
symbol "requires" (aka c-fun-name-substitute-key).

* lisp/progmodes/cc-fonts.el (c-get-fontification-context): Amend the method
of detecting end of symbol "requires".

* lisp/progmodes/cc-langs.el (c-at-vsemi-p-fn): Change the C++ entry to
c-c++-vsemi-p.
(c-fun-name-substitute-key): Change to an unadorned regexp.

* lisp/progmodes/cc-vars.el (c-offsets-alist): Add new syntactic symbol
constraint-cont.

* doc/misc/cc-mode.texi (Syntactic Symbols): Add an entry for contraint-cont.
(Constraint Symbols): New node under Syntactic Symbols.
doc/misc/cc-mode.texi
lisp/progmodes/cc-engine.el
lisp/progmodes/cc-fonts.el
lisp/progmodes/cc-langs.el
lisp/progmodes/cc-vars.el