1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

C++ Mode: Correctly handle <:, <::, <::>, etc, according to the C++ standard

* lisp/progmodes/cc-engine.el (c-before-change-check-<>-operators): Perform
checking now on an insertion, should point be inside a critical token.
(c-forward-<>-arglist-recur, c-guess-continued-construct): Check for <::, etc.

* lisp/progmodes/cc-langs.el (c-<-pseudo-digraph-cont-regexp)
(c-<-pseudo-digraph-cont-len): New lang variables/constants.
This commit is contained in:
Alan Mackenzie 2019-10-11 19:10:11 +00:00
parent a93dceda3f
commit 255c892b48
2 changed files with 32 additions and 4 deletions

View file

@ -1406,6 +1406,23 @@ operators."
(lambda (op) (substring op 1)))))
(c-lang-defvar c-<-op-cont-regexp (c-lang-const c-<-op-cont-regexp))
(c-lang-defconst c-<-pseudo-digraph-cont-regexp
"Regexp matching the continuation of a pseudo digraph starting \"<\".
This is used only in C++ Mode, where \"<::\" is handled as a
template opener followed by the \"::\" operator - usually."
t regexp-unmatchable
c++ "::\\([^:>]\\|$\\)")
(c-lang-defvar c-<-pseudo-digraph-cont-regexp
(c-lang-const c-<-pseudo-digraph-cont-regexp))
(c-lang-defconst c-<-pseudo-digraph-cont-len
"The maximum length of the main bit of a `c-<pseudp-digraph-cont-regexp' match.
This doesn't count the merely contextual bits of the regexp match."
t 0
c++ 2)
(c-lang-defvar c-<-pseudo-digraph-cont-len
(c-lang-const c-<-pseudo-digraph-cont-len))
(c-lang-defconst c->-op-cont-tokens
;; A list of second and subsequent characters of all multicharacter tokens
;; that begin with ">".