Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/extensions/latex/syntaxes/Bibtex.tmLanguage.json
3292 views
1
{
2
"information_for_contributors": [
3
"This file has been converted from https://github.com/jlelong/vscode-latex-basics/blob/master/syntaxes/Bibtex.tmLanguage.json",
4
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
5
"Once accepted there, we are happy to receive an update request."
6
],
7
"version": "https://github.com/jlelong/vscode-latex-basics/commit/0fcf9283828cab2aa611072f54feb1e7d501c2b4",
8
"name": "BibTeX",
9
"scopeName": "text.bibtex",
10
"comment": "Grammar based on description from https://github.com/aclements/biblib",
11
"patterns": [
12
{
13
"match": "@(?i:comment)(?=[\\s{(])",
14
"captures": {
15
"0": {
16
"name": "punctuation.definition.comment.bibtex"
17
}
18
},
19
"name": "comment.block.at-sign.bibtex"
20
},
21
{
22
"include": "#preamble"
23
},
24
{
25
"include": "#string"
26
},
27
{
28
"include": "#entry"
29
},
30
{
31
"begin": "[^@\\n]",
32
"end": "(?=@)",
33
"name": "comment.block.bibtex"
34
}
35
],
36
"repository": {
37
"preamble": {
38
"patterns": [
39
{
40
"begin": "((@)(?i:preamble))\\s*(\\{)\\s*",
41
"beginCaptures": {
42
"1": {
43
"name": "keyword.other.preamble.bibtex"
44
},
45
"2": {
46
"name": "punctuation.definition.keyword.bibtex"
47
},
48
"3": {
49
"name": "punctuation.section.preamble.begin.bibtex"
50
}
51
},
52
"end": "\\}",
53
"endCaptures": {
54
"0": {
55
"name": "punctuation.section.preamble.end.bibtex"
56
}
57
},
58
"name": "meta.preamble.braces.bibtex",
59
"patterns": [
60
{
61
"include": "#field_value"
62
}
63
]
64
},
65
{
66
"begin": "((@)(?i:preamble))\\s*(\\()\\s*",
67
"beginCaptures": {
68
"1": {
69
"name": "keyword.other.preamble.bibtex"
70
},
71
"2": {
72
"name": "punctuation.definition.keyword.bibtex"
73
},
74
"3": {
75
"name": "punctuation.section.preamble.begin.bibtex"
76
}
77
},
78
"end": "\\)",
79
"endCaptures": {
80
"0": {
81
"name": "punctuation.section.preamble.end.bibtex"
82
}
83
},
84
"name": "meta.preamble.parenthesis.bibtex",
85
"patterns": [
86
{
87
"include": "#field_value"
88
}
89
]
90
}
91
]
92
},
93
"string": {
94
"patterns": [
95
{
96
"begin": "((@)(?i:string))\\s*(\\{)\\s*([a-zA-Z!$&*+\\-./:;<>?@\\[\\\\\\]^_`|~][a-zA-Z0-9!$&*+\\-./:;<>?@\\[\\\\\\]^_`|~]*)",
97
"beginCaptures": {
98
"1": {
99
"name": "keyword.other.string-constant.bibtex"
100
},
101
"2": {
102
"name": "punctuation.definition.keyword.bibtex"
103
},
104
"3": {
105
"name": "punctuation.section.string-constant.begin.bibtex"
106
},
107
"4": {
108
"name": "variable.other.bibtex"
109
}
110
},
111
"end": "\\}",
112
"endCaptures": {
113
"0": {
114
"name": "punctuation.section.string-constant.end.bibtex"
115
}
116
},
117
"name": "meta.string-constant.braces.bibtex",
118
"patterns": [
119
{
120
"include": "#field_value"
121
}
122
]
123
},
124
{
125
"begin": "((@)(?i:string))\\s*(\\()\\s*([a-zA-Z!$&*+\\-./:;<>?@\\[\\\\\\]^_`|~][a-zA-Z0-9!$&*+\\-./:;<>?@\\[\\\\\\]^_`|~]*)",
126
"beginCaptures": {
127
"1": {
128
"name": "keyword.other.string-constant.bibtex"
129
},
130
"2": {
131
"name": "punctuation.definition.keyword.bibtex"
132
},
133
"3": {
134
"name": "punctuation.section.string-constant.begin.bibtex"
135
},
136
"4": {
137
"name": "variable.other.bibtex"
138
}
139
},
140
"end": "\\)",
141
"endCaptures": {
142
"0": {
143
"name": "punctuation.section.string-constant.end.bibtex"
144
}
145
},
146
"name": "meta.string-constant.parenthesis.bibtex",
147
"patterns": [
148
{
149
"include": "#field_value"
150
}
151
]
152
}
153
]
154
},
155
"entry": {
156
"patterns": [
157
{
158
"begin": "((@)[a-zA-Z!$&*+\\-./:;<>?@\\[\\\\\\]^_`|~][a-zA-Z0-9!$&*+\\-./:;<>?@\\[\\\\\\]^_`|~]*)\\s*(\\{)\\s*([^\\s,}]*)",
159
"beginCaptures": {
160
"1": {
161
"name": "keyword.other.entry-type.bibtex"
162
},
163
"2": {
164
"name": "punctuation.definition.keyword.bibtex"
165
},
166
"3": {
167
"name": "punctuation.section.entry.begin.bibtex"
168
},
169
"4": {
170
"name": "entity.name.type.entry-key.bibtex"
171
}
172
},
173
"end": "\\}",
174
"endCaptures": {
175
"0": {
176
"name": "punctuation.section.entry.end.bibtex"
177
}
178
},
179
"name": "meta.entry.braces.bibtex",
180
"patterns": [
181
{
182
"begin": "([a-zA-Z!$&*+\\-./:;<>?@\\[\\\\\\]^_`|~][a-zA-Z0-9!$&*+\\-./:;<>?@\\[\\\\\\]^_`|~]*)\\s*(\\=)",
183
"beginCaptures": {
184
"1": {
185
"name": "support.function.key.bibtex"
186
},
187
"2": {
188
"name": "punctuation.separator.key-value.bibtex"
189
}
190
},
191
"end": "(?=[,}])",
192
"name": "meta.key-assignment.bibtex",
193
"patterns": [
194
{
195
"include": "#field_value"
196
}
197
]
198
}
199
]
200
},
201
{
202
"begin": "((@)[a-zA-Z!$&*+\\-./:;<>?@\\[\\\\\\]^_`|~][a-zA-Z0-9!$&*+\\-./:;<>?@\\[\\\\\\]^_`|~]*)\\s*(\\()\\s*([^\\s,]*)",
203
"beginCaptures": {
204
"1": {
205
"name": "keyword.other.entry-type.bibtex"
206
},
207
"2": {
208
"name": "punctuation.definition.keyword.bibtex"
209
},
210
"3": {
211
"name": "punctuation.section.entry.begin.bibtex"
212
},
213
"4": {
214
"name": "entity.name.type.entry-key.bibtex"
215
}
216
},
217
"end": "\\)",
218
"endCaptures": {
219
"0": {
220
"name": "punctuation.section.entry.end.bibtex"
221
}
222
},
223
"name": "meta.entry.parenthesis.bibtex",
224
"patterns": [
225
{
226
"begin": "([a-zA-Z!$&*+\\-./:;<>?@\\[\\\\\\]^_`|~][a-zA-Z0-9!$&*+\\-./:;<>?@\\[\\\\\\]^_`|~]*)\\s*(\\=)",
227
"beginCaptures": {
228
"1": {
229
"name": "support.function.key.bibtex"
230
},
231
"2": {
232
"name": "punctuation.separator.key-value.bibtex"
233
}
234
},
235
"end": "(?=[,)])",
236
"name": "meta.key-assignment.bibtex",
237
"patterns": [
238
{
239
"include": "#field_value"
240
}
241
]
242
}
243
]
244
}
245
]
246
},
247
"field_value": {
248
"patterns": [
249
{
250
"include": "#string_content"
251
},
252
{
253
"include": "#integer"
254
},
255
{
256
"include": "#string_var"
257
},
258
{
259
"match": "#",
260
"name": "keyword.operator.bibtex"
261
}
262
]
263
},
264
"integer": {
265
"captures": {
266
"1": {
267
"name": "constant.numeric.bibtex"
268
}
269
},
270
"match": "\\s*(\\d+)\\s*"
271
},
272
"nested_braces": {
273
"begin": "\\{",
274
"beginCaptures": {
275
"0": {
276
"name": "punctuation.definition.group.begin.bibtex"
277
}
278
},
279
"end": "\\}",
280
"endCaptures": {
281
"0": {
282
"name": "punctuation.definition.group.end.bibtex"
283
}
284
},
285
"patterns": [
286
{
287
"include": "#nested_braces"
288
}
289
]
290
},
291
"string_content": {
292
"patterns": [
293
{
294
"begin": "\\{",
295
"beginCaptures": {
296
"0": {
297
"name": "punctuation.definition.string.begin.bibtex"
298
}
299
},
300
"end": "\\}",
301
"endCaptures": {
302
"0": {
303
"name": "punctuation.definition.string.end.bibtex"
304
}
305
},
306
"patterns": [
307
{
308
"include": "#nested_braces"
309
}
310
]
311
},
312
{
313
"begin": "\"",
314
"beginCaptures": {
315
"0": {
316
"name": "punctuation.definition.string.begin.bibtex"
317
}
318
},
319
"end": "\"",
320
"endCaptures": {
321
"0": {
322
"name": "punctuation.definition.string.end.bibtex"
323
}
324
},
325
"patterns": [
326
{
327
"include": "#nested_braces"
328
}
329
]
330
}
331
]
332
},
333
"string_var": {
334
"captures": {
335
"0": {
336
"name": "support.variable.bibtex"
337
}
338
},
339
"match": "[a-zA-Z!$&*+\\-./:;<>?@\\[\\\\\\]^_`|~][a-zA-Z0-9!$&*+\\-./:;<>?@\\[\\\\\\]^_`|~]*"
340
}
341
}
342
}
343