PluginProbe
Code Block Pro – Beautiful Syntax Highlighting / 1.27.3
Code Block Pro – Beautiful Syntax Highlighting v1.27.3
1.27.1 1.27.2 1.27.3 1.27.4 1.27.5 1.27.6 1.27.7 1.28.0 1.3.0 1.4.0 1.5.0 1.5.1 1.5.2 1.6.0 1.7.0 1.8.0 1.9.0 1.9.1 1.9.2 1.9.3 trunk 1.1.0 1.10.0 1.11.0 1.11.1 All 63 releases
code-block-pro / build / shiki / languages / beancount.tmLanguage.json

beancount.tmLanguage.json in Code Block Pro – Beautiful Syntax Highlighting 1.27.3, at build/shiki/languages/beancount.tmLanguage.json

830 lines 18.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 {
2 "fileTypes": ["beancount"],
3 "name": "beancount",
4 "patterns": [
5 {
6 "comment": "Comments",
7 "match": ";.*",
8 "name": "comment.line.beancount"
9 },
10 {
11 "begin": "^\\s*(poptag|pushtag)\\s+(#)([A-Za-z0-9\\-_/.]+)",
12 "beginCaptures": {
13 "1": {
14 "name": "support.function.beancount"
15 },
16 "2": {
17 "name": "keyword.operator.tag.beancount"
18 },
19 "3": {
20 "name": "entity.name.tag.beancount"
21 }
22 },
23 "comment": "Tag directive",
24 "end": "(?=(^\\s*$|^\\S))",
25 "name": "meta.directive.tag.beancount",
26 "patterns": [
27 {
28 "include": "#comments"
29 },
30 {
31 "include": "#illegal"
32 }
33 ]
34 },
35 {
36 "begin": "^\\s*(include)\\s+(\\\".*\\\")",
37 "beginCaptures": {
38 "1": {
39 "name": "support.function.beancount"
40 },
41 "2": {
42 "name": "string.quoted.double.beancount"
43 }
44 },
45 "comment": "Include directive",
46 "end": "(?=(^\\s*$|^\\S))",
47 "name": "meta.directive.include.beancount",
48 "patterns": [
49 {
50 "include": "#comments"
51 },
52 {
53 "include": "#illegal"
54 }
55 ]
56 },
57 {
58 "begin": "^\\s*(option)\\s+(\\\".*\\\")\\s+(\\\".*\\\")",
59 "beginCaptures": {
60 "1": {
61 "name": "support.function.beancount"
62 },
63 "2": {
64 "name": "support.variable.beancount"
65 },
66 "3": {
67 "name": "string.quoted.double.beancount"
68 }
69 },
70 "comment": "Option directive",
71 "end": "(?=(^\\s*$|^\\S))",
72 "name": "meta.directive.option.beancount",
73 "patterns": [
74 {
75 "include": "#comments"
76 },
77 {
78 "include": "#illegal"
79 }
80 ]
81 },
82 {
83 "begin": "^\\s*(plugin)\\s*(\"(.*?)\")\\s*(\".*?\")?",
84 "beginCaptures": {
85 "1": {
86 "name": "support.function.beancount"
87 },
88 "2": {
89 "name": "string.quoted.double.beancount"
90 },
91 "3": {
92 "name": "entity.name.function.beancount"
93 },
94 "4": {
95 "name": "string.quoted.double.beancount"
96 }
97 },
98 "comment": "Plugin directive",
99 "end": "(?=(^\\s*$|^\\S))",
100 "name": "keyword.operator.directive.beancount",
101 "patterns": [
102 {
103 "include": "#comments"
104 },
105 {
106 "include": "#illegal"
107 }
108 ]
109 },
110 {
111 "begin": "([0-9]{4})([\\-|/])([0-9]{2})([\\-|/])([0-9]{2})\\s+(open|close|pad)\\b",
112 "beginCaptures": {
113 "1": {
114 "name": "constant.numeric.date.year.beancount"
115 },
116 "2": {
117 "name": "punctuation.separator.beancount"
118 },
119 "3": {
120 "name": "constant.numeric.date.month.beancount"
121 },
122 "4": {
123 "name": "punctuation.separator.beancount"
124 },
125 "5": {
126 "name": "constant.numeric.date.day.beancount"
127 },
128 "6": {
129 "name": "support.function.beancount"
130 }
131 },
132 "comment": "Open/Close/Pad directive",
133 "end": "(?=(^\\s*$|^\\S))",
134 "name": "meta.directive.dated.beancount",
135 "patterns": [
136 {
137 "include": "#comments"
138 },
139 {
140 "include": "#meta"
141 },
142 {
143 "include": "#account"
144 },
145 {
146 "include": "#commodity"
147 },
148 {
149 "match": "\\,",
150 "name": "punctuation.separator.beancount"
151 },
152 {
153 "include": "#illegal"
154 }
155 ]
156 },
157 {
158 "begin": "([0-9]{4})([\\-|/])([0-9]{2})([\\-|/])([0-9]{2})\\s+(custom)\\b",
159 "beginCaptures": {
160 "1": {
161 "name": "constant.numeric.date.year.beancount"
162 },
163 "2": {
164 "name": "punctuation.separator.beancount"
165 },
166 "3": {
167 "name": "constant.numeric.date.month.beancount"
168 },
169 "4": {
170 "name": "punctuation.separator.beancount"
171 },
172 "5": {
173 "name": "constant.numeric.date.day.beancount"
174 },
175 "6": {
176 "name": "support.function.beancount"
177 }
178 },
179 "comment": "Custom directive",
180 "end": "(?=(^\\s*$|^\\S))",
181 "name": "meta.directive.dated.beancount",
182 "patterns": [
183 {
184 "include": "#comments"
185 },
186 {
187 "include": "#meta"
188 },
189 {
190 "include": "#string"
191 },
192 {
193 "include": "#bool"
194 },
195 {
196 "include": "#amount"
197 },
198 {
199 "include": "#number"
200 },
201 {
202 "include": "#date"
203 },
204 {
205 "include": "#account"
206 },
207 {
208 "include": "#illegal"
209 }
210 ]
211 },
212 {
213 "begin": "([0-9]{4})([\\-|/])([0-9]{2})([\\-|/])([0-9]{2})\\s(event)",
214 "beginCaptures": {
215 "1": {
216 "name": "constant.numeric.date.year.beancount"
217 },
218 "2": {
219 "name": "punctuation.separator.beancount"
220 },
221 "3": {
222 "name": "constant.numeric.date.month.beancount"
223 },
224 "4": {
225 "name": "punctuation.separator.beancount"
226 },
227 "5": {
228 "name": "constant.numeric.date.day.beancount"
229 },
230 "6": {
231 "name": "support.function.directive.beancount"
232 }
233 },
234 "comment": "Event directive",
235 "end": "(?=(^\\s*$|^\\S))",
236 "name": "meta.directive.dated.beancount",
237 "patterns": [
238 {
239 "include": "#comments"
240 },
241 {
242 "include": "#meta"
243 },
244 {
245 "include": "#string"
246 },
247 {
248 "include": "#illegal"
249 }
250 ]
251 },
252 {
253 "begin": "([0-9]{4})([\\-|/])([0-9]{2})([\\-|/])([0-9]{2})\\s(commodity)",
254 "beginCaptures": {
255 "1": {
256 "name": "constant.numeric.date.year.beancount"
257 },
258 "2": {
259 "name": "punctuation.separator.beancount"
260 },
261 "3": {
262 "name": "constant.numeric.date.month.beancount"
263 },
264 "4": {
265 "name": "punctuation.separator.beancount"
266 },
267 "5": {
268 "name": "constant.numeric.date.day.beancount"
269 },
270 "6": {
271 "name": "support.function.directive.beancount"
272 }
273 },
274 "comment": "Commodity directive",
275 "end": "(?=(^\\s*$|^\\S))",
276 "name": "meta.directive.dated.beancount",
277 "patterns": [
278 {
279 "include": "#comments"
280 },
281 {
282 "include": "#meta"
283 },
284 {
285 "include": "#commodity"
286 },
287 {
288 "include": "#illegal"
289 }
290 ]
291 },
292 {
293 "name": "meta.directive.notetotext.beancount",
294 "comment": "Note as Oneliner Transaction directive",
295 "begin": "([0-9]{4})([\\-|/])([0-9]{2})([\\-|/])([0-9]{2})\\s+(note)(?=(.*\\*\\\"\\s))",
296 "beginCaptures": {
297 "1": {
298 "name": "constant.numeric.date.year.beancount"
299 },
300 "2": {
301 "name": "punctuation.separator.beancount"
302 },
303 "3": {
304 "name": "constant.numeric.date.month.beancount"
305 },
306 "4": {
307 "name": "punctuation.separator.beancount"
308 },
309 "5": {
310 "name": "constant.numeric.date.day.beancount"
311 },
312 "6": {
313 "name": "support.function.directive.beancount"
314 }
315 },
316 "end": "(?=(^\\s*$|^\\S))",
317 "patterns": [
318 {
319 "include": "#meta"
320 },
321 {
322 "include": "#account"
323 },
324 {
325 "name": "punctuation.separator.beancount",
326 "match": "(?<=\\s)\\\""
327 },
328 {
329 "include": "#cost"
330 },
331 {
332 "include": "#amount"
333 },
334 {
335 "begin": "(\\*|\\!)",
336 "beginCaptures": {
337 "0": {
338 "name": "support.function.directive.beancount"
339 }
340 },
341 "end": "(\\*\\\")",
342 "endCaptures": {
343 "0": {
344 "name": "punctuation.separator.beancount"
345 }
346 },
347 "patterns": [
348 {
349 "name": "constant.character.escape.beancount",
350 "match": "\\\\."
351 },
352 {
353 "include": "#tag"
354 },
355 {
356 "name": "string.quoted.double.beancount",
357 "match": "([^\\\"])"
358 }
359 ]
360 },
361 {
362 "include": "#illegal"
363 }
364 ]
365 },
366 {
367 "begin": "([0-9]{4})([\\-|/])([0-9]{2})([\\-|/])([0-9]{2})\\s(note|document)",
368 "beginCaptures": {
369 "1": {
370 "name": "constant.numeric.date.year.beancount"
371 },
372 "2": {
373 "name": "punctuation.separator.beancount"
374 },
375 "3": {
376 "name": "constant.numeric.date.month.beancount"
377 },
378 "4": {
379 "name": "punctuation.separator.beancount"
380 },
381 "5": {
382 "name": "constant.numeric.date.day.beancount"
383 },
384 "6": {
385 "name": "support.function.directive.beancount"
386 }
387 },
388 "comment": "Note/Document directive",
389 "end": "(?=(^\\s*$|^\\S))",
390 "name": "meta.directive.dated.beancount",
391 "patterns": [
392 {
393 "include": "#comments"
394 },
395 {
396 "include": "#meta"
397 },
398 {
399 "include": "#account"
400 },
401 {
402 "include": "#string"
403 },
404 {
405 "include": "#illegal"
406 }
407 ]
408 },
409 {
410 "begin": "([0-9]{4})([\\-|/])([0-9]{2})([\\-|/])([0-9]{2})\\s(price)",
411 "beginCaptures": {
412 "1": {
413 "name": "constant.numeric.date.year.beancount"
414 },
415 "2": {
416 "name": "punctuation.separator.beancount"
417 },
418 "3": {
419 "name": "constant.numeric.date.month.beancount"
420 },
421 "4": {
422 "name": "punctuation.separator.beancount"
423 },
424 "5": {
425 "name": "constant.numeric.date.day.beancount"
426 },
427 "6": {
428 "name": "support.function.directive.beancount"
429 }
430 },
431 "comment": "Price directives",
432 "end": "(?=(^\\s*$|^\\S))",
433 "name": "meta.directive.dated.beancount",
434 "patterns": [
435 {
436 "include": "#comments"
437 },
438 {
439 "include": "#meta"
440 },
441 {
442 "include": "#commodity"
443 },
444 {
445 "include": "#amount"
446 },
447 {
448 "include": "#illegal"
449 }
450 ]
451 },
452 {
453 "begin": "([0-9]{4})([\\-|/])([0-9]{2})([\\-|/])([0-9]{2})\\s(balance)",
454 "beginCaptures": {
455 "1": {
456 "name": "constant.numeric.date.year.beancount"
457 },
458 "2": {
459 "name": "punctuation.separator.beancount"
460 },
461 "3": {
462 "name": "constant.numeric.date.month.beancount"
463 },
464 "4": {
465 "name": "punctuation.separator.beancount"
466 },
467 "5": {
468 "name": "constant.numeric.date.day.beancount"
469 },
470 "6": {
471 "name": "support.function.directive.beancount"
472 }
473 },
474 "comment": "Balance directives",
475 "end": "(?=(^\\s*$|^\\S))",
476 "name": "meta.directive.dated.beancount",
477 "patterns": [
478 {
479 "include": "#comments"
480 },
481 {
482 "include": "#meta"
483 },
484 {
485 "include": "#account"
486 },
487 {
488 "include": "#amount"
489 },
490 {
491 "include": "#illegal"
492 }
493 ]
494 },
495 {
496 "begin": "([0-9]{4})([\\-|/])([0-9]{2})([\\-|/])([0-9]{2})\\s*(txn|[*!&#?%PSTCURM])\\s*(\".*?\")?\\s*(\".*?\")?",
497 "beginCaptures": {
498 "1": {
499 "name": "constant.numeric.date.year.beancount"
500 },
501 "2": {
502 "name": "punctuation.separator.beancount"
503 },
504 "3": {
505 "name": "constant.numeric.date.month.beancount"
506 },
507 "4": {
508 "name": "punctuation.separator.beancount"
509 },
510 "5": {
511 "name": "constant.numeric.date.day.beancount"
512 },
513 "6": {
514 "name": "support.function.directive.beancount"
515 },
516 "7": {
517 "name": "string.quoted.tiers.beancount"
518 },
519 "8": {
520 "name": "string.quoted.narration.beancount"
521 }
522 },
523 "comment": "Transaction directive",
524 "end": "(?=(^\\s*$|^\\S))",
525 "name": "meta.directive.transaction.beancount",
526 "patterns": [
527 {
528 "include": "#comments"
529 },
530 {
531 "include": "#posting"
532 },
533 {
534 "include": "#meta"
535 },
536 {
537 "include": "#tag"
538 },
539 {
540 "include": "#link"
541 },
542 {
543 "include": "#illegal"
544 }
545 ]
546 }
547 ],
548 "repository": {
549 "account": {
550 "begin": "([A-Z][a-z]+)(:)",
551 "beginCaptures": {
552 "1": {
553 "name": "constant.language.beancount"
554 },
555 "2": {
556 "name": "punctuation.separator.beancount"
557 }
558 },
559 "end": "\\s",
560 "name": "meta.account.beancount",
561 "patterns": [
562 {
563 "begin": "(\\S+)([:]?)",
564 "beginCaptures": {
565 "1": {
566 "name": "variable.account.beancount"
567 },
568 "2": {
569 "name": "punctuation.separator.beancount"
570 }
571 },
572 "comment": "Sub accounts",
573 "end": "([:]?)|(\\s)",
574 "patterns": [
575 {
576 "include": "$self"
577 },
578 {
579 "include": "#illegal"
580 }
581 ]
582 }
583 ]
584 },
585 "bool": {
586 "captures": {
587 "0": {
588 "name": "constant.language.bool.beancount"
589 },
590 "2": {
591 "name": "constant.numeric.currency.beancount"
592 },
593 "3": {
594 "name": "entity.type.commodity.beancount"
595 }
596 },
597 "match": "TRUE|FALSE"
598 },
599 "number": {
600 "captures": {
601 "1": {
602 "name": "keyword.operator.modifier.beancount"
603 },
604 "2": {
605 "name": "constant.numeric.currency.beancount"
606 }
607 },
608 "match": "([\\-|\\+]?)(\\d+(?:,\\d{3})*(?:\\.\\d*)?)"
609 },
610 "amount": {
611 "captures": {
612 "1": {
613 "name": "keyword.operator.modifier.beancount"
614 },
615 "2": {
616 "name": "constant.numeric.currency.beancount"
617 },
618 "3": {
619 "name": "entity.type.commodity.beancount"
620 }
621 },
622 "match": "([\\-|\\+]?)(\\d+(?:,\\d{3})*(?:\\.\\d*)?)\\s*([A-Z][A-Z0-9\\'\\.\\_\\-]{0,22}[A-Z0-9])",
623 "name": "meta.amount.beancount"
624 },
625 "comments": {
626 "captures": {
627 "1": {
628 "name": "comment.line.beancount"
629 }
630 },
631 "match": "(;.*)$"
632 },
633 "commodity": {
634 "match": "([A-Z][A-Z0-9\\'\\.\\_\\-]{0,22}[A-Z0-9])",
635 "name": "entity.type.commodity.beancount"
636 },
637 "cost": {
638 "begin": "\\{\\{?",
639 "beginCaptures": {
640 "0": {
641 "name": "keyword.operator.assignment.beancount"
642 }
643 },
644 "end": "\\}\\}?",
645 "endCaptures": {
646 "0": {
647 "name": "keyword.operator.assignment.beancount"
648 }
649 },
650 "name": "meta.cost.beancount",
651 "patterns": [
652 {
653 "include": "#amount"
654 },
655 {
656 "include": "#date"
657 },
658 {
659 "match": "\\,",
660 "name": "punctuation.separator.beancount"
661 },
662 {
663 "include": "#illegal"
664 }
665 ]
666 },
667 "date": {
668 "captures": {
669 "1": {
670 "name": "constant.numeric.date.year.beancount"
671 },
672 "2": {
673 "name": "punctuation.separator.beancount"
674 },
675 "3": {
676 "name": "constant.numeric.date.month.beancount"
677 },
678 "4": {
679 "name": "punctuation.separator.beancount"
680 },
681 "5": {
682 "name": "constant.numeric.date.day.beancount"
683 }
684 },
685 "match": "([0-9]{4})([\\-|/])([0-9]{2})([\\-|/])([0-9]{2})",
686 "name": "meta.date.beancount"
687 },
688 "flag": {
689 "match": "(?<=\\s)([*!&#?%PSTCURM])(?=\\s+)",
690 "name": "keyword.other.beancount"
691 },
692 "illegal": {
693 "match": "[^\\s]",
694 "name": "invalid.illegal.unrecognized.beancount"
695 },
696 "link": {
697 "captures": {
698 "1": {
699 "name": "keyword.operator.link.beancount"
700 },
701 "2": {
702 "name": "markup.underline.link.beancount"
703 }
704 },
705 "match": "(\\^)([A-Za-z0-9\\-_/.]+)"
706 },
707 "meta": {
708 "begin": "^\\s*([a-z][A-Za-z0-9\\-_]+)([:])",
709 "beginCaptures": {
710 "1": {
711 "name": "keyword.operator.directive.beancount"
712 },
713 "2": {
714 "name": "punctuation.separator.beancount"
715 }
716 },
717 "end": "\\n",
718 "name": "meta.meta.beancount",
719 "patterns": [
720 {
721 "include": "#string"
722 },
723 {
724 "include": "#account"
725 },
726 {
727 "include": "#bool"
728 },
729 {
730 "include": "#commodity"
731 },
732 {
733 "include": "#date"
734 },
735 {
736 "include": "#tag"
737 },
738 {
739 "include": "#amount"
740 },
741 {
742 "include": "#number"
743 },
744 {
745 "include": "#comments"
746 },
747 {
748 "include": "#illegal"
749 }
750 ]
751 },
752 "posting": {
753 "begin": "^\\s+(?=([A-Z\\!]))",
754 "end": "(?=(^\\s*$|^\\S|^\\s*[A-Z]))",
755 "name": "meta.posting.beancount",
756 "patterns": [
757 {
758 "include": "#meta"
759 },
760 {
761 "include": "#comments"
762 },
763 {
764 "include": "#flag"
765 },
766 {
767 "include": "#account"
768 },
769 {
770 "include": "#amount"
771 },
772 {
773 "include": "#cost"
774 },
775 {
776 "include": "#date"
777 },
778 {
779 "include": "#price"
780 },
781 {
782 "include": "#illegal"
783 }
784 ]
785 },
786 "price": {
787 "begin": "\\@\\@?",
788 "beginCaptures": {
789 "0": {
790 "name": "keyword.operator.assignment.beancount"
791 }
792 },
793 "end": "(?=(;|\\n))",
794 "name": "meta.price.beancount",
795 "patterns": [
796 {
797 "include": "#amount"
798 },
799 {
800 "include": "#illegal"
801 }
802 ]
803 },
804 "string": {
805 "begin": "\\\"",
806 "end": "\\\"",
807 "name": "string.quoted.double.beancount",
808 "patterns": [
809 {
810 "match": "\\\\.",
811 "name": "constant.character.escape.beancount"
812 }
813 ]
814 },
815 "tag": {
816 "captures": {
817 "1": {
818 "name": "keyword.operator.tag.beancount"
819 },
820 "2": {
821 "name": "entity.name.tag.beancount"
822 }
823 },
824 "match": "(#)([A-Za-z0-9\\-_/.]+)"
825 }
826 },
827 "scopeName": "text.beancount",
828 "uuid": "dbf28879-ee4d-497e-a678-a5c5a5e8d74f"
829 }
830