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
package/test/corpus/metadata.txt
DELETED
|
@@ -1,414 +0,0 @@
|
|
|
1
|
-
===============
|
|
2
|
-
metadata begin
|
|
3
|
-
===============
|
|
4
|
-
|
|
5
|
-
2013-05-18 * ""
|
|
6
|
-
test: "Something"
|
|
7
|
-
Assets:Investments:MSFT 10 MSFT @@ 2000 USD
|
|
8
|
-
Assets:Investments:Cash -20000 USD
|
|
9
|
-
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
(file
|
|
13
|
-
(transaction
|
|
14
|
-
(date)
|
|
15
|
-
(txn)
|
|
16
|
-
(narration)
|
|
17
|
-
(key_value
|
|
18
|
-
(key)
|
|
19
|
-
(value (string))
|
|
20
|
-
)
|
|
21
|
-
(posting
|
|
22
|
-
(account)
|
|
23
|
-
(incomplete_amount
|
|
24
|
-
(number)
|
|
25
|
-
(currency)
|
|
26
|
-
)
|
|
27
|
-
(atat)
|
|
28
|
-
(price_annotation
|
|
29
|
-
(incomplete_amount
|
|
30
|
-
(number)
|
|
31
|
-
(currency)
|
|
32
|
-
)
|
|
33
|
-
)
|
|
34
|
-
)
|
|
35
|
-
(posting
|
|
36
|
-
(account)
|
|
37
|
-
(incomplete_amount
|
|
38
|
-
(unary_number_expr
|
|
39
|
-
(minus) (number)
|
|
40
|
-
)
|
|
41
|
-
(currency)
|
|
42
|
-
)
|
|
43
|
-
)
|
|
44
|
-
)
|
|
45
|
-
)
|
|
46
|
-
|
|
47
|
-
================
|
|
48
|
-
metadata middle
|
|
49
|
-
================
|
|
50
|
-
|
|
51
|
-
2013-05-18 * ""
|
|
52
|
-
Assets:Investments:MSFT 10 MSFT @@ 2000 USD
|
|
53
|
-
test: "Something"
|
|
54
|
-
Assets:Investments:Cash -20000 USD
|
|
55
|
-
|
|
56
|
-
---
|
|
57
|
-
|
|
58
|
-
(file
|
|
59
|
-
(transaction
|
|
60
|
-
(date)
|
|
61
|
-
(txn)
|
|
62
|
-
(narration)
|
|
63
|
-
(posting
|
|
64
|
-
(account)
|
|
65
|
-
(incomplete_amount
|
|
66
|
-
(number)
|
|
67
|
-
(currency)
|
|
68
|
-
)
|
|
69
|
-
(atat)
|
|
70
|
-
(price_annotation
|
|
71
|
-
(incomplete_amount
|
|
72
|
-
(number)
|
|
73
|
-
(currency)
|
|
74
|
-
)
|
|
75
|
-
)
|
|
76
|
-
)
|
|
77
|
-
(key_value
|
|
78
|
-
(key)
|
|
79
|
-
(value (string))
|
|
80
|
-
)
|
|
81
|
-
(posting
|
|
82
|
-
(account)
|
|
83
|
-
(incomplete_amount
|
|
84
|
-
(unary_number_expr
|
|
85
|
-
(minus) (number)
|
|
86
|
-
)
|
|
87
|
-
(currency)
|
|
88
|
-
)
|
|
89
|
-
)
|
|
90
|
-
)
|
|
91
|
-
)
|
|
92
|
-
|
|
93
|
-
=============
|
|
94
|
-
metadata end
|
|
95
|
-
=============
|
|
96
|
-
|
|
97
|
-
2013-05-18 * ""
|
|
98
|
-
Assets:Investments:MSFT 10 MSFT @@ 2000 USD
|
|
99
|
-
Assets:Investments:Cash -20000 USD
|
|
100
|
-
test: "Something"
|
|
101
|
-
|
|
102
|
-
---
|
|
103
|
-
|
|
104
|
-
(file
|
|
105
|
-
(transaction
|
|
106
|
-
(date)
|
|
107
|
-
(txn)
|
|
108
|
-
(narration)
|
|
109
|
-
(posting
|
|
110
|
-
(account)
|
|
111
|
-
(incomplete_amount
|
|
112
|
-
(number)
|
|
113
|
-
(currency)
|
|
114
|
-
)
|
|
115
|
-
(atat)
|
|
116
|
-
(price_annotation
|
|
117
|
-
(incomplete_amount
|
|
118
|
-
(number)
|
|
119
|
-
(currency)
|
|
120
|
-
)
|
|
121
|
-
)
|
|
122
|
-
)
|
|
123
|
-
(posting
|
|
124
|
-
(account)
|
|
125
|
-
(incomplete_amount
|
|
126
|
-
(unary_number_expr
|
|
127
|
-
(minus) (number)
|
|
128
|
-
)
|
|
129
|
-
(currency)
|
|
130
|
-
)
|
|
131
|
-
)
|
|
132
|
-
(key_value
|
|
133
|
-
(key)
|
|
134
|
-
(value (string))
|
|
135
|
-
)
|
|
136
|
-
)
|
|
137
|
-
)
|
|
138
|
-
|
|
139
|
-
==============
|
|
140
|
-
metadata many
|
|
141
|
-
==============
|
|
142
|
-
|
|
143
|
-
2013-05-18 * ""
|
|
144
|
-
test1: "Something"
|
|
145
|
-
Assets:Investments:MSFT 10 MSFT @@ 2000 USD
|
|
146
|
-
test2: "has"
|
|
147
|
-
test3: "to"
|
|
148
|
-
Assets:Investments:Cash -20000 USD
|
|
149
|
-
test4: "come"
|
|
150
|
-
test5: "from"
|
|
151
|
-
|
|
152
|
-
---
|
|
153
|
-
|
|
154
|
-
(file
|
|
155
|
-
(transaction
|
|
156
|
-
(date)
|
|
157
|
-
(txn)
|
|
158
|
-
(narration)
|
|
159
|
-
(key_value
|
|
160
|
-
(key)
|
|
161
|
-
(value (string))
|
|
162
|
-
)
|
|
163
|
-
(posting
|
|
164
|
-
(account)
|
|
165
|
-
(incomplete_amount
|
|
166
|
-
(number)
|
|
167
|
-
(currency)
|
|
168
|
-
)
|
|
169
|
-
(atat)
|
|
170
|
-
(price_annotation
|
|
171
|
-
(incomplete_amount
|
|
172
|
-
(number)
|
|
173
|
-
(currency)
|
|
174
|
-
)
|
|
175
|
-
)
|
|
176
|
-
)
|
|
177
|
-
(key_value
|
|
178
|
-
(key)
|
|
179
|
-
(value (string))
|
|
180
|
-
)
|
|
181
|
-
(key_value
|
|
182
|
-
(key)
|
|
183
|
-
(value (string))
|
|
184
|
-
)
|
|
185
|
-
(posting
|
|
186
|
-
(account)
|
|
187
|
-
(incomplete_amount
|
|
188
|
-
(unary_number_expr
|
|
189
|
-
(minus) (number)
|
|
190
|
-
)
|
|
191
|
-
(currency)
|
|
192
|
-
)
|
|
193
|
-
)
|
|
194
|
-
(key_value
|
|
195
|
-
(key)
|
|
196
|
-
(value (string))
|
|
197
|
-
)
|
|
198
|
-
(key_value
|
|
199
|
-
(key)
|
|
200
|
-
(value (string))
|
|
201
|
-
)
|
|
202
|
-
)
|
|
203
|
-
)
|
|
204
|
-
|
|
205
|
-
==================
|
|
206
|
-
metadata indented
|
|
207
|
-
=================
|
|
208
|
-
|
|
209
|
-
2013-05-18 * ""
|
|
210
|
-
test1: "Something"
|
|
211
|
-
Assets:Investments:MSFT 10 MSFT @@ 2000 USD
|
|
212
|
-
test2: "has"
|
|
213
|
-
test3: "to"
|
|
214
|
-
Assets:Investments:Cash -20000 USD
|
|
215
|
-
test4: "come"
|
|
216
|
-
test5: "from"
|
|
217
|
-
test6: "this"
|
|
218
|
-
|
|
219
|
-
---
|
|
220
|
-
|
|
221
|
-
(file
|
|
222
|
-
(transaction
|
|
223
|
-
(date)
|
|
224
|
-
(txn)
|
|
225
|
-
(narration)
|
|
226
|
-
(key_value (key) (value (string)))
|
|
227
|
-
(posting
|
|
228
|
-
(account)
|
|
229
|
-
(incomplete_amount
|
|
230
|
-
(number)
|
|
231
|
-
(currency)
|
|
232
|
-
)
|
|
233
|
-
(atat)
|
|
234
|
-
(price_annotation
|
|
235
|
-
(incomplete_amount
|
|
236
|
-
(number)
|
|
237
|
-
(currency)
|
|
238
|
-
)
|
|
239
|
-
)
|
|
240
|
-
)
|
|
241
|
-
(key_value
|
|
242
|
-
(key)
|
|
243
|
-
(value (string))
|
|
244
|
-
)
|
|
245
|
-
(key_value
|
|
246
|
-
(key)
|
|
247
|
-
(value (string))
|
|
248
|
-
)
|
|
249
|
-
(posting
|
|
250
|
-
(account)
|
|
251
|
-
(incomplete_amount
|
|
252
|
-
(unary_number_expr
|
|
253
|
-
(minus) (number)
|
|
254
|
-
)
|
|
255
|
-
(currency)
|
|
256
|
-
)
|
|
257
|
-
)
|
|
258
|
-
(key_value
|
|
259
|
-
(key)
|
|
260
|
-
(value (string))
|
|
261
|
-
)
|
|
262
|
-
(key_value
|
|
263
|
-
(key)
|
|
264
|
-
(value (string))
|
|
265
|
-
)
|
|
266
|
-
(key_value
|
|
267
|
-
(key)
|
|
268
|
-
(value (string))
|
|
269
|
-
)
|
|
270
|
-
)
|
|
271
|
-
)
|
|
272
|
-
|
|
273
|
-
===============
|
|
274
|
-
metadata other
|
|
275
|
-
==============
|
|
276
|
-
|
|
277
|
-
2013-01-01 open Equity:Other
|
|
278
|
-
2013-01-01 open Assets:Investments
|
|
279
|
-
test1: "Something"
|
|
280
|
-
test2: "Something"
|
|
281
|
-
2014-01-01 close Assets:Investments
|
|
282
|
-
test1: "Something"
|
|
283
|
-
2013-01-10 note Assets:Investments "Bla"
|
|
284
|
-
test1: "Something"
|
|
285
|
-
2013-01-31 pad Assets:Investments Equity:Other
|
|
286
|
-
test1: "Something"
|
|
287
|
-
2013-02-01 balance Assets:Investments 111.00 USD
|
|
288
|
-
test1: "Something"
|
|
289
|
-
2013-03-01 event "location" "Nowhere"
|
|
290
|
-
test1: "Something"
|
|
291
|
-
2013-03-01 document Assets:Investments "/path/to/something.pdf"
|
|
292
|
-
test1: "Something"
|
|
293
|
-
2013-03-01 price HOOL 500 USD
|
|
294
|
-
test1: "Something"
|
|
295
|
-
|
|
296
|
-
---
|
|
297
|
-
|
|
298
|
-
(file
|
|
299
|
-
(open
|
|
300
|
-
(date)
|
|
301
|
-
(account)
|
|
302
|
-
)
|
|
303
|
-
(open
|
|
304
|
-
(date)
|
|
305
|
-
(account)
|
|
306
|
-
(key_value (key) (value (string)))
|
|
307
|
-
(key_value (key) (value (string)))
|
|
308
|
-
)
|
|
309
|
-
(close
|
|
310
|
-
(date)
|
|
311
|
-
(account)
|
|
312
|
-
(key_value (key) (value (string)))
|
|
313
|
-
)
|
|
314
|
-
(note
|
|
315
|
-
(date)
|
|
316
|
-
(account)
|
|
317
|
-
(string)
|
|
318
|
-
(key_value (key) (value (string)))
|
|
319
|
-
)
|
|
320
|
-
(pad
|
|
321
|
-
(date)
|
|
322
|
-
(account)
|
|
323
|
-
(account)
|
|
324
|
-
(key_value (key) (value (string)))
|
|
325
|
-
)
|
|
326
|
-
(balance
|
|
327
|
-
(date)
|
|
328
|
-
(account)
|
|
329
|
-
(amount_tolerance
|
|
330
|
-
(number)
|
|
331
|
-
(currency)
|
|
332
|
-
)
|
|
333
|
-
(key_value (key) (value (string)))
|
|
334
|
-
)
|
|
335
|
-
(event
|
|
336
|
-
(date)
|
|
337
|
-
(string)
|
|
338
|
-
(string)
|
|
339
|
-
(key_value (key) (value (string)))
|
|
340
|
-
)
|
|
341
|
-
(document
|
|
342
|
-
(date)
|
|
343
|
-
(account)
|
|
344
|
-
(filename (string))
|
|
345
|
-
(key_value (key) (value (string)))
|
|
346
|
-
)
|
|
347
|
-
(price
|
|
348
|
-
(date)
|
|
349
|
-
(currency)
|
|
350
|
-
(amount
|
|
351
|
-
(number)
|
|
352
|
-
(currency)
|
|
353
|
-
)
|
|
354
|
-
(key_value (key) (value (string)))
|
|
355
|
-
)
|
|
356
|
-
)
|
|
357
|
-
|
|
358
|
-
===================
|
|
359
|
-
metadata datatypes
|
|
360
|
-
===================
|
|
361
|
-
|
|
362
|
-
2013-05-18 * ""
|
|
363
|
-
string: "Something"
|
|
364
|
-
account: Assets:Investments:Cash
|
|
365
|
-
date: 2012-01-01
|
|
366
|
-
currency: HOOL
|
|
367
|
-
tag: #trip-florida
|
|
368
|
-
number: 345.67
|
|
369
|
-
amount: 345.67 USD
|
|
370
|
-
boolt: TRUE
|
|
371
|
-
boolf: FALSE
|
|
372
|
-
|
|
373
|
-
----
|
|
374
|
-
|
|
375
|
-
(file
|
|
376
|
-
(transaction
|
|
377
|
-
(date)
|
|
378
|
-
(txn)
|
|
379
|
-
(narration)
|
|
380
|
-
(key_value (key) (value (string)))
|
|
381
|
-
(key_value (key) (value (account)))
|
|
382
|
-
(key_value (key) (value (date)))
|
|
383
|
-
(key_value (key) (value (currency)))
|
|
384
|
-
(key_value (key) (value (tag)))
|
|
385
|
-
(key_value (key) (value (number)))
|
|
386
|
-
(key_value (key) (value (amount (number) (currency))))
|
|
387
|
-
(key_value (key) (value (bool)))
|
|
388
|
-
(key_value (key) (value (bool)))
|
|
389
|
-
)
|
|
390
|
-
)
|
|
391
|
-
|
|
392
|
-
====================
|
|
393
|
-
metadata key syntax
|
|
394
|
-
====================
|
|
395
|
-
|
|
396
|
-
2013-05-18 * ""
|
|
397
|
-
nameoncard: "Jim"
|
|
398
|
-
nameOnCard: "Joe"
|
|
399
|
-
name-on-card: "Bob"
|
|
400
|
-
name_on_card: "John"
|
|
401
|
-
|
|
402
|
-
---
|
|
403
|
-
|
|
404
|
-
(file
|
|
405
|
-
(transaction
|
|
406
|
-
(date)
|
|
407
|
-
(txn)
|
|
408
|
-
(narration)
|
|
409
|
-
(key_value (key) (value (string)))
|
|
410
|
-
(key_value (key) (value (string)))
|
|
411
|
-
(key_value (key) (value (string)))
|
|
412
|
-
(key_value (key) (value (string)))
|
|
413
|
-
)
|
|
414
|
-
)
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
====
|
|
2
|
-
Multiple Lines
|
|
3
|
-
===============
|
|
4
|
-
|
|
5
|
-
2014-07-11 * "Hello one line
|
|
6
|
-
and yet another,
|
|
7
|
-
and why not another!"
|
|
8
|
-
Expenses:Restaurant 100 USD
|
|
9
|
-
Assets:Cash -100 USD
|
|
10
|
-
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
(file
|
|
14
|
-
(transaction
|
|
15
|
-
(date)
|
|
16
|
-
(txn)
|
|
17
|
-
(narration)
|
|
18
|
-
(posting
|
|
19
|
-
(account)
|
|
20
|
-
(incomplete_amount (number) (currency))
|
|
21
|
-
)
|
|
22
|
-
(posting
|
|
23
|
-
(account)
|
|
24
|
-
(incomplete_amount (unary_number_expr (minus) (number)) (currency))
|
|
25
|
-
)
|
|
26
|
-
)
|
|
27
|
-
)
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
==============
|
|
2
|
-
1 orgmode heading
|
|
3
|
-
==============
|
|
4
|
-
|
|
5
|
-
* Title
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
(file
|
|
9
|
-
(section
|
|
10
|
-
(headline (item))
|
|
11
|
-
)
|
|
12
|
-
)
|
|
13
|
-
|
|
14
|
-
==============
|
|
15
|
-
2 orgmode heading
|
|
16
|
-
==============
|
|
17
|
-
|
|
18
|
-
* Title
|
|
19
|
-
|
|
20
|
-
* B
|
|
21
|
-
|
|
22
|
-
---
|
|
23
|
-
(file
|
|
24
|
-
(section
|
|
25
|
-
(headline (item))
|
|
26
|
-
)
|
|
27
|
-
(section
|
|
28
|
-
(headline (item))
|
|
29
|
-
)
|
|
30
|
-
)
|
|
31
|
-
|
|
32
|
-
==============
|
|
33
|
-
orgmode heading in different levels
|
|
34
|
-
==============
|
|
35
|
-
|
|
36
|
-
* Title
|
|
37
|
-
|
|
38
|
-
** Title
|
|
39
|
-
|
|
40
|
-
*** Title
|
|
41
|
-
|
|
42
|
-
---
|
|
43
|
-
(file
|
|
44
|
-
(section
|
|
45
|
-
(headline (item))
|
|
46
|
-
(section
|
|
47
|
-
(headline (item))
|
|
48
|
-
(section
|
|
49
|
-
(headline (item))
|
|
50
|
-
)
|
|
51
|
-
)
|
|
52
|
-
)
|
|
53
|
-
)
|