tree-sitter-beancount 2.3.3 → 2.4.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 (45) hide show
  1. package/README.md +334 -4
  2. package/binding.gyp +17 -7
  3. package/bindings/node/binding.cc +14 -22
  4. package/bindings/node/index.d.ts +28 -0
  5. package/bindings/node/index.js +3 -15
  6. package/grammar.js +38 -125
  7. package/package.json +35 -5
  8. package/src/grammar.json +149 -560
  9. package/src/node-types.json +10 -11
  10. package/src/parser.c +7615 -9089
  11. package/src/scanner.c +345 -67
  12. package/src/tree_sitter/alloc.h +54 -0
  13. package/src/tree_sitter/array.h +291 -0
  14. package/src/tree_sitter/parser.h +68 -12
  15. package/.clang-format +0 -20
  16. package/.envrc +0 -1
  17. package/.gitattributes +0 -6
  18. package/.github/dependabot.yml +0 -26
  19. package/.github/workflows/cicd.yml +0 -30
  20. package/.github/workflows/release.yml +0 -72
  21. package/CHANGELOG.md +0 -80
  22. package/Cargo.lock +0 -71
  23. package/Cargo.toml +0 -26
  24. package/Package.swift +0 -20
  25. package/bindings/rust/build.rs +0 -39
  26. package/bindings/rust/lib.rs +0 -52
  27. package/flake.lock +0 -141
  28. package/flake.nix +0 -120
  29. package/test/corpus/arithmetic.txt +0 -373
  30. package/test/corpus/comment.txt +0 -992
  31. package/test/corpus/currencies.txt +0 -66
  32. package/test/corpus/entry_types.txt +0 -389
  33. package/test/corpus/markdown_orgmode.txt +0 -60
  34. package/test/corpus/metadata.txt +0 -414
  35. package/test/corpus/multi_line.txt +0 -27
  36. package/test/corpus/orgmode_sections.txt +0 -53
  37. package/test/corpus/parse_lots.txt +0 -417
  38. package/test/corpus/parser_include.txt +0 -23
  39. package/test/corpus/parser_links.txt +0 -32
  40. package/test/corpus/parser_options.txt +0 -39
  41. package/test/corpus/parser_plugin.txt +0 -35
  42. package/test/corpus/push_pop_meta.txt +0 -34
  43. package/test/corpus/push_pop_tag.txt +0 -23
  44. package/test/corpus/transaction.txt +0 -224
  45. package/test/corpus/ugly_bugs.txt +0 -91
