tree-sitter-beancount 2.1.0 → 2.1.2
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.
- package/.github/workflows/release.yml +2 -2
- package/CHANGELOG.md +17 -1
- package/Cargo.lock +59 -0
- package/Cargo.toml +1 -1
- package/README.md +5 -1
- package/bindings/rust/build.rs +0 -2
- package/grammar.js +130 -150
- package/package.json +1 -1
- package/src/grammar.json +257 -591
- package/src/node-types.json +276 -393
- package/src/parser.c +10783 -9798
- package/test/corpus/arithmetic.txt +21 -44
- package/test/corpus/comment.txt +5 -15
- package/test/corpus/currencies.txt +6 -12
- package/test/corpus/entry_types.txt +7 -20
- package/test/corpus/markdown_orgmode.txt +4 -8
- package/test/corpus/metadata.txt +76 -93
- package/test/corpus/multi_line.txt +2 -4
- package/test/corpus/parse_lots.txt +16 -110
- package/test/corpus/parser_links.txt +2 -4
- package/test/corpus/push_pop_meta.txt +3 -5
- package/test/corpus/transaction.txt +24 -46
- package/test/corpus/ugly_bugs.txt +2 -4
|
@@ -11,9 +11,8 @@ expr add
|
|
|
11
11
|
(file
|
|
12
12
|
(transaction
|
|
13
13
|
(date)
|
|
14
|
-
(txn
|
|
15
|
-
(
|
|
16
|
-
(posting_or_kv_list
|
|
14
|
+
(txn)
|
|
15
|
+
(narration)
|
|
17
16
|
(posting
|
|
18
17
|
(account)
|
|
19
18
|
(incomplete_amount
|
|
@@ -28,7 +27,6 @@ expr add
|
|
|
28
27
|
(currency)
|
|
29
28
|
)
|
|
30
29
|
)
|
|
31
|
-
)
|
|
32
30
|
)
|
|
33
31
|
)
|
|
34
32
|
|
|
@@ -45,9 +43,8 @@ expr sub
|
|
|
45
43
|
(file
|
|
46
44
|
(transaction
|
|
47
45
|
(date)
|
|
48
|
-
(txn
|
|
49
|
-
(
|
|
50
|
-
(posting_or_kv_list
|
|
46
|
+
(txn)
|
|
47
|
+
(narration)
|
|
51
48
|
(posting
|
|
52
49
|
(account)
|
|
53
50
|
(incomplete_amount
|
|
@@ -62,7 +59,6 @@ expr sub
|
|
|
62
59
|
(currency)
|
|
63
60
|
)
|
|
64
61
|
)
|
|
65
|
-
)
|
|
66
62
|
)
|
|
67
63
|
)
|
|
68
64
|
|
|
@@ -79,9 +75,8 @@ expr mult
|
|
|
79
75
|
(file
|
|
80
76
|
(transaction
|
|
81
77
|
(date)
|
|
82
|
-
(txn
|
|
83
|
-
(
|
|
84
|
-
(posting_or_kv_list
|
|
78
|
+
(txn)
|
|
79
|
+
(narration)
|
|
85
80
|
(posting
|
|
86
81
|
(account)
|
|
87
82
|
(incomplete_amount
|
|
@@ -96,7 +91,6 @@ expr mult
|
|
|
96
91
|
(currency)
|
|
97
92
|
)
|
|
98
93
|
)
|
|
99
|
-
)
|
|
100
94
|
)
|
|
101
95
|
)
|
|
102
96
|
|
|
@@ -113,9 +107,8 @@ expr div
|
|
|
113
107
|
(file
|
|
114
108
|
(transaction
|
|
115
109
|
(date)
|
|
116
|
-
(txn
|
|
117
|
-
(
|
|
118
|
-
(posting_or_kv_list
|
|
110
|
+
(txn)
|
|
111
|
+
(narration)
|
|
119
112
|
(posting
|
|
120
113
|
(account)
|
|
121
114
|
(incomplete_amount
|
|
@@ -130,7 +123,6 @@ expr div
|
|
|
130
123
|
(currency)
|
|
131
124
|
)
|
|
132
125
|
)
|
|
133
|
-
)
|
|
134
126
|
)
|
|
135
127
|
)
|
|
136
128
|
|
|
@@ -148,9 +140,8 @@ expr neg
|
|
|
148
140
|
(file
|
|
149
141
|
(transaction
|
|
150
142
|
(date)
|
|
151
|
-
(txn
|
|
152
|
-
(
|
|
153
|
-
(posting_or_kv_list
|
|
143
|
+
(txn)
|
|
144
|
+
(narration)
|
|
154
145
|
(posting
|
|
155
146
|
(account)
|
|
156
147
|
(incomplete_amount
|
|
@@ -172,7 +163,6 @@ expr neg
|
|
|
172
163
|
(currency)
|
|
173
164
|
)
|
|
174
165
|
)
|
|
175
|
-
)
|
|
176
166
|
)
|
|
177
167
|
)
|
|
178
168
|
|
|
@@ -189,9 +179,8 @@ expr pos
|
|
|
189
179
|
(file
|
|
190
180
|
(transaction
|
|
191
181
|
(date)
|
|
192
|
-
(txn
|
|
193
|
-
(
|
|
194
|
-
(posting_or_kv_list
|
|
182
|
+
(txn)
|
|
183
|
+
(narration)
|
|
195
184
|
(posting
|
|
196
185
|
(account)
|
|
197
186
|
(incomplete_amount
|
|
@@ -206,7 +195,6 @@ expr pos
|
|
|
206
195
|
(currency)
|
|
207
196
|
)
|
|
208
197
|
)
|
|
209
|
-
)
|
|
210
198
|
)
|
|
211
199
|
)
|
|
212
200
|
|
|
@@ -225,9 +213,8 @@ expr predence
|
|
|
225
213
|
(file
|
|
226
214
|
(transaction
|
|
227
215
|
(date)
|
|
228
|
-
(txn
|
|
229
|
-
(
|
|
230
|
-
(posting_or_kv_list
|
|
216
|
+
(txn)
|
|
217
|
+
(narration)
|
|
231
218
|
(posting
|
|
232
219
|
(account)
|
|
233
220
|
(incomplete_amount
|
|
@@ -272,7 +259,6 @@ expr predence
|
|
|
272
259
|
(currency)
|
|
273
260
|
)
|
|
274
261
|
)
|
|
275
|
-
)
|
|
276
262
|
)
|
|
277
263
|
)
|
|
278
264
|
|
|
@@ -289,9 +275,8 @@ expr groups
|
|
|
289
275
|
(file
|
|
290
276
|
(transaction
|
|
291
277
|
(date)
|
|
292
|
-
(txn
|
|
293
|
-
(
|
|
294
|
-
(posting_or_kv_list
|
|
278
|
+
(txn)
|
|
279
|
+
(narration)
|
|
295
280
|
(posting
|
|
296
281
|
(account)
|
|
297
282
|
(incomplete_amount
|
|
@@ -314,7 +299,6 @@ expr groups
|
|
|
314
299
|
(currency)
|
|
315
300
|
)
|
|
316
301
|
)
|
|
317
|
-
)
|
|
318
302
|
)
|
|
319
303
|
)
|
|
320
304
|
|
|
@@ -334,9 +318,8 @@ expr different places
|
|
|
334
318
|
(file
|
|
335
319
|
(transaction
|
|
336
320
|
(date)
|
|
337
|
-
(txn
|
|
338
|
-
(
|
|
339
|
-
(posting_or_kv_list
|
|
321
|
+
(txn)
|
|
322
|
+
(narration)
|
|
340
323
|
(posting
|
|
341
324
|
(account)
|
|
342
325
|
(incomplete_amount
|
|
@@ -344,16 +327,12 @@ expr different places
|
|
|
344
327
|
(currency)
|
|
345
328
|
)
|
|
346
329
|
(cost_spec
|
|
347
|
-
(lcurl)
|
|
348
|
-
(cost_comp_list
|
|
349
330
|
(cost_comp
|
|
350
331
|
(compound_amount
|
|
351
332
|
(binary_number_expr (number) (asterisk) (number))
|
|
352
333
|
(currency)
|
|
353
334
|
)
|
|
354
335
|
)
|
|
355
|
-
)
|
|
356
|
-
(rcurl)
|
|
357
336
|
)
|
|
358
337
|
(at)
|
|
359
338
|
(price_annotation
|
|
@@ -368,7 +347,6 @@ expr different places
|
|
|
368
347
|
(incomplete_amount (number) (currency))
|
|
369
348
|
(comment)
|
|
370
349
|
)
|
|
371
|
-
)
|
|
372
350
|
)
|
|
373
351
|
(balance
|
|
374
352
|
(date)
|
|
@@ -385,12 +363,11 @@ expr different places
|
|
|
385
363
|
)
|
|
386
364
|
(currency)
|
|
387
365
|
)
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
(
|
|
366
|
+
(key_value
|
|
367
|
+
(key)
|
|
368
|
+
(value
|
|
391
369
|
(unary_number_expr (minus) (binary_number_expr (number) (plus) (number)))
|
|
392
370
|
)
|
|
393
371
|
)
|
|
394
|
-
)
|
|
395
372
|
)
|
|
396
373
|
)
|
package/test/corpus/comment.txt
CHANGED
|
@@ -23,8 +23,7 @@ comment before transaction
|
|
|
23
23
|
(comment)
|
|
24
24
|
(transaction
|
|
25
25
|
(date)
|
|
26
|
-
(txn
|
|
27
|
-
(posting_or_kv_list
|
|
26
|
+
(txn)
|
|
28
27
|
(posting
|
|
29
28
|
(account)
|
|
30
29
|
(incomplete_amount
|
|
@@ -39,7 +38,6 @@ comment before transaction
|
|
|
39
38
|
(currency)
|
|
40
39
|
)
|
|
41
40
|
)
|
|
42
|
-
)
|
|
43
41
|
)
|
|
44
42
|
)
|
|
45
43
|
|
|
@@ -57,8 +55,7 @@ comment after transaction
|
|
|
57
55
|
(file
|
|
58
56
|
(transaction
|
|
59
57
|
(date)
|
|
60
|
-
(txn
|
|
61
|
-
(posting_or_kv_list
|
|
58
|
+
(txn)
|
|
62
59
|
(posting
|
|
63
60
|
(account)
|
|
64
61
|
(incomplete_amount
|
|
@@ -74,7 +71,6 @@ comment after transaction
|
|
|
74
71
|
)
|
|
75
72
|
)
|
|
76
73
|
(comment)
|
|
77
|
-
)
|
|
78
74
|
)
|
|
79
75
|
)
|
|
80
76
|
|
|
@@ -92,8 +88,7 @@ comment between posting
|
|
|
92
88
|
(file
|
|
93
89
|
(transaction
|
|
94
90
|
(date)
|
|
95
|
-
(txn
|
|
96
|
-
(posting_or_kv_list
|
|
91
|
+
(txn)
|
|
97
92
|
(posting
|
|
98
93
|
(account)
|
|
99
94
|
(incomplete_amount
|
|
@@ -109,7 +104,6 @@ comment between posting
|
|
|
109
104
|
(currency)
|
|
110
105
|
)
|
|
111
106
|
)
|
|
112
|
-
)
|
|
113
107
|
)
|
|
114
108
|
)
|
|
115
109
|
|
|
@@ -126,8 +120,7 @@ comment after posting
|
|
|
126
120
|
(file
|
|
127
121
|
(transaction
|
|
128
122
|
(date)
|
|
129
|
-
(txn
|
|
130
|
-
(posting_or_kv_list
|
|
123
|
+
(txn)
|
|
131
124
|
(posting
|
|
132
125
|
(account)
|
|
133
126
|
(incomplete_amount
|
|
@@ -143,7 +136,6 @@ comment after posting
|
|
|
143
136
|
(currency)
|
|
144
137
|
)
|
|
145
138
|
)
|
|
146
|
-
)
|
|
147
139
|
)
|
|
148
140
|
)
|
|
149
141
|
|
|
@@ -160,9 +152,8 @@ comment after transaction start
|
|
|
160
152
|
(file
|
|
161
153
|
(transaction
|
|
162
154
|
(date)
|
|
163
|
-
(txn
|
|
155
|
+
(txn)
|
|
164
156
|
(comment)
|
|
165
|
-
(posting_or_kv_list
|
|
166
157
|
(posting
|
|
167
158
|
(account)
|
|
168
159
|
(incomplete_amount
|
|
@@ -177,6 +168,5 @@ comment after transaction start
|
|
|
177
168
|
(currency)
|
|
178
169
|
)
|
|
179
170
|
)
|
|
180
|
-
)
|
|
181
171
|
)
|
|
182
172
|
)
|
|
@@ -13,22 +13,22 @@ parse currencies
|
|
|
13
13
|
(open
|
|
14
14
|
(date)
|
|
15
15
|
(account)
|
|
16
|
-
(
|
|
16
|
+
(currency)
|
|
17
17
|
)
|
|
18
18
|
(open
|
|
19
19
|
(date)
|
|
20
20
|
(account)
|
|
21
|
-
(
|
|
21
|
+
(currency)
|
|
22
22
|
)
|
|
23
23
|
(open
|
|
24
24
|
(date)
|
|
25
25
|
(account)
|
|
26
|
-
(
|
|
26
|
+
(currency)
|
|
27
27
|
)
|
|
28
28
|
(open
|
|
29
29
|
(date)
|
|
30
30
|
(account)
|
|
31
|
-
(
|
|
31
|
+
(currency)
|
|
32
32
|
)
|
|
33
33
|
)
|
|
34
34
|
|
|
@@ -45,18 +45,13 @@ different cost and price currency
|
|
|
45
45
|
(file
|
|
46
46
|
(transaction
|
|
47
47
|
(date)
|
|
48
|
-
(txn
|
|
49
|
-
(
|
|
50
|
-
(posting_or_kv_list
|
|
48
|
+
(txn)
|
|
49
|
+
(narration)
|
|
51
50
|
(posting
|
|
52
51
|
(account)
|
|
53
52
|
(incomplete_amount (unary_number_expr (minus) (number)) (currency))
|
|
54
53
|
(cost_spec
|
|
55
|
-
(lcurl)
|
|
56
|
-
(cost_comp_list
|
|
57
54
|
(cost_comp (compound_amount (number) (currency)))
|
|
58
|
-
)
|
|
59
|
-
(rcurl)
|
|
60
55
|
)
|
|
61
56
|
(at)
|
|
62
57
|
(price_annotation
|
|
@@ -67,6 +62,5 @@ different cost and price currency
|
|
|
67
62
|
(account)
|
|
68
63
|
(incomplete_amount (number) (currency))
|
|
69
64
|
)
|
|
70
|
-
)
|
|
71
65
|
)
|
|
72
66
|
)
|
|
@@ -11,9 +11,8 @@ entry transaction one string
|
|
|
11
11
|
(file
|
|
12
12
|
(transaction
|
|
13
13
|
(date)
|
|
14
|
-
(txn
|
|
15
|
-
(
|
|
16
|
-
(posting_or_kv_list
|
|
14
|
+
(txn)
|
|
15
|
+
(narration)
|
|
17
16
|
(posting
|
|
18
17
|
(account)
|
|
19
18
|
(incomplete_amount
|
|
@@ -30,7 +29,6 @@ entry transaction one string
|
|
|
30
29
|
(currency)
|
|
31
30
|
)
|
|
32
31
|
)
|
|
33
|
-
)
|
|
34
32
|
)
|
|
35
33
|
)
|
|
36
34
|
|
|
@@ -47,9 +45,9 @@ entry transaction two string
|
|
|
47
45
|
(file
|
|
48
46
|
(transaction
|
|
49
47
|
(date)
|
|
50
|
-
(txn
|
|
51
|
-
(
|
|
52
|
-
(
|
|
48
|
+
(txn)
|
|
49
|
+
(payee)
|
|
50
|
+
(narration)
|
|
53
51
|
(posting
|
|
54
52
|
(account)
|
|
55
53
|
(incomplete_amount
|
|
@@ -66,7 +64,6 @@ entry transaction two string
|
|
|
66
64
|
(currency)
|
|
67
65
|
)
|
|
68
66
|
)
|
|
69
|
-
)
|
|
70
67
|
)
|
|
71
68
|
)
|
|
72
69
|
|
|
@@ -83,9 +80,8 @@ entry transaction with txn keyword
|
|
|
83
80
|
(file
|
|
84
81
|
(transaction
|
|
85
82
|
(date)
|
|
86
|
-
(txn
|
|
87
|
-
(
|
|
88
|
-
(posting_or_kv_list
|
|
83
|
+
(txn)
|
|
84
|
+
(narration)
|
|
89
85
|
(posting
|
|
90
86
|
(account)
|
|
91
87
|
(incomplete_amount
|
|
@@ -102,7 +98,6 @@ entry transaction with txn keyword
|
|
|
102
98
|
(currency)
|
|
103
99
|
)
|
|
104
100
|
)
|
|
105
|
-
)
|
|
106
101
|
)
|
|
107
102
|
)
|
|
108
103
|
|
|
@@ -172,9 +167,7 @@ entry open 2
|
|
|
172
167
|
(open
|
|
173
168
|
(date)
|
|
174
169
|
(account)
|
|
175
|
-
(currency_list
|
|
176
170
|
(currency)
|
|
177
|
-
)
|
|
178
171
|
)
|
|
179
172
|
)
|
|
180
173
|
|
|
@@ -190,11 +183,9 @@ entry open 3
|
|
|
190
183
|
(open
|
|
191
184
|
(date)
|
|
192
185
|
(account)
|
|
193
|
-
(currency_list
|
|
194
186
|
(currency)
|
|
195
187
|
(currency)
|
|
196
188
|
(currency)
|
|
197
|
-
)
|
|
198
189
|
)
|
|
199
190
|
)
|
|
200
191
|
|
|
@@ -210,9 +201,7 @@ entry open 4
|
|
|
210
201
|
(open
|
|
211
202
|
(date)
|
|
212
203
|
(account)
|
|
213
|
-
(currency_list
|
|
214
204
|
(currency)
|
|
215
|
-
)
|
|
216
205
|
(opt_booking (string))
|
|
217
206
|
)
|
|
218
207
|
)
|
|
@@ -390,13 +379,11 @@ entry custom
|
|
|
390
379
|
(custom
|
|
391
380
|
(date)
|
|
392
381
|
(string)
|
|
393
|
-
(custom_value_list
|
|
394
382
|
(custom_value (string))
|
|
395
383
|
(custom_value (date))
|
|
396
384
|
(custom_value (bool))
|
|
397
385
|
(custom_value (amount (number) (currency)))
|
|
398
386
|
(custom_value (number))
|
|
399
|
-
)
|
|
400
387
|
)
|
|
401
388
|
)
|
|
402
389
|
|
|
@@ -14,10 +14,9 @@ orgmode heading
|
|
|
14
14
|
(section (headline (item))
|
|
15
15
|
(transaction
|
|
16
16
|
(date)
|
|
17
|
-
(txn
|
|
18
|
-
(
|
|
17
|
+
(txn)
|
|
18
|
+
(narration)
|
|
19
19
|
(tags_links (link) (tag))
|
|
20
|
-
(posting_or_kv_list
|
|
21
20
|
(posting
|
|
22
21
|
(account)
|
|
23
22
|
(incomplete_amount (number) (currency))
|
|
@@ -26,7 +25,6 @@ orgmode heading
|
|
|
26
25
|
(account)
|
|
27
26
|
(incomplete_amount (unary_number_expr (minus) (number)) (currency))
|
|
28
27
|
)
|
|
29
|
-
)
|
|
30
28
|
)
|
|
31
29
|
)
|
|
32
30
|
)
|
|
@@ -46,10 +44,9 @@ orgmode subheading
|
|
|
46
44
|
(section (headline (item))
|
|
47
45
|
(transaction
|
|
48
46
|
(date)
|
|
49
|
-
(txn
|
|
50
|
-
(
|
|
47
|
+
(txn)
|
|
48
|
+
(narration)
|
|
51
49
|
(tags_links (link) (tag))
|
|
52
|
-
(posting_or_kv_list
|
|
53
50
|
(posting
|
|
54
51
|
(account)
|
|
55
52
|
(incomplete_amount (number) (currency))
|
|
@@ -58,7 +55,6 @@ orgmode subheading
|
|
|
58
55
|
(account)
|
|
59
56
|
(incomplete_amount (unary_number_expr (minus) (number)) (currency))
|
|
60
57
|
)
|
|
61
|
-
)
|
|
62
58
|
)
|
|
63
59
|
)
|
|
64
60
|
)
|