;;
;; FIXME!!! This routine ignores the possibility of macros entirely.
;; 2010-01-29.
- (when (and (> end beg)
+ (when (and (or (> end beg)
+ (and (> c-<-pseudo-digraph-cont-len 0)
+ (goto-char beg)
+ (progn
+ (skip-chars-backward
+ "^<" (max (- (point) c-<-pseudo-digraph-cont-len)
+ (point-min)))
+ (eq (char-before) ?<))
+ (looking-at c-<-pseudo-digraph-cont-regexp)))
(or
(progn
(goto-char beg)
(forward-char) ; Forward over the opening '<'.
- (unless (looking-at c-<-op-cont-regexp)
+ (unless (and (looking-at c-<-op-cont-regexp)
+ (not (looking-at c-<-pseudo-digraph-cont-regexp)))
;; go forward one non-alphanumeric character (group) per iteration of
;; this loop.
(while (and
(let (id-start id-end subres keyword-match)
(cond
;; The '<' begins a multi-char operator.
- ((looking-at c-<-op-cont-regexp)
+ ((and (looking-at c-<-op-cont-regexp)
+ (not (looking-at c-<-pseudo-digraph-cont-regexp)))
(goto-char (match-end 0)))
;; We're at a nested <.....>
((progn
(/= (char-before placeholder) ?<)
(progn
(goto-char (1+ placeholder))
- (not (looking-at c-<-op-cont-regexp))))))
+ (or (not (looking-at c-<-op-cont-regexp))
+ (looking-at c-<-pseudo-digraph-cont-regexp))))))
(goto-char placeholder)
(c-beginning-of-statement-1 containing-sexp t)
(if (save-excursion
(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 ">".