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,417 +0,0 @@
1
- ===========
2
- cost empty
3
- ===========
4
-
5
- 2014-01-01 *
6
- Assets:Invest:AAPL 20 AAPL {}
7
- Assets:Invest:Cash -20 AAPL
8
-
9
- ---
10
-
11
- (file
12
- (transaction
13
- (date)
14
- (txn)
15
- (posting
16
- (account)
17
- (incomplete_amount (number) (currency))
18
- (cost_spec)
19
- )
20
- (posting
21
- (account)
22
- (incomplete_amount
23
- (unary_number_expr (minus) (number))
24
- (currency)
25
- )
26
- )
27
- )
28
- )
29
-
30
- ===========
31
- cost amount
32
- ============
33
-
34
- 2014-01-01 *
35
- Assets:Invest:AAPL 20 AAPL {45.23 USD}
36
- Assets:Invest:Cash -90.46 USD
37
-
38
- ---
39
-
40
- (file
41
- (transaction
42
- (date)
43
- (txn)
44
- (posting
45
- (account)
46
- (incomplete_amount
47
- (number)
48
- (currency)
49
- )
50
- (cost_spec
51
- (cost_comp
52
- (compound_amount
53
- (number)
54
- (currency)
55
- )
56
- )
57
- )
58
- )
59
- (posting
60
- (account)
61
- (incomplete_amount
62
- (unary_number_expr
63
- (minus) (number)
64
- )
65
- (currency)
66
- )
67
- )
68
- )
69
- )
70
-
71
- ==========
72
- cost date
73
- ==========
74
-
75
- 2014-01-01 *
76
- Assets:Invest:AAPL 20 AAPL {2014-12-26}
77
- Assets:Invest:Cash -20 AAPL
78
-
79
- ---
80
-
81
- (file
82
- (transaction
83
- (date)
84
- (txn)
85
- (posting
86
- (account)
87
- (incomplete_amount (number) (currency))
88
- (cost_spec
89
- (cost_comp (date))
90
- )
91
- )
92
- (posting
93
- (account)
94
- (incomplete_amount
95
- (unary_number_expr (minus) (number))
96
- (currency)
97
- )
98
- )
99
- )
100
- )
101
-
102
- ===========
103
- cost label
104
- ===========
105
-
106
- 2014-01-01 *
107
- Assets:Invest:AAPL 20 AAPL {"d82d55a0dbe8"}
108
- Assets:Invest:Cash -20 AAPL
109
-
110
- ---
111
-
112
- (file
113
- (transaction
114
- (date)
115
- (txn)
116
- (posting
117
- (account)
118
- (incomplete_amount (number) (currency))
119
- (cost_spec
120
- (cost_comp (string))
121
- )
122
- )
123
- (posting
124
- (account)
125
- (incomplete_amount
126
- (unary_number_expr (minus) (number))
127
- (currency)
128
- )
129
- )
130
- )
131
- )
132
-
133
- ===========
134
- cost merge
135
- ===========
136
-
137
- 2014-01-01 *
138
- Assets:Invest:AAPL 20 AAPL {*}
139
- Assets:Invest:Cash -20 AAPL
140
-
141
- ---
142
-
143
- (file
144
- (transaction
145
- (date)
146
- (txn)
147
- (posting
148
- (account)
149
- (incomplete_amount (number) (currency))
150
- (cost_spec (cost_comp))
151
- )
152
- (posting
153
- (account)
154
- (incomplete_amount
155
- (unary_number_expr (minus) (number))
156
- (currency)
157
- )
158
- )
159
- )
160
- )
161
-
162
- ===================
163
- cost two component
164
- ===================
165
-
166
- 2014-01-01 *
167
- Assets:Invest:AAPL 1 AAPL {45.23 USD, 2014-12-26}
168
- Assets:Invest:AAPL 1 AAPL {2014-12-26, 45.23 USD}
169
- Assets:Invest:AAPL 1 AAPL {45.23 USD, "d82d55a0dbe8"}
170
- Assets:Invest:AAPL 1 AAPL {"d82d55a0dbe8", 45.23 USD}
171
- Assets:Invest:AAPL 1 AAPL {2014-12-26, "d82d55a0dbe8"}
172
- Assets:Invest:AAPL 1 AAPL {"d82d55a0dbe8", 2014-12-26}
173
-
174
- ---
175
-
176
- (file
177
- (transaction
178
- (date)
179
- (txn)
180
- (posting
181
- (account)
182
- (incomplete_amount (number) (currency))
183
- (cost_spec
184
- (cost_comp (compound_amount (number) (currency)))
185
- (cost_comp (date))
186
- )
187
- )
188
- (posting
189
- (account)
190
- (incomplete_amount (number) (currency))
191
- (cost_spec
192
- (cost_comp (date))
193
- (cost_comp (compound_amount (number) (currency)))
194
- )
195
- )
196
- (posting
197
- (account)
198
- (incomplete_amount (number) (currency))
199
- (cost_spec
200
- (cost_comp (compound_amount (number) (currency)))
201
- (cost_comp (string))
202
- )
203
- )
204
- (posting
205
- (account)
206
- (incomplete_amount (number) (currency))
207
- (cost_spec
208
- (cost_comp (string))
209
- (cost_comp (compound_amount (number) (currency)))
210
- )
211
- )
212
- (posting
213
- (account)
214
- (incomplete_amount (number) (currency))
215
- (cost_spec
216
- (cost_comp (date))
217
- (cost_comp (string))
218
- )
219
- )
220
- (posting
221
- (account)
222
- (incomplete_amount (number) (currency))
223
- (cost_spec
224
- (cost_comp (string))
225
- (cost_comp (date))
226
- )
227
- )
228
- )
229
- )
230
-
231
- =====================
232
- cost three component
233
- =====================
234
-
235
- 2014-01-01 *
236
- Assets:Invest:AAPL 1 AAPL {45.23 USD, 2014-12-26, "d82d55a0dbe8"}
237
- Assets:Invest:AAPL 1 AAPL {2014-12-26, 45.23 USD, "d82d55a0dbe8"}
238
- Assets:Invest:AAPL 1 AAPL {45.23 USD, "d82d55a0dbe8", 2014-12-26}
239
- Assets:Invest:AAPL 1 AAPL {2014-12-26, "d82d55a0dbe8", 45.23 USD}
240
- Assets:Invest:AAPL 1 AAPL {"d82d55a0dbe8", 45.23 USD, 2014-12-26}
241
- Assets:Invest:AAPL 1 AAPL {"d82d55a0dbe8", 2014-12-26, 45.23 USD}
242
-
243
- ---
244
-
245
- (file
246
- (transaction
247
- (date)
248
- (txn)
249
- (posting
250
- (account)
251
- (incomplete_amount (number) (currency))
252
- (cost_spec
253
- (cost_comp (compound_amount (number) (currency)))
254
- (cost_comp (date))
255
- (cost_comp (string))
256
- )
257
- )
258
- (posting
259
- (account)
260
- (incomplete_amount (number) (currency))
261
- (cost_spec
262
- (cost_comp (date))
263
- (cost_comp (compound_amount (number) (currency)))
264
- (cost_comp (string))
265
- )
266
- )
267
- (posting
268
- (account)
269
- (incomplete_amount (number) (currency))
270
- (cost_spec
271
- (cost_comp (compound_amount (number) (currency)))
272
- (cost_comp (string))
273
- (cost_comp (date))
274
- )
275
- )
276
- (posting
277
- (account)
278
- (incomplete_amount (number) (currency))
279
- (cost_spec
280
- (cost_comp (date))
281
- (cost_comp (string))
282
- (cost_comp (compound_amount (number) (currency)))
283
- )
284
- )
285
- (posting
286
- (account)
287
- (incomplete_amount (number) (currency))
288
- (cost_spec
289
- (cost_comp (string))
290
- (cost_comp (compound_amount (number) (currency)))
291
- (cost_comp (date))
292
- )
293
- )
294
- (posting
295
- (account)
296
- (incomplete_amount (number) (currency))
297
- (cost_spec
298
- (cost_comp (string))
299
- (cost_comp (date))
300
- (cost_comp (compound_amount (number) (currency)))
301
- )
302
- )
303
- )
304
- )
305
-
306
- ================
307
- cost both costs
308
- ================
309
-
310
- 2014-01-01 *
311
- Assets:Invest:AAPL 10 AAPL {45.23 # 9.95 USD}
312
- Assets:Invest:Cash -110.36 USD
313
-
314
- ---
315
-
316
- (file
317
- (transaction
318
- (date)
319
- (txn)
320
- (posting
321
- (account)
322
- (incomplete_amount (number) (currency))
323
- (cost_spec
324
- (cost_comp (compound_amount (number) (number) (currency)))
325
- )
326
- )
327
- (posting
328
- (account)
329
- (incomplete_amount (unary_number_expr (minus) (number)) (currency))
330
- )
331
- )
332
- )
333
-
334
- ================
335
- cost total cost
336
- ================
337
-
338
- 2014-01-01 *
339
- Assets:Invest:AAPL 10 AAPL {# 9.95 USD}
340
- Assets:Invest:Cash -19.90 USD
341
-
342
- ---
343
-
344
- (file
345
- (transaction
346
- (date)
347
- (txn)
348
- (posting
349
- (account)
350
- (incomplete_amount (number) (currency))
351
- (cost_spec
352
- (cost_comp (compound_amount (number) (currency)))
353
- )
354
- )
355
- (posting
356
- (account)
357
- (incomplete_amount (unary_number_expr (minus) (number)) (currency))
358
- )
359
- )
360
- )
361
-
362
- =======================
363
- cost total empty total
364
- =======================
365
-
366
- 2014-01-01 *
367
- Assets:Invest:AAPL 20 AAPL {45.23 # USD}
368
- Assets:Invest:Cash -45.23 USD
369
-
370
- ---
371
-
372
- (file
373
- (transaction
374
- (date)
375
- (txn)
376
- (posting
377
- (account)
378
- (incomplete_amount (number) (currency))
379
- (cost_spec
380
- (cost_comp (compound_amount (number) (currency)))
381
- )
382
- )
383
- (posting
384
- (account)
385
- (incomplete_amount (unary_number_expr (minus) (number)) (currency))
386
- )
387
- )
388
- )
389
-
390
- ==============
391
- cost negative
392
- ==============
393
-
394
- 2013-05-18 * ""
395
- Assets:Investments:MSFT -10 MSFT {-200.00 USD}
396
- Assets:Investments:Cash 2000.00 USD
397
-
398
- ---
399
-
400
- (file
401
- (transaction
402
- (date)
403
- (txn)
404
- (narration)
405
- (posting
406
- (account)
407
- (incomplete_amount (unary_number_expr (minus) (number)) (currency))
408
- (cost_spec
409
- (cost_comp (compound_amount (unary_number_expr (minus) (number)) (currency)))
410
- )
411
- )
412
- (posting
413
- (account)
414
- (incomplete_amount (number) (currency))
415
- )
416
- )
417
- )
@@ -1,23 +0,0 @@
1
- =================
2
- include absolute
3
- =================
4
-
5
- include "/some/absolute/filename.beancount"
6
-
7
- ---
8
-
9
- (file
10
- (include (string))
11
- )
12
-
13
- =================
14
- include relative
15
- =================
16
-
17
- include "some/relative/filename.beancount"
18
-
19
- ---
20
-
21
- (file
22
- (include (string))
23
- )
@@ -1,32 +0,0 @@
1
- ======
2
- links
3
- ======
4
-
5
- 2013-05-18 * "Something something" ^38784734873
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
- (tags_links (link))
17
- (posting
18
- (account)
19
- (incomplete_amount
20
- (number)
21
- (currency)
22
- )
23
- )
24
- (posting
25
- (account)
26
- (incomplete_amount
27
- (unary_number_expr (minus) (number))
28
- (currency)
29
- )
30
- )
31
- )
32
- )
@@ -1,39 +0,0 @@
1
- ====================
2
- option single value
3
- ====================
4
-
5
- option "title" "Super Rich"
6
-
7
- ---
8
-
9
- (file
10
- (option (string) (string))
11
- )
12
-
13
- ==================
14
- option list value
15
- ==================
16
-
17
- option "documents" "/path/docs/a"
18
- option "documents" "/path/docs/b"
19
- option "documents" "/path/docs/c"
20
-
21
- ---
22
-
23
- (file
24
- (option (string) (string))
25
- (option (string) (string))
26
- (option (string) (string))
27
- )
28
-
29
- ====================
30
- option with special char
31
- ====================
32
-
33
- option "precision" "*.5000"
34
-
35
- ---
36
-
37
- (file
38
- (option (string) (string))
39
- )
@@ -1,35 +0,0 @@
1
- =======
2
- plugin
3
- =======
4
-
5
- plugin "beancount.plugin.unrealized"
6
-
7
- ---
8
-
9
- (file
10
- (plugin (string))
11
- )
12
-
13
- ===================
14
- plugin with config
15
- ===================
16
-
17
- plugin "beancount.plugin.unrealized" "Unrealized"
18
-
19
- ---
20
-
21
- (file
22
- (plugin (string) (string))
23
- )
24
-
25
- =================
26
- plugin as option
27
- =================
28
-
29
- option "plugin" "beancount.plugin.unrealized"
30
-
31
- ---
32
-
33
- (file
34
- (option (string) (string))
35
- )
@@ -1,34 +0,0 @@
1
- ==============
2
- push pop meta
3
- ==============
4
-
5
- pushmeta location: "Lausanne, Switzerland"
6
-
7
- 2015-06-07 * "Something"
8
- Assets:Something 1 USD
9
- Assets:Something -1 USD
10
-
11
- popmeta location:
12
-
13
- ---
14
-
15
- (file
16
- (pushmeta
17
- (key_value (key) (value (string)))
18
- )
19
- (transaction
20
- (date)
21
- (txn)
22
- (narration)
23
- (posting
24
- (account)
25
- (incomplete_amount (number) (currency))
26
- )
27
- (posting
28
- (account)
29
- (incomplete_amount (unary_number_expr (minus) (number)) (currency))
30
- )
31
- )
32
- (popmeta (key))
33
- )
34
-
@@ -1,23 +0,0 @@
1
- ==================
2
- push tag
3
- ==================
4
-
5
- pushtag #sampleTag
6
-
7
- ---
8
-
9
- (file
10
- (pushtag (tag))
11
- )
12
-
13
- ================
14
- pop tag
15
- ================
16
-
17
- poptag #sampleTag
18
-
19
- ---
20
-
21
- (file
22
- (poptag (tag))
23
- )