Source file tm_grammar_json.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
198
199
200
201
202
203
204
205
206
207
let lang_id = "json"
let json = {json|{
  "displayName": "JSON",
  "name": "json",
  "patterns": [
    {
      "include": "#value"
    }
  ],
  "repository": {
    "array": {
      "begin": "\\[",
      "beginCaptures": {
        "0": {
          "name": "punctuation.definition.array.begin.json"
        }
      },
      "end": "]",
      "endCaptures": {
        "0": {
          "name": "punctuation.definition.array.end.json"
        }
      },
      "name": "meta.structure.array.json",
      "patterns": [
        {
          "include": "#value"
        },
        {
          "match": ",",
          "name": "punctuation.separator.array.json"
        },
        {
          "match": "[^]\\s]",
          "name": "invalid.illegal.expected-array-separator.json"
        }
      ]
    },
    "comments": {
      "patterns": [
        {
          "begin": "/\\*\\*(?!/)",
          "captures": {
            "0": {
              "name": "punctuation.definition.comment.json"
            }
          },
          "end": "\\*/",
          "name": "comment.block.documentation.json"
        },
        {
          "begin": "/\\*",
          "captures": {
            "0": {
              "name": "punctuation.definition.comment.json"
            }
          },
          "end": "\\*/",
          "name": "comment.block.json"
        },
        {
          "captures": {
            "1": {
              "name": "punctuation.definition.comment.json"
            }
          },
          "match": "(//).*$\\n?",
          "name": "comment.line.double-slash.js"
        }
      ]
    },
    "constant": {
      "match": "\\b(?:true|false|null)\\b",
      "name": "constant.language.json"
    },
    "number": {
      "match": "-?(?:0|[1-9]\\d*)(?:(?:\\.\\d+)?(?:[Ee][-+]?\\d+)?)?",
      "name": "constant.numeric.json"
    },
    "object": {
      "begin": "\\{",
      "beginCaptures": {
        "0": {
          "name": "punctuation.definition.dictionary.begin.json"
        }
      },
      "end": "}",
      "endCaptures": {
        "0": {
          "name": "punctuation.definition.dictionary.end.json"
        }
      },
      "name": "meta.structure.dictionary.json",
      "patterns": [
        {
          "include": "#objectkey"
        },
        {
          "include": "#comments"
        },
        {
          "begin": ":",
          "beginCaptures": {
            "0": {
              "name": "punctuation.separator.dictionary.key-value.json"
            }
          },
          "end": "(,)|(?=})",
          "endCaptures": {
            "1": {
              "name": "punctuation.separator.dictionary.pair.json"
            }
          },
          "name": "meta.structure.dictionary.value.json",
          "patterns": [
            {
              "include": "#value"
            },
            {
              "match": "[^,\\s]",
              "name": "invalid.illegal.expected-dictionary-separator.json"
            }
          ]
        },
        {
          "match": "[^}\\s]",
          "name": "invalid.illegal.expected-dictionary-separator.json"
        }
      ]
    },
    "objectkey": {
      "begin": "\"",
      "beginCaptures": {
        "0": {
          "name": "punctuation.support.type.property-name.begin.json"
        }
      },
      "end": "\"",
      "endCaptures": {
        "0": {
          "name": "punctuation.support.type.property-name.end.json"
        }
      },
      "name": "string.json support.type.property-name.json",
      "patterns": [
        {
          "include": "#stringcontent"
        }
      ]
    },
    "string": {
      "begin": "\"",
      "beginCaptures": {
        "0": {
          "name": "punctuation.definition.string.begin.json"
        }
      },
      "end": "\"",
      "endCaptures": {
        "0": {
          "name": "punctuation.definition.string.end.json"
        }
      },
      "name": "string.quoted.double.json",
      "patterns": [
        {
          "include": "#stringcontent"
        }
      ]
    },
    "stringcontent": {
      "patterns": [
        {
          "match": "\\\\(?:[\"/\\\\bfnrt]|u\\h{4})",
          "name": "constant.character.escape.json"
        },
        {
          "match": "\\\\.",
          "name": "invalid.illegal.unrecognized-string-escape.json"
        }
      ]
    },
    "value": {
      "patterns": [
        {
          "include": "#constant"
        },
        {
          "include": "#number"
        },
        {
          "include": "#string"
        },
        {
          "include": "#array"
        },
        {
          "include": "#object"
        },
        {
          "include": "#comments"
        }
      ]
    }
  },
  "scopeName": "source.json"
}|json}