@@ -1,992 +0,0 @@
1
- ========
2
- comment
3
- ========
4
-
5
- ;; This is some comment.
6
-
7
- ---
8
-
9
- (file (comment))
10
-
11
- ===========================
12
- comment before transaction
13
- ===========================
14
-
15
- ; Hi
16
- 2015-06-07 *
17
- Assets:Cash 1 USD
18
- Assets:Cash -1 USD
19
-
20
- ---
21
-
22
- (file
23
- (comment)
24
- (transaction
25
- (date)
26
- (txn)
27
- (posting
28
- (account)
29
- (incomplete_amount
30
- (number)
31
- (currency)
32
- )
33
- )
34
- (posting
35
- (account)
36
- (incomplete_amount
37
- (unary_number_expr (minus) (number))
38
- (currency)
39
- )
40
- )
41
- )
42
- )
43
-
44
- ==========================
45
- comment after transaction
46
- ==========================
47
-
48
- 2015-06-07 *
49
- Assets:Cash 1 USD
50
- Assets:Cash -1 USD
51
- ; Hi
52
-
53
- ---
54
-
55
- (file
56
- (transaction
57
- (date)
58
- (txn)
59
- (posting
60
- (account)
61
- (incomplete_amount
62
- (number)
63
- (currency)
64
- )
65
- )
66
- (posting
67
- (account)
68
- (incomplete_amount
69
- (unary_number_expr (minus) (number))
70
- (currency)
71
- )
72
- )
73
- (comment)
74
- )
75
- )
76
-
77
- ========================
78
- comment between posting
79
- ========================
80
-
81
- 2015-06-07 *
82
- Assets:Cash 1 USD
83
- ; Hi
84
- Assets:Cash -1 USD
85
-
86
- ---
87
-
88
- (file
89
- (transaction
90
- (date)
91
- (txn)
92
- (posting
93
- (account)
94
- (incomplete_amount
95
- (number)
96
- (currency)
97
- )
98
- )
99
- (comment)
100
- (posting
101
- (account)
102
- (incomplete_amount
103
- (unary_number_expr (minus) (number))
104
- (currency)
105
- )
106
- )
107
- )
108
- )
109
-
110
- ======================
111
- comment after posting
112
- ======================
113
-
114
- 2015-06-07 *
115
- Assets:Cash 1 USD ; Hi
116
- Assets:Cash -1 USD
117
-
118
- ---
119
-
120
- (file
121
- (transaction
122
- (date)
123
- (txn)
124
- (posting
125
- (account)
126
- (incomplete_amount
127
- (number)
128
- (currency)
129
- )
130
- (comment)
131
- )
132
- (posting
133
- (account)
134
- (incomplete_amount
135
- (unary_number_expr (minus) (number))
136
- (currency)
137
- )
138
- )
139
- )
140
- )
141
-
142
- ================================
143
- comment after transaction start
144
- ================================
145
-
146
- 2015-06-07 * ; Hi
147
- Assets:Cash 1 USD
148
- Assets:Cash -1 USD
149
-
150
- ---
151
-
152
- (file
153
- (transaction
154
- (date)
155
- (txn)
156
- (comment)
157
- (posting
158
- (account)
159
- (incomplete_amount
160
- (number)
161
- (currency)
162
- )
163
- )
164
- (posting
165
- (account)
166
- (incomplete_amount
167
- (unary_number_expr (minus) (number))
168
- (currency)
169
- )
170
- )
171
- )
172
- )
173
-
174
- ==============================
175
- comment after balance start
176
- ==============================
177
-
178
- 1970-01-01 balance Assets:Checking 100 USD ; Blah
179
- imported: TRUE
180
-
181
- ---
182
-
183
- (file
184
- (balance
185
- (date)
186
- (account)
187
- (amount_tolerance
188
- (number)
189
- (currency))
190
- (comment)
191
- (key_value
192
- (key)
193
- (value
194
- (bool)))))
195
-
196
- ====================================
197
- comment in balance key value list
198
- ====================================
199
-
200
- 1970-01-01 balance Assets:Checking 100 USD
201
- ; Blah
202
- imported: TRUE
203
- ; Blah
204
-
205
- ---
206
-
207
- (file
208
- (balance
209
- (date)
210
- (account)
211
- (amount_tolerance
212
- (number)
213
- (currency))
214
- (comment)
215
- (key_value
216
- (key)
217
- (value
218
- (bool)))
219
- (comment)))
220
-
221
- ==============================
222
- comment after close start
223
- ==============================
224
-
225
- 1970-01-01 close Assets:Checking ; Blah
226
- reason: "Migrated"
227
-
228
- ---
229
-
230
- (file
231
- (close
232
- (date)
233
- (account)
234
- (comment)
235
- (key_value
236
- (key)
237
- (value
238
- (string)))))
239
-
240
- ====================================
241
- comment in close key value list
242
- ====================================
243
-
244
- 1970-01-01 close Assets:Checking
245
- ; Blah
246
- reason: "migrated"
247
- ; Blah
248
-
249
- ---
250
-
251
- (file
252
- (close
253
- (date)
254
- (account)
255
- (comment)
256
- (key_value
257
- (key)
258
- (value
259
- (string)))
260
- (comment)))
261
-
262
- ==============================
263
- comment after commodity start
264
- ==============================
265
-
266
- 1970-01-01 commodity USD ; Blah
267
- precision: 2
268
-
269
- ---
270
-
271
- (file
272
- (commodity
273
- (date)
274
- (currency)
275
- (comment)
276
- (key_value
277
- (key)
278
- (value
279
- (number)))))
280
-
281
- ====================================
282
- comment in commodity key value list
283
- ====================================
284
-
285
- 1970-01-01 commodity USD
286
- ; Blah
287
- precision: 2
288
- ; Blah
289
-
290
- ---
291
-
292
- (file
293
- (commodity
294
- (date)
295
- (currency)
296
- (comment)
297
- (key_value
298
- (key)
299
- (value
300
- (number)))
301
- (comment)))
302
-
303
- ==============================
304
- comment after open start
305
- ==============================
306
-
307
- 1970-01-01 open Assets:Checking USD "FIFO" ; Blah
308
- account-number: "12345"
309
-
310
- ---
311
-
312
- (file
313
- (open
314
- (date)
315
- (account)
316
- (currency)
317
- (opt_booking
318
- (string))
319
- (comment)
320
- (key_value
321
- (key)
322
- (value
323
- (string)))))
324
-
325
- ====================================
326
- comment in open key value list
327
- ====================================
328
-
329
- 1970-01-01 open Assets:Checking USD "FIFO"
330
- ; Blah
331
- account-number: "12345"
332
- ; Blah
333
-
334
- ---
335
-
336
- (file
337
- (open
338
- (date)
339
- (account)
340
- (currency)
341
- (opt_booking
342
- (string))
343
- (comment)
344
- (key_value
345
- (key)
346
- (value
347
- (string)))
348
- (comment)))
349
- ========
350
- comment
351
- ========
352
-
353
- ;; This is some comment.
354
-
355
- ---
356
-
357
- (file (comment))
358
-
359
- ===========================
360
- comment before transaction
361
- ===========================
362
-
363
- ; Hi
364
- 2015-06-07 *
365
- Assets:Cash 1 USD
366
- Assets:Cash -1 USD
367
-
368
- ---
369
-
370
- (file
371
- (comment)
372
- (transaction
373
- (date)
374
- (txn)
375
- (posting
376
- (account)
377
- (incomplete_amount
378
- (number)
379
- (currency)
380
- )
381
- )
382
- (posting
383
- (account)
384
- (incomplete_amount
385
- (unary_number_expr (minus) (number))
386
- (currency)
387
- )
388
- )
389
- )
390
- )
391
-
392
- ==========================
393
- comment after transaction
394
- ==========================
395
-
396
- 2015-06-07 *
397
- Assets:Cash 1 USD
398
- Assets:Cash -1 USD
399
- ; Hi
400
-
401
- ---
402
-
403
- (file
404
- (transaction
405
- (date)
406
- (txn)
407
- (posting
408
- (account)
409
- (incomplete_amount
410
- (number)
411
- (currency)
412
- )
413
- )
414
- (posting
415
- (account)
416
- (incomplete_amount
417
- (unary_number_expr (minus) (number))
418
- (currency)
419
- )
420
- )
421
- (comment)
422
- )
423
- )
424
-
425
- ========================
426
- comment between posting
427
- ========================
428
-
429
- 2015-06-07 *
430
- Assets:Cash 1 USD
431
- ; Hi
432
- Assets:Cash -1 USD
433
-
434
- ---
435
-
436
- (file
437
- (transaction
438
- (date)
439
- (txn)
440
- (posting
441
- (account)
442
- (incomplete_amount
443
- (number)
444
- (currency)
445
- )
446
- )
447
- (comment)
448
- (posting
449
- (account)
450
- (incomplete_amount
451
- (unary_number_expr (minus) (number))
452
- (currency)
453
- )
454
- )
455
- )
456
- )
457
-
458
- ======================
459
- comment after posting
460
- ======================
461
-
462
- 2015-06-07 *
463
- Assets:Cash 1 USD ; Hi
464
- Assets:Cash -1 USD
465
-
466
- ---
467
-
468
- (file
469
- (transaction
470
- (date)
471
- (txn)
472
- (posting
473
- (account)
474
- (incomplete_amount
475
- (number)
476
- (currency)
477
- )
478
- (comment)
479
- )
480
- (posting
481
- (account)
482
- (incomplete_amount
483
- (unary_number_expr (minus) (number))
484
- (currency)
485
- )
486
- )
487
- )
488
- )
489
-
490
- ================================
491
- comment after transaction start
492
- ================================
493
-
494
- 2015-06-07 * ; Hi
495
- Assets:Cash 1 USD
496
- Assets:Cash -1 USD
497
-
498
- ---
499
-
500
- (file
501
- (transaction
502
- (date)
503
- (txn)
504
- (comment)
505
- (posting
506
- (account)
507
- (incomplete_amount
508
- (number)
509
- (currency)
510
- )
511
- )
512
- (posting
513
- (account)
514
- (incomplete_amount
515
- (unary_number_expr (minus) (number))
516
- (currency)
517
- )
518
- )
519
- )
520
- )
521
-
522
- ==============================
523
- comment after balance start
524
- ==============================
525
-
526
- 1970-01-01 balance Assets:Checking 100 USD ; Blah
527
- imported: TRUE
528
-
529
- ---
530
-
531
- (file
532
- (balance
533
- (date)
534
- (account)
535
- (amount_tolerance
536
- (number)
537
- (currency))
538
- (comment)
539
- (key_value
540
- (key)
541
- (value
542
- (bool)))))
543
-
544
- ====================================
545
- comment in balance key value list
546
- ====================================
547
-
548
- 1970-01-01 balance Assets:Checking 100 USD
549
- ; Blah
550
- imported: TRUE
551
- ; Blah
552
-
553
- ---
554
-
555
- (file
556
- (balance
557
- (date)
558
- (account)
559
- (amount_tolerance
560
- (number)
561
- (currency))
562
- (comment)
563
- (key_value
564
- (key)
565
- (value
566
- (bool)))
567
- (comment)))
568
-
569
- ==============================
570
- comment after close start
571
- ==============================
572
-
573
- 1970-01-01 close Assets:Checking ; Blah
574
- reason: "Migrated"
575
-
576
- ---
577
-
578
- (file
579
- (close
580
- (date)
581
- (account)
582
- (comment)
583
- (key_value
584
- (key)
585
- (value
586
- (string)))))
587
-
588
- ====================================
589
- comment in close key value list
590
- ====================================
591
-
592
- 1970-01-01 close Assets:Checking
593
- ; Blah
594
- reason: "migrated"
595
- ; Blah
596
-
597
- ---
598
-
599
- (file
600
- (close
601
- (date)
602
- (account)
603
- (comment)
604
- (key_value
605
- (key)
606
- (value
607
- (string)))
608
- (comment)))
609
-
610
- ==============================
611
- comment after commodity start
612
- ==============================
613
-
614
- 1970-01-01 commodity USD ; Blah
615
- precision: 2
616
-
617
- ---
618
-
619
- (file
620
- (commodity
621
- (date)
622
- (currency)
623
- (comment)
624
- (key_value
625
- (key)
626
- (value
627
- (number)))))
628
-
629
- ====================================
630
- comment in commodity key value list
631
- ====================================
632
-
633
- 1970-01-01 commodity USD
634
- ; Blah
635
- precision: 2
636
- ; Blah
637
-
638
- ---
639
-
640
- (file
641
- (commodity
642
- (date)
643
- (currency)
644
- (comment)
645
- (key_value
646
- (key)
647
- (value
648
- (number)))
649
- (comment)))
650
-
651
- ==============================
652
- comment after custom start
653
- ==============================
654
-
655
- 1970-01-01 custom "test" Assets:Checking "account number changed due to merger" ; Blah
656
- new-account-number: "123456789"
657
- old-account-number: "12345"
658
-
659
- ---
660
-
661
- (file
662
- (custom
663
- (date)
664
- (string)
665
- (custom_value
666
- (account))
667
- (custom_value
668
- (string))
669
- (comment)
670
- (key_value
671
- (key)
672
- (value
673
- (string)))
674
- (key_value
675
- (key)
676
- (value
677
- (string)))))
678
-
679
- ====================================
680
- comment in custom key value list
681
- ====================================
682
-
683
- 1970-01-01 custom "test" Assets:Checking "account number changed due to merger"
684
- ; Blah
685
- new-account-number: "123456789"
686
- ; Blah
687
- old-account-number: "12345"
688
-
689
- ---
690
-
691
- (file
692
- (custom
693
- (date)
694
- (string)
695
- (custom_value
696
- (account))
697
- (custom_value
698
- (string))
699
- (comment)
700
- (key_value
701
- (key)
702
- (value
703
- (string)))
704
- (comment)
705
- (key_value
706
- (key)
707
- (value
708
- (string)))))
709
-
710
- ==============================
711
- comment after document start
712
- ==============================
713
-
714
- 1970-01-01 document Assets:Checking "docs/notice.pdf" ; Blah
715
- new-account-number: "123456789"
716
- old-account-number: "12345"
717
-
718
- ---
719
-
720
- (file
721
- (document
722
- (date)
723
- (account)
724
- (filename
725
- (string))
726
- (comment)
727
- (key_value
728
- (key)
729
- (value
730
- (string)))
731
- (key_value
732
- (key)
733
- (value
734
- (string)))))
735
-
736
- ====================================
737
- comment in document key value list
738
- ====================================
739
-
740
- 1970-01-01 document Assets:Checking "docs/notice.pdf"
741
- ; Blah
742
- new-account-number: "123456789"
743
- ; Blah
744
- old-account-number: "12345"
745
-
746
- ---
747
-
748
- (file
749
- (document
750
- (date)
751
- (account)
752
- (filename
753
- (string))
754
- (comment)
755
- (key_value
756
- (key)
757
- (value
758
- (string)))
759
- (comment)
760
- (key_value
761
- (key)
762
- (value
763
- (string)))))
764
-
765
- ==============================
766
- comment after event start
767
- ==============================
768
-
769
- 1970-01-01 event "location" "test" ; Blah
770
- reason: "12345"
771
-
772
- ---
773
-
774
- (file
775
- (event
776
- (date)
777
- (string)
778
- (string)
779
- (comment)
780
- (key_value
781
- (key)
782
- (value
783
- (string)))))
784
-
785
- ====================================
786
- comment in event key value list
787
- ====================================
788
-
789
- 1970-01-01 event "location" "test"
790
- ; Blah
791
- reason: "12345"
792
- ; Blah
793
-
794
- ---
795
-
796
- (file
797
- (event
798
- (date)
799
- (string)
800
- (string)
801
- (comment)
802
- (key_value
803
- (key)
804
- (value
805
- (string)))
806
- (comment)))
807
-
808
- ==============================
809
- comment after note start
810
- ==============================
811
-
812
- 1970-01-01 note Assets:Checking "account number changed due to merger" ; Blah
813
- new-account-number: "123456789"
814
- old-account-number: "12345"
815
-
816
- ---
817
-
818
- (file
819
- (note
820
- (date)
821
- (account)
822
- (string)
823
- (comment)
824
- (key_value
825
- (key)
826
- (value
827
- (string)))
828
- (key_value
829
- (key)
830
- (value
831
- (string)))))
832
-
833
- ====================================
834
- comment in note key value list
835
- ====================================
836
-
837
- 1970-01-01 note Assets:Checking "account number changed due to merger"
838
- ; Blah
839
- new-account-number: "123456789"
840
- ; Blah
841
- old-account-number: "12345"
842
-
843
- ---
844
-
845
- (file
846
- (note
847
- (date)
848
- (account)
849
- (string)
850
- (comment)
851
- (key_value
852
- (key)
853
- (value
854
- (string)))
855
- (comment)
856
- (key_value
857
- (key)
858
- (value
859
- (string)))))
860
-
861
- ==============================
862
- comment after pad start
863
- ==============================
864
-
865
- 1970-01-01 pad Assets:Checking Equity:Opening-Balances ; Blah
866
- reason: "12345"
867
-
868
- ---
869
-
870
- (file
871
- (pad
872
- (date)
873
- (account)
874
- (account)
875
- (comment)
876
- (key_value
877
- (key)
878
- (value
879
- (string)))))
880
-
881
- ====================================
882
- comment in pad key value list
883
- ====================================
884
-
885
- 1970-01-01 pad Assets:Checking Equity:Opening-Balances
886
- ; Blah
887
- reason: "12345"
888
- ; Blah
889
-
890
- ---
891
-
892
- (file
893
- (pad
894
- (date)
895
- (account)
896
- (account)
897
- (comment)
898
- (key_value
899
- (key)
900
- (value
901
- (string)))
902
- (comment)))
903
-
904
- ==============================
905
- comment after price start
906
- ==============================
907
-
908
- 1970-01-01 price EUR 1.10 USD ; Blah
909
- import-date: 2023-05-01
910
-
911
- ---
912
-
913
- (file
914
- (price
915
- (date)
916
- (currency)
917
- (amount
918
- (number)
919
- (currency))
920
- (comment)
921
- (key_value
922
- (key)
923
- (value
924
- (date)))))
925
-
926
- ====================================
927
- comment in price key value list
928
- ====================================
929
-
930
- 1970-01-01 price EUR 1.10 USD
931
- ; Blah
932
- import-date: 2023-05-01
933
- ; Blah
934
-
935
- ---
936
-
937
- (file
938
- (price
939
- (date)
940
- (currency)
941
- (amount
942
- (number)
943
- (currency))
944
- (comment)
945
- (key_value
946
- (key)
947
- (value
948
- (date)))
949
- (comment)))
950
-
951
- ==============================
952
- comment after query start
953
- ==============================
954
-
955
- 1970-01-01 query "balances" "BALANCES" ; Blah
956
- last-update: 2023-05-01
957
-
958
- ---
959
-
960
- (file
961
- (query
962
- (date)
963
- (string)
964
- (string)
965
- (comment)
966
- (key_value
967
- (key)
968
- (value
969
- (date)))))
970
-
971
- ====================================
972
- comment in query key value list
973
- ====================================
974
-
975
- 1970-01-01 query "balances" "BALANCES"
976
- ; Blah
977
- last-update: 2023-05-01
978
- ; Blah
979
-
980
- ---
981
-
982
- (file
983
- (query
984
- (date)
985
- (string)
986
- (string)
987
- (comment)
988
- (key_value
989
- (key)
990
- (value
991
- (date)))
992
- (comment)))