package tm-grammars

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Source file tm_grammar_vala.ml

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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
let lang_id = "vala"
let json = {json|{
  "displayName": "Vala",
  "fileTypes": [
    "vala",
    "vapi",
    "gs"
  ],
  "name": "vala",
  "patterns": [
    {
      "include": "#code"
    }
  ],
  "repository": {
    "code": {
      "patterns": [
        {
          "include": "#comments"
        },
        {
          "include": "#constants"
        },
        {
          "include": "#strings"
        },
        {
          "include": "#keywords"
        },
        {
          "include": "#types"
        },
        {
          "include": "#functions"
        },
        {
          "include": "#variables"
        }
      ]
    },
    "comments": {
      "patterns": [
        {
          "captures": {
            "0": {
              "name": "punctuation.definition.comment.vala"
            }
          },
          "match": "/\\*\\*/",
          "name": "comment.block.empty.vala"
        },
        {
          "include": "text.html.javadoc"
        },
        {
          "include": "#comments-inline"
        }
      ]
    },
    "comments-inline": {
      "patterns": [
        {
          "begin": "/\\*",
          "captures": {
            "0": {
              "name": "punctuation.definition.comment.vala"
            }
          },
          "end": "\\*/",
          "name": "comment.block.vala"
        },
        {
          "captures": {
            "1": {
              "name": "comment.line.double-slash.vala"
            },
            "2": {
              "name": "punctuation.definition.comment.vala"
            }
          },
          "match": "\\s*((//).*$\\n?)"
        }
      ]
    },
    "constants": {
      "patterns": [
        {
          "match": "\\b((0([Xx])\\h*)|(([0-9]+\\.?[0-9]*)|(\\.[0-9]+))(([Ee])([-+])?[0-9]+)?)([DFLUdflu]|UL|ul)?\\b",
          "name": "constant.numeric.vala"
        },
        {
          "match": "\\b([A-Z][0-9A-Z_]+)\\b",
          "name": "variable.other.constant.vala"
        }
      ]
    },
    "functions": {
      "patterns": [
        {
          "match": "(\\w+)(?=\\s*(<[.\\s\\w]+>\\s*)?\\()",
          "name": "entity.name.function.vala"
        }
      ]
    },
    "keywords": {
      "patterns": [
        {
          "match": "(?<=^|[^.@\\w])(as|do|if|in|is|not|or|and|for|get|new|out|ref|set|try|var|base|case|else|enum|lock|null|this|true|void|weak|async|break|catch|class|const|false|owned|throw|using|while|with|yield|delete|extern|inline|params|public|return|sealed|signal|sizeof|static|struct|switch|throws|typeof|unlock|default|dynamic|ensures|finally|foreach|private|unowned|virtual|abstract|continue|delegate|internal|override|requires|volatile|construct|interface|namespace|protected|errordomain)\\b",
          "name": "keyword.vala"
        },
        {
          "match": "(?<=^|[^.@\\w])(bool|double|float|unichar2??|char|uchar|int|uint|long|ulong|short|ushort|size_t|ssize_t|string|string16|string32|void|signal|int8|int16|int32|int64|uint8|uint16|uint32|uint64|va_list|time_t)\\b",
          "name": "keyword.vala"
        },
        {
          "match": "(#(?:if|elif|else|endif))",
          "name": "keyword.vala"
        }
      ]
    },
    "strings": {
      "patterns": [
        {
          "begin": "\"\"\"",
          "end": "\"\"\"",
          "name": "string.quoted.triple.vala"
        },
        {
          "begin": "@\"",
          "end": "\"",
          "name": "string.quoted.interpolated.vala",
          "patterns": [
            {
              "match": "\\\\.",
              "name": "constant.character.escape.vala"
            },
            {
              "match": "\\$\\w+",
              "name": "constant.character.escape.vala"
            },
            {
              "match": "\\$\\(([^()]|\\(([^()]|\\([^)]*\\))*\\))*\\)",
              "name": "constant.character.escape.vala"
            }
          ]
        },
        {
          "begin": "\"",
          "end": "\"",
          "name": "string.quoted.double.vala",
          "patterns": [
            {
              "match": "\\\\.",
              "name": "constant.character.escape.vala"
            }
          ]
        },
        {
          "begin": "'",
          "end": "'",
          "name": "string.quoted.single.vala",
          "patterns": [
            {
              "match": "\\\\.",
              "name": "constant.character.escape.vala"
            }
          ]
        },
        {
          "match": "/((\\\\/)|([^/]))*/(?=\\s*[\\n),.;])",
          "name": "string.regexp.vala"
        }
      ]
    },
    "types": {
      "patterns": [
        {
          "match": "(?<=^|[^.@\\w])(bool|double|float|unichar2??|char|uchar|int|uint|long|ulong|short|ushort|size_t|ssize_t|string|string16|string32|void|signal|int8|int16|int32|int64|uint8|uint16|uint32|uint64|va_list|time_t)\\b",
          "name": "storage.type.primitive.vala"
        },
        {
          "match": "\\b([A-Z]+\\w*)\\b",
          "name": "entity.name.type.vala"
        }
      ]
    },
    "variables": {
      "patterns": [
        {
          "match": "\\b([_a-z]+\\w*)\\b",
          "name": "variable.other.vala"
        }
      ]
    }
  },
  "scopeName": "source.vala"
}|json}