tm-grammars 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (181) hide show
  1. package/LICENSE +22 -0
  2. package/NOTICE +6565 -0
  3. package/README.md +211 -0
  4. package/grammars/abap.json +380 -0
  5. package/grammars/actionscript-3.json +951 -0
  6. package/grammars/ada.json +3874 -0
  7. package/grammars/apache.json +562 -0
  8. package/grammars/apex.json +3203 -0
  9. package/grammars/apl.json +1479 -0
  10. package/grammars/applescript.json +1406 -0
  11. package/grammars/ara.json +428 -0
  12. package/grammars/asm.json +1741 -0
  13. package/grammars/astro.json +776 -0
  14. package/grammars/awk.json +388 -0
  15. package/grammars/ballerina.json +3768 -0
  16. package/grammars/bat.json +783 -0
  17. package/grammars/beancount.json +831 -0
  18. package/grammars/berry.json +172 -0
  19. package/grammars/bibtex.json +315 -0
  20. package/grammars/bicep.json +239 -0
  21. package/grammars/blade.json +3870 -0
  22. package/grammars/c.json +3552 -0
  23. package/grammars/cadence.json +738 -0
  24. package/grammars/clarity.json +877 -0
  25. package/grammars/clojure.json +426 -0
  26. package/grammars/cmake.json +143 -0
  27. package/grammars/cobol.json +1124 -0
  28. package/grammars/codeql.json +1540 -0
  29. package/grammars/coffee.json +1311 -0
  30. package/grammars/cpp-macro.json +9498 -0
  31. package/grammars/cpp.json +16635 -0
  32. package/grammars/crystal.json +1866 -0
  33. package/grammars/csharp.json +5722 -0
  34. package/grammars/css.json +1860 -0
  35. package/grammars/csv.json +46 -0
  36. package/grammars/cue.json +1128 -0
  37. package/grammars/cypher.json +353 -0
  38. package/grammars/d.json +3185 -0
  39. package/grammars/dart.json +522 -0
  40. package/grammars/dax.json +185 -0
  41. package/grammars/diff.json +155 -0
  42. package/grammars/docker.json +97 -0
  43. package/grammars/dream-maker.json +640 -0
  44. package/grammars/elixir.json +1014 -0
  45. package/grammars/elm.json +751 -0
  46. package/grammars/erb.json +156 -0
  47. package/grammars/erlang.json +1757 -0
  48. package/grammars/fish.json +189 -0
  49. package/grammars/fsharp.json +1831 -0
  50. package/grammars/gdresource.json +290 -0
  51. package/grammars/gdscript.json +969 -0
  52. package/grammars/gdshader.json +405 -0
  53. package/grammars/gherkin.json +133 -0
  54. package/grammars/git-commit.json +85 -0
  55. package/grammars/git-rebase.json +56 -0
  56. package/grammars/glimmer-js.json +98 -0
  57. package/grammars/glimmer-ts.json +98 -0
  58. package/grammars/glsl.json +57 -0
  59. package/grammars/gnuplot.json +892 -0
  60. package/grammars/go.json +1012 -0
  61. package/grammars/graphql.json +1295 -0
  62. package/grammars/groovy.json +1378 -0
  63. package/grammars/hack.json +2650 -0
  64. package/grammars/haml.json +598 -0
  65. package/grammars/handlebars.json +848 -0
  66. package/grammars/haskell.json +2431 -0
  67. package/grammars/hcl.json +787 -0
  68. package/grammars/hjson.json +821 -0
  69. package/grammars/hlsl.json +212 -0
  70. package/grammars/html.json +93 -0
  71. package/grammars/imba.json +2696 -0
  72. package/grammars/ini.json +108 -0
  73. package/grammars/java.json +1885 -0
  74. package/grammars/javascript.json +5984 -0
  75. package/grammars/jinja-html.json +16 -0
  76. package/grammars/jinja.json +345 -0
  77. package/grammars/jison.json +715 -0
  78. package/grammars/jsdoc.json +21 -0
  79. package/grammars/json.json +208 -0
  80. package/grammars/json5.json +244 -0
  81. package/grammars/jsonc.json +208 -0
  82. package/grammars/jsonl.json +208 -0
  83. package/grammars/jsonnet.json +211 -0
  84. package/grammars/jssm.json +159 -0
  85. package/grammars/jsx.json +5984 -0
  86. package/grammars/julia.json +1061 -0
  87. package/grammars/kotlin.json +580 -0
  88. package/grammars/kusto.json +687 -0
  89. package/grammars/latex.json +2395 -0
  90. package/grammars/less.json +5012 -0
  91. package/grammars/liquid.json +990 -0
  92. package/grammars/lisp.json +121 -0
  93. package/grammars/logo.json +55 -0
  94. package/grammars/lua.json +956 -0
  95. package/grammars/make.json +629 -0
  96. package/grammars/markdown.json +3066 -0
  97. package/grammars/marko.json +1344 -0
  98. package/grammars/matlab.json +1131 -0
  99. package/grammars/mdc.json +571 -0
  100. package/grammars/mdx.json +5629 -0
  101. package/grammars/mermaid.json +1382 -0
  102. package/grammars/mojo.json +4153 -0
  103. package/grammars/narrat.json +227 -0
  104. package/grammars/nextflow.json +298 -0
  105. package/grammars/nginx.json +2121 -0
  106. package/grammars/nim.json +1522 -0
  107. package/grammars/nix.json +1200 -0
  108. package/grammars/nushell.json +1047 -0
  109. package/grammars/objective-c.json +3750 -0
  110. package/grammars/objective-cpp.json +7242 -0
  111. package/grammars/ocaml.json +2967 -0
  112. package/grammars/pascal.json +154 -0
  113. package/grammars/perl.json +2971 -0
  114. package/grammars/php.json +4024 -0
  115. package/grammars/plsql.json +241 -0
  116. package/grammars/postcss.json +377 -0
  117. package/grammars/powerquery.json +349 -0
  118. package/grammars/powershell.json +1024 -0
  119. package/grammars/prisma.json +443 -0
  120. package/grammars/prolog.json +298 -0
  121. package/grammars/proto.json +507 -0
  122. package/grammars/pug.json +1033 -0
  123. package/grammars/puppet.json +777 -0
  124. package/grammars/purescript.json +871 -0
  125. package/grammars/python.json +4208 -0
  126. package/grammars/r.json +637 -0
  127. package/grammars/raku.json +310 -0
  128. package/grammars/razor.json +1813 -0
  129. package/grammars/reg.json +136 -0
  130. package/grammars/rel.json +200 -0
  131. package/grammars/riscv.json +298 -0
  132. package/grammars/rst.json +734 -0
  133. package/grammars/ruby.json +2769 -0
  134. package/grammars/rust.json +1171 -0
  135. package/grammars/sas.json +302 -0
  136. package/grammars/sass.json +618 -0
  137. package/grammars/scala.json +1313 -0
  138. package/grammars/scheme.json +384 -0
  139. package/grammars/scss.json +1874 -0
  140. package/grammars/shaderlab.json +199 -0
  141. package/grammars/shellscript.json +2025 -0
  142. package/grammars/shellsession.json +33 -0
  143. package/grammars/smalltalk.json +235 -0
  144. package/grammars/solidity.json +1210 -0
  145. package/grammars/sparql.json +45 -0
  146. package/grammars/splunk.json +91 -0
  147. package/grammars/sql.json +631 -0
  148. package/grammars/ssh-config.json +88 -0
  149. package/grammars/stata.json +3050 -0
  150. package/grammars/stylus.json +1208 -0
  151. package/grammars/svelte.json +1171 -0
  152. package/grammars/swift.json +4203 -0
  153. package/grammars/system-verilog.json +1063 -0
  154. package/grammars/tasl.json +292 -0
  155. package/grammars/tcl.json +291 -0
  156. package/grammars/tex.json +281 -0
  157. package/grammars/toml.json +431 -0
  158. package/grammars/tsx.json +5984 -0
  159. package/grammars/turtle.json +261 -0
  160. package/grammars/twig.json +1394 -0
  161. package/grammars/typescript.json +5735 -0
  162. package/grammars/v.json +1001 -0
  163. package/grammars/vb.json +232 -0
  164. package/grammars/verilog.json +305 -0
  165. package/grammars/vhdl.json +1484 -0
  166. package/grammars/viml.json +445 -0
  167. package/grammars/vue-html.json +559 -0
  168. package/grammars/vue.json +1237 -0
  169. package/grammars/vyper.json +5415 -0
  170. package/grammars/wasm.json +831 -0
  171. package/grammars/wenyan.json +129 -0
  172. package/grammars/wgsl.json +391 -0
  173. package/grammars/wolfram.json +2370 -0
  174. package/grammars/xml.json +382 -0
  175. package/grammars/xsl.json +89 -0
  176. package/grammars/yaml.json +616 -0
  177. package/grammars/zenscript.json +257 -0
  178. package/grammars/zig.json +312 -0
  179. package/index.d.ts +18 -0
  180. package/index.js +2165 -0
  181. package/package.json +46 -0
