aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/desktop-utils/lumina-textedit/syntax_rules/cpp.syntax
blob: c09fbec26b218af62de4e24329520767b258e8c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Syntax support file for the Lumina Text Editor
# ===================================
#  C++ language support rules
#  Written by Ken Moore <ken@ixsystems.com>
#  Released under the 2-clause BSD license
# ===================================

{
  "meta" : {
    "name" : "C++",
    "file_suffix" : ["cpp","hpp","c", "h" ]
  },
  "format" : {
    "font_type" : "monospace",
    "line_wrap" : false
  },
  "rules" : [
    {
      "name" : "multi-line comment",
      "regex_start" : "/\\*",
      "regex_end" : "\\*/",
      "foreground" : "colors/comment"
    },
    {
      "name" : "single-line comment",
      "regex" : "//[^\n]*",
      "foreground" : "colors/comment",
    },
    {
      "name" : "keywords",
      "words" : ["char", "class", "const", "double", "enum", "explicit", "extern", "float", "friend", "inline", "int", "long", "namespace", "operator", "private", "protected", "public" , "short", "signals", "signed", "slots", "static", "struct", "template", "typedef", "typename", "union", "unsigned", "virtual", "void", "volatile", "true", "false", "bool"],
      "foreground" : "colors/keyword",
      "background" : "none",
      "font_weight" : "bold"
    },
    {
      "name" : "alternate keywords",
      "words" : ["for", "while", "switch", "case", "continue", "break", "if", "else", "return", "exit"],
      "foreground" : "colors/altkeyword",
      "background" : "none",
      "font_weight" : "bold"
    },
    {
      "name" : "class names",
      "regex" : "\\b[A-Za-z0-9_-\\.]+(?=::)\\b",
      "foreground" : "colors/class",
      "font_weight" : "bold"
    },
    {
      "name" : "function names",
      "regex" : "\\b[A-Za-z0-9_]+(?=\\()",
      "foreground" : "colors/function"
    },
    {
      "name" : "text",
      "regex" : "\"[^\"\\\\]*(\\\\(.|\\n)[^\"\\\\]*)*\"|'[^'\\\\]*(\\\\(.|\\n)[^'\\\\]*)*'",
      "foreground" : "colors/text"
    },
    {
      "name" : "preprocessor",
      "regex" : "^[\\s]*#[^\n]*",
      "foreground" : "colors/preprocessor"
    }
  ]
}
bgstack15