tree-sitter-beancount 2.3.3 → 2.4.1
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/README.md +334 -4
- package/binding.gyp +17 -7
- package/bindings/node/binding.cc +14 -22
- package/bindings/node/index.d.ts +28 -0
- package/bindings/node/index.js +3 -15
- package/grammar.js +38 -125
- package/package.json +35 -5
- package/prebuilds/darwin-arm64/tree-sitter-beancount.node +0 -0
- package/prebuilds/darwin-x64/tree-sitter-beancount.node +0 -0
- package/prebuilds/linux-arm64/tree-sitter-beancount.node +0 -0
- package/prebuilds/linux-x64/tree-sitter-beancount.node +0 -0
- package/prebuilds/win32-arm64/tree-sitter-beancount.node +0 -0
- package/prebuilds/win32-x64/tree-sitter-beancount.node +0 -0
- package/src/grammar.json +149 -560
- package/src/node-types.json +10 -11
- package/src/parser.c +7615 -9089
- package/src/scanner.c +345 -67
- package/src/tree_sitter/alloc.h +54 -0
- package/src/tree_sitter/array.h +291 -0
- package/src/tree_sitter/parser.h +68 -12
- package/.clang-format +0 -20
- package/.envrc +0 -1
- package/.gitattributes +0 -6
- package/.github/dependabot.yml +0 -26
- package/.github/workflows/cicd.yml +0 -30
- package/.github/workflows/release.yml +0 -72
- package/CHANGELOG.md +0 -80
- package/Cargo.lock +0 -71
- package/Cargo.toml +0 -26
- package/Package.swift +0 -20
- package/bindings/rust/build.rs +0 -39
- package/bindings/rust/lib.rs +0 -52
- package/flake.lock +0 -141
- package/flake.nix +0 -120
- package/test/corpus/arithmetic.txt +0 -373
- package/test/corpus/comment.txt +0 -992
- package/test/corpus/currencies.txt +0 -66
- package/test/corpus/entry_types.txt +0 -389
- package/test/corpus/markdown_orgmode.txt +0 -60
- package/test/corpus/metadata.txt +0 -414
- package/test/corpus/multi_line.txt +0 -27
- package/test/corpus/orgmode_sections.txt +0 -53
- package/test/corpus/parse_lots.txt +0 -417
- package/test/corpus/parser_include.txt +0 -23
- package/test/corpus/parser_links.txt +0 -32
- package/test/corpus/parser_options.txt +0 -39
- package/test/corpus/parser_plugin.txt +0 -35
- package/test/corpus/push_pop_meta.txt +0 -34
- package/test/corpus/push_pop_tag.txt +0 -23
- package/test/corpus/transaction.txt +0 -224
- package/test/corpus/ugly_bugs.txt +0 -91
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
=================
|
|
2
|
-
parse currencies
|
|
3
|
-
=================
|
|
4
|
-
|
|
5
|
-
2014-01-19 open Assets:Underscore DJ_EURO
|
|
6
|
-
2014-01-19 open Assets:Period DJ.EURO
|
|
7
|
-
2014-01-19 open Assets:Apostrophe DJ'EURO
|
|
8
|
-
2014-01-19 open Assets:Numbers EURO123
|
|
9
|
-
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
(file
|
|
13
|
-
(open
|
|
14
|
-
(date)
|
|
15
|
-
(account)
|
|
16
|
-
(currency)
|
|
17
|
-
)
|
|
18
|
-
(open
|
|
19
|
-
(date)
|
|
20
|
-
(account)
|
|
21
|
-
(currency)
|
|
22
|
-
)
|
|
23
|
-
(open
|
|
24
|
-
(date)
|
|
25
|
-
(account)
|
|
26
|
-
(currency)
|
|
27
|
-
)
|
|
28
|
-
(open
|
|
29
|
-
(date)
|
|
30
|
-
(account)
|
|
31
|
-
(currency)
|
|
32
|
-
)
|
|
33
|
-
)
|
|
34
|
-
|
|
35
|
-
================================
|
|
36
|
-
different cost and price currency
|
|
37
|
-
================================
|
|
38
|
-
|
|
39
|
-
2018-03-21 * "Convert MR to KrisFlyer"
|
|
40
|
-
Assets:Test -100 MR {0.0075 USD} @ 1 KRISFLYER
|
|
41
|
-
Assets:Krisflyer 100 KRISFLYER
|
|
42
|
-
|
|
43
|
-
---
|
|
44
|
-
|
|
45
|
-
(file
|
|
46
|
-
(transaction
|
|
47
|
-
(date)
|
|
48
|
-
(txn)
|
|
49
|
-
(narration)
|
|
50
|
-
(posting
|
|
51
|
-
(account)
|
|
52
|
-
(incomplete_amount (unary_number_expr (minus) (number)) (currency))
|
|
53
|
-
(cost_spec
|
|
54
|
-
(cost_comp (compound_amount (number) (currency)))
|
|
55
|
-
)
|
|
56
|
-
(at)
|
|
57
|
-
(price_annotation
|
|
58
|
-
(incomplete_amount (number) (currency))
|
|
59
|
-
)
|
|
60
|
-
)
|
|
61
|
-
(posting
|
|
62
|
-
(account)
|
|
63
|
-
(incomplete_amount (number) (currency))
|
|
64
|
-
)
|
|
65
|
-
)
|
|
66
|
-
)
|
|
@@ -1,389 +0,0 @@
|
|
|
1
|
-
=============================
|
|
2
|
-
entry transaction one string
|
|
3
|
-
=============================
|
|
4
|
-
|
|
5
|
-
2013-05-18 * "Nice dinner at Mermaid Inn"
|
|
6
|
-
Expenses:Restaurant 100 USD
|
|
7
|
-
Assets:US:Cash -100 USD
|
|
8
|
-
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
(file
|
|
12
|
-
(transaction
|
|
13
|
-
(date)
|
|
14
|
-
(txn)
|
|
15
|
-
(narration)
|
|
16
|
-
(posting
|
|
17
|
-
(account)
|
|
18
|
-
(incomplete_amount
|
|
19
|
-
(number)
|
|
20
|
-
(currency)
|
|
21
|
-
)
|
|
22
|
-
)
|
|
23
|
-
(posting
|
|
24
|
-
(account)
|
|
25
|
-
(incomplete_amount
|
|
26
|
-
(unary_number_expr
|
|
27
|
-
(minus) (number)
|
|
28
|
-
)
|
|
29
|
-
(currency)
|
|
30
|
-
)
|
|
31
|
-
)
|
|
32
|
-
)
|
|
33
|
-
)
|
|
34
|
-
|
|
35
|
-
=============================
|
|
36
|
-
entry transaction two string
|
|
37
|
-
=============================
|
|
38
|
-
|
|
39
|
-
2013-05-18 * "Mermaid Inn" "Nice dinner"
|
|
40
|
-
Expenses:Restaurant 100 USD
|
|
41
|
-
Assets:US:Cash -100 USD
|
|
42
|
-
|
|
43
|
-
---
|
|
44
|
-
|
|
45
|
-
(file
|
|
46
|
-
(transaction
|
|
47
|
-
(date)
|
|
48
|
-
(txn)
|
|
49
|
-
(payee)
|
|
50
|
-
(narration)
|
|
51
|
-
(posting
|
|
52
|
-
(account)
|
|
53
|
-
(incomplete_amount
|
|
54
|
-
(number)
|
|
55
|
-
(currency)
|
|
56
|
-
)
|
|
57
|
-
)
|
|
58
|
-
(posting
|
|
59
|
-
(account)
|
|
60
|
-
(incomplete_amount
|
|
61
|
-
(unary_number_expr
|
|
62
|
-
(minus) (number)
|
|
63
|
-
)
|
|
64
|
-
(currency)
|
|
65
|
-
)
|
|
66
|
-
)
|
|
67
|
-
)
|
|
68
|
-
)
|
|
69
|
-
|
|
70
|
-
===================================
|
|
71
|
-
entry transaction with txn keyword
|
|
72
|
-
===================================
|
|
73
|
-
|
|
74
|
-
2013-05-18 txn "Nice dinner at Mermaid Inn"
|
|
75
|
-
Expenses:Restaurant 100 USD
|
|
76
|
-
Assets:US:Cash -100 USD
|
|
77
|
-
|
|
78
|
-
---
|
|
79
|
-
|
|
80
|
-
(file
|
|
81
|
-
(transaction
|
|
82
|
-
(date)
|
|
83
|
-
(txn)
|
|
84
|
-
(narration)
|
|
85
|
-
(posting
|
|
86
|
-
(account)
|
|
87
|
-
(incomplete_amount
|
|
88
|
-
(number)
|
|
89
|
-
(currency)
|
|
90
|
-
)
|
|
91
|
-
)
|
|
92
|
-
(posting
|
|
93
|
-
(account)
|
|
94
|
-
(incomplete_amount
|
|
95
|
-
(unary_number_expr
|
|
96
|
-
(minus) (number)
|
|
97
|
-
)
|
|
98
|
-
(currency)
|
|
99
|
-
)
|
|
100
|
-
)
|
|
101
|
-
)
|
|
102
|
-
)
|
|
103
|
-
|
|
104
|
-
==============
|
|
105
|
-
entry balance
|
|
106
|
-
==============
|
|
107
|
-
|
|
108
|
-
2013-05-18 balance Assets:US:BestBank:Checking 200 USD
|
|
109
|
-
|
|
110
|
-
---
|
|
111
|
-
|
|
112
|
-
(file
|
|
113
|
-
(balance
|
|
114
|
-
(date)
|
|
115
|
-
(account)
|
|
116
|
-
(amount_tolerance
|
|
117
|
-
(number)
|
|
118
|
-
(currency)
|
|
119
|
-
)
|
|
120
|
-
)
|
|
121
|
-
)
|
|
122
|
-
|
|
123
|
-
===============
|
|
124
|
-
entry balnce 2
|
|
125
|
-
===============
|
|
126
|
-
|
|
127
|
-
2013-05-18 balance Assets:US:BestBank:Checking 200 ~ 0.002 USD
|
|
128
|
-
|
|
129
|
-
---
|
|
130
|
-
|
|
131
|
-
(file
|
|
132
|
-
(balance
|
|
133
|
-
(date)
|
|
134
|
-
(account)
|
|
135
|
-
(amount_tolerance
|
|
136
|
-
(number)
|
|
137
|
-
(number)
|
|
138
|
-
(currency)
|
|
139
|
-
)
|
|
140
|
-
)
|
|
141
|
-
)
|
|
142
|
-
|
|
143
|
-
===========
|
|
144
|
-
entry open
|
|
145
|
-
===========
|
|
146
|
-
|
|
147
|
-
2013-05-18 open Assets:US:BestBank:Checking
|
|
148
|
-
|
|
149
|
-
---
|
|
150
|
-
|
|
151
|
-
(file
|
|
152
|
-
(open
|
|
153
|
-
(date)
|
|
154
|
-
(account)
|
|
155
|
-
)
|
|
156
|
-
)
|
|
157
|
-
|
|
158
|
-
=============
|
|
159
|
-
entry open 2
|
|
160
|
-
=============
|
|
161
|
-
|
|
162
|
-
2013-05-18 open Assets:US:BestBank:Checking USD
|
|
163
|
-
|
|
164
|
-
---
|
|
165
|
-
|
|
166
|
-
(file
|
|
167
|
-
(open
|
|
168
|
-
(date)
|
|
169
|
-
(account)
|
|
170
|
-
(currency)
|
|
171
|
-
)
|
|
172
|
-
)
|
|
173
|
-
|
|
174
|
-
=============
|
|
175
|
-
entry open 3
|
|
176
|
-
=============
|
|
177
|
-
|
|
178
|
-
2013-05-18 open Assets:Cash USD,CAD,EUR
|
|
179
|
-
|
|
180
|
-
---
|
|
181
|
-
|
|
182
|
-
(file
|
|
183
|
-
(open
|
|
184
|
-
(date)
|
|
185
|
-
(account)
|
|
186
|
-
(currency)
|
|
187
|
-
(currency)
|
|
188
|
-
(currency)
|
|
189
|
-
)
|
|
190
|
-
)
|
|
191
|
-
|
|
192
|
-
=============
|
|
193
|
-
entry open 4
|
|
194
|
-
=============
|
|
195
|
-
|
|
196
|
-
2013-05-18 open Assets:US:Vanguard:VIIPX VIIPX "STRICT"
|
|
197
|
-
|
|
198
|
-
---
|
|
199
|
-
|
|
200
|
-
(file
|
|
201
|
-
(open
|
|
202
|
-
(date)
|
|
203
|
-
(account)
|
|
204
|
-
(currency)
|
|
205
|
-
(opt_booking (string))
|
|
206
|
-
)
|
|
207
|
-
)
|
|
208
|
-
|
|
209
|
-
=============
|
|
210
|
-
entry open 5
|
|
211
|
-
=============
|
|
212
|
-
|
|
213
|
-
2013-05-18 open Assets:US:Vanguard:VIIPX "STRICT"
|
|
214
|
-
|
|
215
|
-
---
|
|
216
|
-
|
|
217
|
-
(file
|
|
218
|
-
(open
|
|
219
|
-
(date)
|
|
220
|
-
(account)
|
|
221
|
-
(opt_booking (string))
|
|
222
|
-
)
|
|
223
|
-
)
|
|
224
|
-
|
|
225
|
-
============
|
|
226
|
-
entry close
|
|
227
|
-
============
|
|
228
|
-
|
|
229
|
-
2013-05-18 close Assets:US:BestBank:Checking
|
|
230
|
-
|
|
231
|
-
---
|
|
232
|
-
|
|
233
|
-
(file
|
|
234
|
-
(close
|
|
235
|
-
(date)
|
|
236
|
-
(account)
|
|
237
|
-
)
|
|
238
|
-
)
|
|
239
|
-
|
|
240
|
-
================
|
|
241
|
-
entry commodity
|
|
242
|
-
================
|
|
243
|
-
|
|
244
|
-
2013-05-18 commodity MSFT
|
|
245
|
-
|
|
246
|
-
---
|
|
247
|
-
|
|
248
|
-
(file
|
|
249
|
-
(commodity
|
|
250
|
-
(date)
|
|
251
|
-
(currency)
|
|
252
|
-
)
|
|
253
|
-
)
|
|
254
|
-
|
|
255
|
-
==========
|
|
256
|
-
entry pad
|
|
257
|
-
==========
|
|
258
|
-
|
|
259
|
-
2013-05-18 pad Assets:US:BestBank:Checking Equity:Opening-Balances
|
|
260
|
-
|
|
261
|
-
---
|
|
262
|
-
|
|
263
|
-
(file
|
|
264
|
-
(pad
|
|
265
|
-
(date)
|
|
266
|
-
(account)
|
|
267
|
-
(account)
|
|
268
|
-
)
|
|
269
|
-
)
|
|
270
|
-
|
|
271
|
-
============
|
|
272
|
-
entry event
|
|
273
|
-
============
|
|
274
|
-
|
|
275
|
-
2013-05-18 event "location" "New York, USA"
|
|
276
|
-
|
|
277
|
-
---
|
|
278
|
-
|
|
279
|
-
(file
|
|
280
|
-
(event
|
|
281
|
-
(date)
|
|
282
|
-
(string)
|
|
283
|
-
(string)
|
|
284
|
-
)
|
|
285
|
-
)
|
|
286
|
-
|
|
287
|
-
==================
|
|
288
|
-
entry event empty
|
|
289
|
-
==================
|
|
290
|
-
|
|
291
|
-
2013-05-18 event "location" ""
|
|
292
|
-
|
|
293
|
-
---
|
|
294
|
-
|
|
295
|
-
(file
|
|
296
|
-
(event
|
|
297
|
-
(date)
|
|
298
|
-
(string)
|
|
299
|
-
(string)
|
|
300
|
-
)
|
|
301
|
-
)
|
|
302
|
-
|
|
303
|
-
============
|
|
304
|
-
entry query
|
|
305
|
-
============
|
|
306
|
-
|
|
307
|
-
2013-05-18 query "cash" "SELECT SUM(position) WHERE currency = 'USD'"
|
|
308
|
-
|
|
309
|
-
---
|
|
310
|
-
|
|
311
|
-
(file
|
|
312
|
-
(query
|
|
313
|
-
(date)
|
|
314
|
-
(string)
|
|
315
|
-
(string)
|
|
316
|
-
)
|
|
317
|
-
)
|
|
318
|
-
|
|
319
|
-
===========
|
|
320
|
-
entry note
|
|
321
|
-
===========
|
|
322
|
-
|
|
323
|
-
2013-05-18 note Assets:US:BestBank:Checking "Blah, di blah."
|
|
324
|
-
|
|
325
|
-
---
|
|
326
|
-
|
|
327
|
-
(file
|
|
328
|
-
(note
|
|
329
|
-
(date)
|
|
330
|
-
(account)
|
|
331
|
-
(string)
|
|
332
|
-
)
|
|
333
|
-
)
|
|
334
|
-
|
|
335
|
-
===============
|
|
336
|
-
entry document
|
|
337
|
-
===============
|
|
338
|
-
|
|
339
|
-
2013-05-18 document Assets:US:BestBank:Checking "/Accounting/statement.pdf"
|
|
340
|
-
|
|
341
|
-
---
|
|
342
|
-
|
|
343
|
-
(file
|
|
344
|
-
(document
|
|
345
|
-
(date)
|
|
346
|
-
(account)
|
|
347
|
-
(filename (string))
|
|
348
|
-
)
|
|
349
|
-
)
|
|
350
|
-
|
|
351
|
-
============
|
|
352
|
-
entry price
|
|
353
|
-
============
|
|
354
|
-
|
|
355
|
-
2013-05-18 price USD 1.0290 CAD
|
|
356
|
-
|
|
357
|
-
---
|
|
358
|
-
|
|
359
|
-
(file
|
|
360
|
-
(price
|
|
361
|
-
(date)
|
|
362
|
-
(currency)
|
|
363
|
-
(amount
|
|
364
|
-
(number)
|
|
365
|
-
(currency)
|
|
366
|
-
)
|
|
367
|
-
)
|
|
368
|
-
)
|
|
369
|
-
|
|
370
|
-
=============
|
|
371
|
-
entry custom
|
|
372
|
-
=============
|
|
373
|
-
|
|
374
|
-
2013-05-18 custom "budget" "weekly < 1000.00 USD" 2016-02-28 TRUE 43.03 USD 23
|
|
375
|
-
|
|
376
|
-
---
|
|
377
|
-
|
|
378
|
-
(file
|
|
379
|
-
(custom
|
|
380
|
-
(date)
|
|
381
|
-
(string)
|
|
382
|
-
(custom_value (string))
|
|
383
|
-
(custom_value (date))
|
|
384
|
-
(custom_value (bool))
|
|
385
|
-
(custom_value (amount (number) (currency)))
|
|
386
|
-
(custom_value (number))
|
|
387
|
-
)
|
|
388
|
-
)
|
|
389
|
-
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
==============
|
|
2
|
-
orgmode heading
|
|
3
|
-
==============
|
|
4
|
-
|
|
5
|
-
* TITLE
|
|
6
|
-
|
|
7
|
-
2014-04-20 * "Money from CC" ^610fa7f17e7a #trip
|
|
8
|
-
Expenses:Restaurant 100 USD
|
|
9
|
-
Assets:US:Cash -100 USD
|
|
10
|
-
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
(file
|
|
14
|
-
(section (headline (item))
|
|
15
|
-
(transaction
|
|
16
|
-
(date)
|
|
17
|
-
(txn)
|
|
18
|
-
(narration)
|
|
19
|
-
(tags_links (link) (tag))
|
|
20
|
-
(posting
|
|
21
|
-
(account)
|
|
22
|
-
(incomplete_amount (number) (currency))
|
|
23
|
-
)
|
|
24
|
-
(posting
|
|
25
|
-
(account)
|
|
26
|
-
(incomplete_amount (unary_number_expr (minus) (number)) (currency))
|
|
27
|
-
)
|
|
28
|
-
)
|
|
29
|
-
)
|
|
30
|
-
)
|
|
31
|
-
|
|
32
|
-
==============
|
|
33
|
-
orgmode subheading
|
|
34
|
-
==============
|
|
35
|
-
|
|
36
|
-
****** TITLE
|
|
37
|
-
2014-04-20 * "Money from CC" ^610fa7f17e7a #trip
|
|
38
|
-
Expenses:Restaurant 100 USD
|
|
39
|
-
Assets:US:Cash -100 USD
|
|
40
|
-
|
|
41
|
-
---
|
|
42
|
-
|
|
43
|
-
(file
|
|
44
|
-
(section (headline (item))
|
|
45
|
-
(transaction
|
|
46
|
-
(date)
|
|
47
|
-
(txn)
|
|
48
|
-
(narration)
|
|
49
|
-
(tags_links (link) (tag))
|
|
50
|
-
(posting
|
|
51
|
-
(account)
|
|
52
|
-
(incomplete_amount (number) (currency))
|
|
53
|
-
)
|
|
54
|
-
(posting
|
|
55
|
-
(account)
|
|
56
|
-
(incomplete_amount (unary_number_expr (minus) (number)) (currency))
|
|
57
|
-
)
|
|
58
|
-
)
|
|
59
|
-
)
|
|
60
|
-
)
|