@@ -0,0 +1,831 @@
1
+ {
2
+ "displayName": "Beancount",
3
+ "fileTypes": [
4
+ "beancount"
5
+ ],
6
+ "name": "beancount",
7
+ "patterns": [
8
+ {
9
+ "comment": "Comments",
10
+ "match": ";.*",
11
+ "name": "comment.line.beancount"
12
+ },
13
+ {
14
+ "begin": "^\\s*(poptag|pushtag)\\s+(#)([A-Za-z0-9\\-_/.]+)",
15
+ "beginCaptures": {
16
+ "1": {
17
+ "name": "support.function.beancount"
18
+ },
19
+ "2": {
20
+ "name": "keyword.operator.tag.beancount"
21
+ },
22
+ "3": {
23
+ "name": "entity.name.tag.beancount"
24
+ }
25
+ },
26
+ "comment": "Tag directive",
27
+ "end": "(?=(^\\s*$|^\\S))",
28
+ "name": "meta.directive.tag.beancount",
29
+ "patterns": [
30
+ {
31
+ "include": "#comments"
32
+ },
33
+ {
34
+ "include": "#illegal"
35
+ }
36
+ ]
37
+ },
38
+ {
39
+ "begin": "^\\s*(include)\\s+(\\\".*\\\")",
40
+ "beginCaptures": {
41
+ "1": {
42
+ "name": "support.function.beancount"
43
+ },
44
+ "2": {
45
+ "name": "string.quoted.double.beancount"
46
+ }
47
+ },
48
+ "comment": "Include directive",
49
+ "end": "(?=(^\\s*$|^\\S))",
50
+ "name": "meta.directive.include.beancount",
51
+ "patterns": [
52
+ {
53
+ "include": "#comments"
54
+ },
55
+ {
56
+ "include": "#illegal"
57
+ }
58
+ ]
59
+ },
60
+ {
61
+ "begin": "^\\s*(option)\\s+(\\\".*\\\")\\s+(\\\".*\\\")",
62
+ "beginCaptures": {
63
+ "1": {
64
+ "name": "support.function.beancount"
65
+ },
66
+ "2": {
67
+ "name": "support.variable.beancount"
68
+ },
69
+ "3": {
70
+ "name": "string.quoted.double.beancount"
71
+ }
72
+ },
73
+ "comment": "Option directive",
74
+ "end": "(?=(^\\s*$|^\\S))",
75
+ "name": "meta.directive.option.beancount",
76
+ "patterns": [
77
+ {
78
+ "include": "#comments"
79
+ },
80
+ {
81
+ "include": "#illegal"
82
+ }
83
+ ]
84
+ },
85
+ {
86
+ "begin": "^\\s*(plugin)\\s*(\"(.*?)\")\\s*(\".*?\")?",
87
+ "beginCaptures": {
88
+ "1": {
89
+ "name": "support.function.beancount"
90
+ },
91
+ "2": {
92
+ "name": "string.quoted.double.beancount"
93
+ },
94
+ "3": {
95
+ "name": "entity.name.function.beancount"
96
+ },
97
+ "4": {
98
+ "name": "string.quoted.double.beancount"
99
+ }
100
+ },
101
+ "comment": "Plugin directive",
102
+ "end": "(?=(^\\s*$|^\\S))",
103
+ "name": "keyword.operator.directive.beancount",
104
+ "patterns": [
105
+ {
106
+ "include": "#comments"
107
+ },
108
+ {
109
+ "include": "#illegal"
110
+ }
111
+ ]
112
+ },
113
+ {
114
+ "begin": "([0-9]{4})([\\-|/])([0-9]{2})([\\-|/])([0-9]{2})\\s+(open|close|pad)\\b",
115
+ "beginCaptures": {
116
+ "1": {
117
+ "name": "constant.numeric.date.year.beancount"
118
+ },
119
+ "2": {
120
+ "name": "punctuation.separator.beancount"
121
+ },
122
+ "3": {
123
+ "name": "constant.numeric.date.month.beancount"
124
+ },
125
+ "4": {
126
+ "name": "punctuation.separator.beancount"
127
+ },
128
+ "5": {
129
+ "name": "constant.numeric.date.day.beancount"
130
+ },
131
+ "6": {
132
+ "name": "support.function.beancount"
133
+ }
134
+ },
135
+ "comment": "Open/Close/Pad directive",
136
+ "end": "(?=(^\\s*$|^\\S))",
137
+ "name": "meta.directive.dated.beancount",
138
+ "patterns": [
139
+ {
140
+ "include": "#comments"
141
+ },
142
+ {
143
+ "include": "#meta"
144
+ },
145
+ {
146
+ "include": "#account"
147
+ },
148
+ {
149
+ "include": "#commodity"
150
+ },
151
+ {
152
+ "match": "\\,",
153
+ "name": "punctuation.separator.beancount"
154
+ },
155
+ {
156
+ "include": "#illegal"
157
+ }
158
+ ]
159
+ },
160
+ {
161
+ "begin": "([0-9]{4})([\\-|/])([0-9]{2})([\\-|/])([0-9]{2})\\s+(custom)\\b",
162
+ "beginCaptures": {
163
+ "1": {
164
+ "name": "constant.numeric.date.year.beancount"
165
+ },
166
+ "2": {
167
+ "name": "punctuation.separator.beancount"
168
+ },
169
+ "3": {
170
+ "name": "constant.numeric.date.month.beancount"
171
+ },
172
+ "4": {
173
+ "name": "punctuation.separator.beancount"
174
+ },
175
+ "5": {
176
+ "name": "constant.numeric.date.day.beancount"
177
+ },
178
+ "6": {
179
+ "name": "support.function.beancount"
180
+ }
181
+ },
182
+ "comment": "Custom directive",
183
+ "end": "(?=(^\\s*$|^\\S))",
184
+ "name": "meta.directive.dated.beancount",
185
+ "patterns": [
186
+ {
187
+ "include": "#comments"
188
+ },
189
+ {
190
+ "include": "#meta"
191
+ },
192
+ {
193
+ "include": "#string"
194
+ },
195
+ {
196
+ "include": "#bool"
197
+ },
198
+ {
199
+ "include": "#amount"
200
+ },
201
+ {
202
+ "include": "#number"
203
+ },
204
+ {
205
+ "include": "#date"
206
+ },
207
+ {
208
+ "include": "#account"
209
+ },
210
+ {
211
+ "include": "#illegal"
212
+ }
213
+ ]
214
+ },
215
+ {
216
+ "begin": "([0-9]{4})([\\-|/])([0-9]{2})([\\-|/])([0-9]{2})\\s(event)",
217
+ "beginCaptures": {
218
+ "1": {
219
+ "name": "constant.numeric.date.year.beancount"
220
+ },
221
+ "2": {
222
+ "name": "punctuation.separator.beancount"
223
+ },
224
+ "3": {
225
+ "name": "constant.numeric.date.month.beancount"
226
+ },
227
+ "4": {
228
+ "name": "punctuation.separator.beancount"
229
+ },
230
+ "5": {
231
+ "name": "constant.numeric.date.day.beancount"
232
+ },
233
+ "6": {
234
+ "name": "support.function.directive.beancount"
235
+ }
236
+ },
237
+ "comment": "Event directive",
238
+ "end": "(?=(^\\s*$|^\\S))",
239
+ "name": "meta.directive.dated.beancount",
240
+ "patterns": [
241
+ {
242
+ "include": "#comments"
243
+ },
244
+ {
245
+ "include": "#meta"
246
+ },
247
+ {
248
+ "include": "#string"
249
+ },
250
+ {
251
+ "include": "#illegal"
252
+ }
253
+ ]
254
+ },
255
+ {
256
+ "begin": "([0-9]{4})([\\-|/])([0-9]{2})([\\-|/])([0-9]{2})\\s(commodity)",
257
+ "beginCaptures": {
258
+ "1": {
259
+ "name": "constant.numeric.date.year.beancount"
260
+ },
261
+ "2": {
262
+ "name": "punctuation.separator.beancount"
263
+ },
264
+ "3": {
265
+ "name": "constant.numeric.date.month.beancount"
266
+ },
267
+ "4": {
268
+ "name": "punctuation.separator.beancount"
269
+ },
270
+ "5": {
271
+ "name": "constant.numeric.date.day.beancount"
272
+ },
273
+ "6": {
274
+ "name": "support.function.directive.beancount"
275
+ }
276
+ },
277
+ "comment": "Commodity directive",
278
+ "end": "(?=(^\\s*$|^\\S))",
279
+ "name": "meta.directive.dated.beancount",
280
+ "patterns": [
281
+ {
282
+ "include": "#comments"
283
+ },
284
+ {
285
+ "include": "#meta"
286
+ },
287
+ {
288
+ "include": "#commodity"
289
+ },
290
+ {
291
+ "include": "#illegal"
292
+ }
293
+ ]
294
+ },
295
+ {
296
+ "begin": "([0-9]{4})([\\-|/])([0-9]{2})([\\-|/])([0-9]{2})\\s+(note)(?=(.*\\*\\\"\\s))",
297
+ "beginCaptures": {
298
+ "1": {
299
+ "name": "constant.numeric.date.year.beancount"
300
+ },
301
+ "2": {
302
+ "name": "punctuation.separator.beancount"
303
+ },
304
+ "3": {
305
+ "name": "constant.numeric.date.month.beancount"
306
+ },
307
+ "4": {
308
+ "name": "punctuation.separator.beancount"
309
+ },
310
+ "5": {
311
+ "name": "constant.numeric.date.day.beancount"
312
+ },
313
+ "6": {
314
+ "name": "support.function.directive.beancount"
315
+ }
316
+ },
317
+ "comment": "Note as Oneliner Transaction directive",
318
+ "end": "(?=(^\\s*$|^\\S))",
319
+ "name": "meta.directive.notetotext.beancount",
320
+ "patterns": [
321
+ {
322
+ "include": "#meta"
323
+ },
324
+ {
325
+ "include": "#account"
326
+ },
327
+ {
328
+ "match": "(?<=\\s)\\\"",
329
+ "name": "punctuation.separator.beancount"
330
+ },
331
+ {
332
+ "include": "#cost"
333
+ },
334
+ {
335
+ "include": "#amount"
336
+ },
337
+ {
338
+ "begin": "(\\*|\\!)",
339
+ "beginCaptures": {
340
+ "0": {
341
+ "name": "support.function.directive.beancount"
342
+ }
343
+ },
344
+ "end": "(\\*\\\")",
345
+ "endCaptures": {
346
+ "0": {
347
+ "name": "punctuation.separator.beancount"
348
+ }
349
+ },
350
+ "patterns": [
351
+ {
352
+ "match": "\\\\.",
353
+ "name": "constant.character.escape.beancount"
354
+ },
355
+ {
356
+ "include": "#tag"
357
+ },
358
+ {
359
+ "match": "([^\\\"])",
360
+ "name": "string.quoted.double.beancount"
361
+ }
362
+ ]
363
+ },
364
+ {
365
+ "include": "#illegal"
366
+ }
367
+ ]
368
+ },
369
+ {
370
+ "begin": "([0-9]{4})([\\-|/])([0-9]{2})([\\-|/])([0-9]{2})\\s(note|document)",
371
+ "beginCaptures": {
372
+ "1": {
373
+ "name": "constant.numeric.date.year.beancount"
374
+ },
375
+ "2": {
376
+ "name": "punctuation.separator.beancount"
377
+ },
378
+ "3": {
379
+ "name": "constant.numeric.date.month.beancount"
380
+ },
381
+ "4": {
382
+ "name": "punctuation.separator.beancount"
383
+ },
384
+ "5": {
385
+ "name": "constant.numeric.date.day.beancount"
386
+ },
387
+ "6": {
388
+ "name": "support.function.directive.beancount"
389
+ }
390
+ },
391
+ "comment": "Note/Document directive",
392
+ "end": "(?=(^\\s*$|^\\S))",
393
+ "name": "meta.directive.dated.beancount",
394
+ "patterns": [
395
+ {
396
+ "include": "#comments"
397
+ },
398
+ {
399
+ "include": "#meta"
400
+ },
401
+ {
402
+ "include": "#account"
403
+ },
404
+ {
405
+ "include": "#string"
406
+ },
407
+ {
408
+ "include": "#illegal"
409
+ }
410
+ ]
411
+ },
412
+ {
413
+ "begin": "([0-9]{4})([\\-|/])([0-9]{2})([\\-|/])([0-9]{2})\\s(price)",
414
+ "beginCaptures": {
415
+ "1": {
416
+ "name": "constant.numeric.date.year.beancount"
417
+ },
418
+ "2": {
419
+ "name": "punctuation.separator.beancount"
420
+ },
421
+ "3": {
422
+ "name": "constant.numeric.date.month.beancount"
423
+ },
424
+ "4": {
425
+ "name": "punctuation.separator.beancount"
426
+ },
427
+ "5": {
428
+ "name": "constant.numeric.date.day.beancount"
429
+ },
430
+ "6": {
431
+ "name": "support.function.directive.beancount"
432
+ }
433
+ },
434
+ "comment": "Price directives",
435
+ "end": "(?=(^\\s*$|^\\S))",
436
+ "name": "meta.directive.dated.beancount",
437
+ "patterns": [
438
+ {
439
+ "include": "#comments"
440
+ },
441
+ {
442
+ "include": "#meta"
443
+ },
444
+ {
445
+ "include": "#commodity"
446
+ },
447
+ {
448
+ "include": "#amount"
449
+ },
450
+ {
451
+ "include": "#illegal"
452
+ }
453
+ ]
454
+ },
455
+ {
456
+ "begin": "([0-9]{4})([\\-|/])([0-9]{2})([\\-|/])([0-9]{2})\\s(balance)",
457
+ "beginCaptures": {
458
+ "1": {
459
+ "name": "constant.numeric.date.year.beancount"
460
+ },
461
+ "2": {
462
+ "name": "punctuation.separator.beancount"
463
+ },
464
+ "3": {
465
+ "name": "constant.numeric.date.month.beancount"
466
+ },
467
+ "4": {
468
+ "name": "punctuation.separator.beancount"
469
+ },
470
+ "5": {
471
+ "name": "constant.numeric.date.day.beancount"
472
+ },
473
+ "6": {
474
+ "name": "support.function.directive.beancount"
475
+ }
476
+ },
477
+ "comment": "Balance directives",
478
+ "end": "(?=(^\\s*$|^\\S))",
479
+ "name": "meta.directive.dated.beancount",
480
+ "patterns": [
481
+ {
482
+ "include": "#comments"
483
+ },
484
+ {
485
+ "include": "#meta"
486
+ },
487
+ {
488
+ "include": "#account"
489
+ },
490
+ {
491
+ "include": "#amount"
492
+ },
493
+ {
494
+ "include": "#illegal"
495
+ }
496
+ ]
497
+ },
498
+ {
499
+ "begin": "([0-9]{4})([\\-|/])([0-9]{2})([\\-|/])([0-9]{2})\\s*(txn|[*!&#?%PSTCURM])\\s*(\".*?\")?\\s*(\".*?\")?",
500
+ "beginCaptures": {
501
+ "1": {
502
+ "name": "constant.numeric.date.year.beancount"
503
+ },
504
+ "2": {
505
+ "name": "punctuation.separator.beancount"
506
+ },
507
+ "3": {
508
+ "name": "constant.numeric.date.month.beancount"
509
+ },
510
+ "4": {
511
+ "name": "punctuation.separator.beancount"
512
+ },
513
+ "5": {
514
+ "name": "constant.numeric.date.day.beancount"
515
+ },
516
+ "6": {
517
+ "name": "support.function.directive.beancount"
518
+ },
519
+ "7": {
520
+ "name": "string.quoted.tiers.beancount"
521
+ },
522
+ "8": {
523
+ "name": "string.quoted.narration.beancount"
524
+ }
525
+ },
526
+ "comment": "Transaction directive",
527
+ "end": "(?=(^\\s*$|^\\S))",
528
+ "name": "meta.directive.transaction.beancount",
529
+ "patterns": [
530
+ {
531
+ "include": "#comments"
532
+ },
533
+ {
534
+ "include": "#posting"
535
+ },
536
+ {
537
+ "include": "#meta"
538
+ },
539
+ {
540
+ "include": "#tag"
541
+ },
542
+ {
543
+ "include": "#link"
544
+ },
545
+ {
546
+ "include": "#illegal"
547
+ }
548
+ ]
549
+ }
550
+ ],
551
+ "repository": {
552
+ "account": {
553
+ "begin": "([A-Z][a-z]+)(:)",
554
+ "beginCaptures": {
555
+ "1": {
556
+ "name": "constant.language.beancount"
557
+ },
558
+ "2": {
559
+ "name": "punctuation.separator.beancount"
560
+ }
561
+ },
562
+ "end": "\\s",
563
+ "name": "meta.account.beancount",
564
+ "patterns": [
565
+ {
566
+ "begin": "(\\S+)([:]?)",
567
+ "beginCaptures": {
568
+ "1": {
569
+ "name": "variable.account.beancount"
570
+ },
571
+ "2": {
572
+ "name": "punctuation.separator.beancount"
573
+ }
574
+ },
575
+ "comment": "Sub accounts",
576
+ "end": "([:]?)|(\\s)",
577
+ "patterns": [
578
+ {
579
+ "include": "$self"
580
+ },
581
+ {
582
+ "include": "#illegal"
583
+ }
584
+ ]
585
+ }
586
+ ]
587
+ },
588
+ "amount": {
589
+ "captures": {
590
+ "1": {
591
+ "name": "keyword.operator.modifier.beancount"
592
+ },
593
+ "2": {
594
+ "name": "constant.numeric.currency.beancount"
595
+ },
596
+ "3": {
597
+ "name": "entity.type.commodity.beancount"
598
+ }
599
+ },
600
+ "match": "([\\-|\\+]?)(\\d+(?:,\\d{3})*(?:\\.\\d*)?)\\s*([A-Z][A-Z0-9\\'\\.\\_\\-]{0,22}[A-Z0-9])",
601
+ "name": "meta.amount.beancount"
602
+ },
603
+ "bool": {
604
+ "captures": {
605
+ "0": {
606
+ "name": "constant.language.bool.beancount"
607
+ },
608
+ "2": {
609
+ "name": "constant.numeric.currency.beancount"
610
+ },
611
+ "3": {
612
+ "name": "entity.type.commodity.beancount"
613
+ }
614
+ },
615
+ "match": "TRUE|FALSE"
616
+ },
617
+ "comments": {
618
+ "captures": {
619
+ "1": {
620
+ "name": "comment.line.beancount"
621
+ }
622
+ },
623
+ "match": "(;.*)$"
624
+ },
625
+ "commodity": {
626
+ "match": "([A-Z][A-Z0-9\\'\\.\\_\\-]{0,22}[A-Z0-9])",
627
+ "name": "entity.type.commodity.beancount"
628
+ },
629
+ "cost": {
630
+ "begin": "\\{\\{?",
631
+ "beginCaptures": {
632
+ "0": {
633
+ "name": "keyword.operator.assignment.beancount"
634
+ }
635
+ },
636
+ "end": "\\}\\}?",
637
+ "endCaptures": {
638
+ "0": {
639
+ "name": "keyword.operator.assignment.beancount"
640
+ }
641
+ },
642
+ "name": "meta.cost.beancount",
643
+ "patterns": [
644
+ {
645
+ "include": "#amount"
646
+ },
647
+ {
648
+ "include": "#date"
649
+ },
650
+ {
651
+ "match": "\\,",
652
+ "name": "punctuation.separator.beancount"
653
+ },
654
+ {
655
+ "include": "#illegal"
656
+ }
657
+ ]
658
+ },
659
+ "date": {
660
+ "captures": {
661
+ "1": {
662
+ "name": "constant.numeric.date.year.beancount"
663
+ },
664
+ "2": {
665
+ "name": "punctuation.separator.beancount"
666
+ },
667
+ "3": {
668
+ "name": "constant.numeric.date.month.beancount"
669
+ },
670
+ "4": {
671
+ "name": "punctuation.separator.beancount"
672
+ },
673
+ "5": {
674
+ "name": "constant.numeric.date.day.beancount"
675
+ }
676
+ },
677
+ "match": "([0-9]{4})([\\-|/])([0-9]{2})([\\-|/])([0-9]{2})",
678
+ "name": "meta.date.beancount"
679
+ },
680
+ "flag": {
681
+ "match": "(?<=\\s)([*!&#?%PSTCURM])(?=\\s+)",
682
+ "name": "keyword.other.beancount"
683
+ },
684
+ "illegal": {
685
+ "match": "[^\\s]",
686
+ "name": "invalid.illegal.unrecognized.beancount"
687
+ },
688
+ "link": {
689
+ "captures": {
690
+ "1": {
691
+ "name": "keyword.operator.link.beancount"
692
+ },
693
+ "2": {
694
+ "name": "markup.underline.link.beancount"
695
+ }
696
+ },
697
+ "match": "(\\^)([A-Za-z0-9\\-_/.]+)"
698
+ },
699
+ "meta": {
700
+ "begin": "^\\s*([a-z][A-Za-z0-9\\-_]+)([:])",
701
+ "beginCaptures": {
702
+ "1": {
703
+ "name": "keyword.operator.directive.beancount"
704
+ },
705
+ "2": {
706
+ "name": "punctuation.separator.beancount"
707
+ }
708
+ },
709
+ "end": "\\n",
710
+ "name": "meta.meta.beancount",
711
+ "patterns": [
712
+ {
713
+ "include": "#string"
714
+ },
715
+ {
716
+ "include": "#account"
717
+ },
718
+ {
719
+ "include": "#bool"
720
+ },
721
+ {
722
+ "include": "#commodity"
723
+ },
724
+ {
725
+ "include": "#date"
726
+ },
727
+ {
728
+ "include": "#tag"
729
+ },
730
+ {
731
+ "include": "#amount"
732
+ },
733
+ {
734
+ "include": "#number"
735
+ },
736
+ {
737
+ "include": "#comments"
738
+ },
739
+ {
740
+ "include": "#illegal"
741
+ }
742
+ ]
743
+ },
744
+ "number": {
745
+ "captures": {
746
+ "1": {
747
+ "name": "keyword.operator.modifier.beancount"
748
+ },
749
+ "2": {
750
+ "name": "constant.numeric.currency.beancount"
751
+ }
752
+ },
753
+ "match": "([\\-|\\+]?)(\\d+(?:,\\d{3})*(?:\\.\\d*)?)"
754
+ },
755
+ "posting": {
756
+ "begin": "^\\s+(?=([A-Z\\!]))",
757
+ "end": "(?=(^\\s*$|^\\S|^\\s*[A-Z]))",
758
+ "name": "meta.posting.beancount",
759
+ "patterns": [
760
+ {
761
+ "include": "#meta"
762
+ },
763
+ {
764
+ "include": "#comments"
765
+ },
766
+ {
767
+ "include": "#flag"
768
+ },
769
+ {
770
+ "include": "#account"
771
+ },
772
+ {
773
+ "include": "#amount"
774
+ },
775
+ {
776
+ "include": "#cost"
777
+ },
778
+ {
779
+ "include": "#date"
780
+ },
781
+ {
782
+ "include": "#price"
783
+ },
784
+ {
785
+ "include": "#illegal"
786
+ }
787
+ ]
788
+ },
789
+ "price": {
790
+ "begin": "\\@\\@?",
791
+ "beginCaptures": {
792
+ "0": {
793
+ "name": "keyword.operator.assignment.beancount"
794
+ }
795
+ },
796
+ "end": "(?=(;|\\n))",
797
+ "name": "meta.price.beancount",
798
+ "patterns": [
799
+ {
800
+ "include": "#amount"
801
+ },
802
+ {
803
+ "include": "#illegal"
804
+ }
805
+ ]
806
+ },
807
+ "string": {
808
+ "begin": "\\\"",
809
+ "end": "\\\"",
810
+ "name": "string.quoted.double.beancount",
811
+ "patterns": [
812
+ {
813
+ "match": "\\\\.",
814
+ "name": "constant.character.escape.beancount"
815
+ }
816
+ ]
817
+ },
818
+ "tag": {
819
+ "captures": {
820
+ "1": {
821
+ "name": "keyword.operator.tag.beancount"
822
+ },
823
+ "2": {
824
+ "name": "entity.name.tag.beancount"
825
+ }
826
+ },
827
+ "match": "(#)([A-Za-z0-9\\-_/.]+)"
828
+ }
829
+ },
830
+ "scopeName": "text.beancount"
831
+ }