-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathron.tmGrammar.json
146 lines (146 loc) · 3.97 KB
/
ron.tmGrammar.json
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
{
"scopeName": "source.ron",
"patterns": [
{ "include": "#expression" }
],
"repository": {
"expression": {
"patterns": [
{ "include": "#array" },
{ "include": "#block_comment" },
{ "include": "#constant" },
{ "include": "#dictionary" },
{ "include": "#line_comment" },
{ "include": "#number" },
{ "include": "#object-name" },
{ "include": "#object" },
{ "include": "#string" },
{ "include": "#character" },
{ "include": "#tag-name" }
]
},
"array": {
"begin": "\\[",
"end": "\\]",
"beginCaptures": {
"0": { "name": "punctuation.section.array.begin.ron" }
},
"endCaptures": {
"0": { "name": "punctuation.section.array.end.ron" }
},
"patterns": [
{ "include": "#value" },
{ "include": "#object-name" },
{ "meta_scope": "meta.structure.array.ron" }
]
},
"block_comment": {
"name": "comment.block.ron",
"begin": "/\\*",
"end": "\\*/"
},
"constant": {
"match": "\\b(true|false)\\b",
"name": "constant.language.ron"
},
"dictionary": {
"begin": "\\{",
"end": "\\}",
"beginCaptures": {
"0": { "name": "punctuation.section.dictionary.begin.ron" }
},
"endCaptures": {
"0": { "name": "punctuation.section.dictionary.end.ron" }
},
"patterns": [
{ "include": "#value" },
{ "include": "#object-name" },
{ "include": "#object" },
{ "include": "#tag-name" },
{ "match": ",", "name": "punctuation.separator.dictionary.ron" },
{ "match": ":", "name": "punctuation.separator.dictionary.key-value.ron" }
]
},
"line_comment": {
"name": "comment.line.double-slash.ron",
"begin": "//",
"end": "$"
},
"tag-name": {
"match": "[a-z_][A-Za-z_0-9]*",
"name": "entity.name.tag.ron"
},
"object-name": {
"match": "[A-Za-z_][A-Za-z_0-9]*",
"name": "entity.name.class.ron"
},
"object": {
"begin": "\\(",
"end": "\\)",
"beginCaptures": {
"0": { "name": "punctuation.section.dictionary.begin.ron" }
},
"endCaptures": {
"0": { "name": "punctuation.section.dictionary.end.ron" }
},
"patterns": [
{ "include": "#value" },
{ "include": "#dictionary" },
{ "include": "#tag-name" },
{ "include": "#object-name" },
{ "include": "#object" }
]
},
"number": {
"match": "(?x:-?(?:0|[1-9]\\d*)(?:(?:\\.\\d+)?(?:[eE][+-]?\\d+)?)?)",
"name": "constant.numeric.ron"
},
"string": {
"begin": "(b?)(\")",
"end": "\"",
"name": "string.quoted.double",
"patterns": [{ "include": "#escapes" }]
},
"character": {
"begin": "'",
"end": "'",
"contentName": "constant.character.ron",
"name": "string.quoted.single"
},
"value": {
"patterns": [
{ "include": "#array" },
{ "include": "#block_comment" },
{ "include": "#constant" },
{ "include": "#dictionary" },
{ "include": "#line_comment" },
{ "include": "#number" },
{ "include": "#object" },
{ "include": "#string" },
{ "include": "#character" }
]
},
"escapes": {
"comment": "escapes: ASCII, byte, Unicode, quote, regex",
"name": "constant.character.escape.ron",
"match": "(\\\\)(?:(?:(x[0-7][0-7a-fA-F])|(u(\\{)[\\da-fA-F]{4,6}(\\}))|.))",
"captures": {
"1": {
"name": "constant.character.escape.backslash.ron"
},
"2": {
"name": "constant.character.escape.bit.ron"
},
"3": {
"name": "constant.character.escape.unicode.ron"
},
"4": {
"name": "constant.character.escape.unicode.punctuation.ron"
},
"5": {
"name": "constant.character.escape.unicode.punctuation.ron"
}
}
}
}
}