Variable: c-ts-mode--c-or-c++-regexp

c-ts-mode--c-or-c++-regexp is a variable defined in c-ts-mode.el.gz.

Value

"^[     ]*\\(?:using[   ]+\\(?:namespace[       ]+\\|[a-zA-Z_][a-zA-Z0-9_]*::\\|[a-zA-Z_][a-zA-Z0-9_]*[         ]*=\\)\\|\\(?:inline[   ]+\\)?namespace\\(?:[   ]+\\(?:[a-zA-Z_][a-zA-Z0-9_]*::\\)*[a-zA-Z_][a-zA-Z0-9_]*\\)?[  ]*{\\|class[    ]+[a-zA-Z_][a-zA-Z0-9_]*\\(?:[  ]+final\\)?[    ]*[:{;\n]\\|struct[     ]+[a-zA-Z_][a-zA-Z0-9_]*\\(?:[  ]+final[        ]*[:{\n]\\|[    ]*:\\)\\|template[      ]*<.*?>\\|#include[       ]*<\\(?:iostream\\|map\\|s\\(?:et\\|tring\\(?:_view\\)?\\)\\|tuple\\|unordered_\\(?:map\\|set\\)\\|vector\\)>\\)"

Documentation

A regexp applied to C header files to check if they are really C++.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/c-ts-mode.el.gz
;; We could alternatively use parsers, but if this works well, I don't
;; see the need to change.  This is copied verbatim from cc-guess.el.
(defconst c-ts-mode--c-or-c++-regexp
  (eval-when-compile
    (let ((id "[a-zA-Z_][a-zA-Z0-9_]*") (ws "[ \t]+") (ws-maybe "[ \t]*")
          (headers '("string" "string_view" "iostream" "map" "unordered_map"
                     "set" "unordered_set" "vector" "tuple")))
      (concat "^" ws-maybe "\\(?:"
              "using"     ws "\\(?:namespace" ws
              "\\|" id "::"
              "\\|" id ws-maybe "=\\)"
              "\\|" "\\(?:inline" ws "\\)?namespace"
              "\\(?:" ws "\\(?:" id "::\\)*" id "\\)?" ws-maybe "{"
              "\\|" "class"     ws id
              "\\(?:" ws "final" "\\)?" ws-maybe "[:{;\n]"
              "\\|" "struct"     ws id "\\(?:" ws "final" ws-maybe "[:{\n]"
              "\\|" ws-maybe ":\\)"
              "\\|" "template"  ws-maybe "<.*?>"
              "\\|" "#include"  ws-maybe "<" (regexp-opt headers) ">"
              "\\)")))
  "A regexp applied to C header files to check if they are really C++.")