tree-sitter-beancount 2.3.2 → 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 +52 -128
  7. package/package.json +35 -5
  8. package/src/grammar.json +272 -562
  9. package/src/node-types.json +76 -21
  10. package/src/parser.c +8740 -8678
  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 -11
  19. package/.github/workflows/cicd.yml +0 -30
  20. package/.github/workflows/release.yml +0 -72
  21. package/CHANGELOG.md +0 -72
  22. package/Cargo.lock +0 -59
  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 -172
  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 -52
@@ -1,373 +0,0 @@
1
- =========
2
- expr add
3
- =========
4
-
5
- 2013-05-18 * "Test"
6
- Assets:Something 12 + 3 USD
7
- Assets:Something 7.5 + 3.1 USD
8
-
9
- ---
10
-
11
- (file
12
- (transaction
13
- (date)
14
- (txn)
15
- (narration)
16
- (posting
17
- (account)
18
- (incomplete_amount
19
- (binary_number_expr (number) (plus) (number))
20
- (currency)
21
- )
22
- )
23
- (posting
24
- (account)
25
- (incomplete_amount
26
- (binary_number_expr (number) (plus) (number))
27
- (currency)
28
- )
29
- )
30
- )
31
- )
32
-
33
- ==========
34
- expr sub
35
- =========
36
-
37
- 2013-05-18 * "Test"
38
- Assets:Something 12 - 3 USD
39
- Assets:Something 7.5 - 3.1 USD
40
-
41
- ---
42
-
43
- (file
44
- (transaction
45
- (date)
46
- (txn)
47
- (narration)
48
- (posting
49
- (account)
50
- (incomplete_amount
51
- (binary_number_expr (number) (minus) (number))
52
- (currency)
53
- )
54
- )
55
- (posting
56
- (account)
57
- (incomplete_amount
58
- (binary_number_expr (number) (minus) (number))
59
- (currency)
60
- )
61
- )
62
- )
63
- )
64
-
65
- ==========
66
- expr mult
67
- ==========
68
-
69
- 2013-05-18 * "Test"
70
- Assets:Something 12 * 3 USD
71
- Assets:Something 7.5 * 3.1 USD
72
-
73
- ---
74
-
75
- (file
76
- (transaction
77
- (date)
78
- (txn)
79
- (narration)
80
- (posting
81
- (account)
82
- (incomplete_amount
83
- (binary_number_expr (number) (asterisk) (number))
84
- (currency)
85
- )
86
- )
87
- (posting
88
- (account)
89
- (incomplete_amount
90
- (binary_number_expr (number) (asterisk) (number))
91
- (currency)
92
- )
93
- )
94
- )
95
- )
96
-
97
- =========
98
- expr div
99
- ========
100
-
101
- 2013-05-18 * "Test"
102
- Assets:Something 12 / 3 USD
103
- Assets:Something 7.5 / 3 USD
104
-
105
- ---
106
-
107
- (file
108
- (transaction
109
- (date)
110
- (txn)
111
- (narration)
112
- (posting
113
- (account)
114
- (incomplete_amount
115
- (binary_number_expr (number) (slash) (number))
116
- (currency)
117
- )
118
- )
119
- (posting
120
- (account)
121
- (incomplete_amount
122
- (binary_number_expr (number) (slash) (number))
123
- (currency)
124
- )
125
- )
126
- )
127
- )
128
-
129
- =========
130
- expr neg
131
- ========
132
-
133
- 2013-05-18 * "Test"
134
- Assets:Something -12 USD
135
- Assets:Something -7.5 USD
136
- Assets:Something - 7.5 USD
137
-
138
- ---
139
-
140
- (file
141
- (transaction
142
- (date)
143
- (txn)
144
- (narration)
145
- (posting
146
- (account)
147
- (incomplete_amount
148
- (unary_number_expr (minus) (number))
149
- (currency)
150
- )
151
- )
152
- (posting
153
- (account)
154
- (incomplete_amount
155
- (unary_number_expr (minus) (number))
156
- (currency)
157
- )
158
- )
159
- (posting
160
- (account)
161
- (incomplete_amount
162
- (unary_number_expr (minus) (number))
163
- (currency)
164
- )
165
- )
166
- )
167
- )
168
-
169
- =========
170
- expr pos
171
- ========
172
-
173
- 2013-05-18 * "Test"
174
- Assets:Something +12 USD
175
- Assets:Something -7.5 USD
176
-
177
- ---
178
-
179
- (file
180
- (transaction
181
- (date)
182
- (txn)
183
- (narration)
184
- (posting
185
- (account)
186
- (incomplete_amount
187
- (unary_number_expr (plus) (number))
188
- (currency)
189
- )
190
- )
191
- (posting
192
- (account)
193
- (incomplete_amount
194
- (unary_number_expr (minus) (number))
195
- (currency)
196
- )
197
- )
198
- )
199
- )
200
-
201
- ==============
202
- expr predence
203
- =============
204
-
205
- 2013-05-18 * "Test"
206
- Assets:Something 2 * 3 + 4 USD
207
- Assets:Something 2 + 3 * 4 USD
208
- Assets:Something 2 + -3 * 4 USD
209
- Assets:Something (2 + -3) * 4 USD
210
-
211
- ---
212
-
213
- (file
214
- (transaction
215
- (date)
216
- (txn)
217
- (narration)
218
- (posting
219
- (account)
220
- (incomplete_amount
221
- (binary_number_expr
222
- (binary_number_expr (number) (asterisk) (number))
223
- (plus)
224
- (number)
225
- )
226
- (currency)
227
- )
228
- )
229
- (posting
230
- (account)
231
- (incomplete_amount
232
- (binary_number_expr
233
- (number)
234
- (plus)
235
- (binary_number_expr (number) (asterisk) (number))
236
- )
237
- (currency)
238
- )
239
- )
240
- (posting
241
- (account)
242
- (incomplete_amount
243
- (binary_number_expr
244
- (number)
245
- (plus)
246
- (binary_number_expr (unary_number_expr (minus) (number)) (asterisk) (number))
247
- )
248
- (currency)
249
- )
250
- )
251
- (posting
252
- (account)
253
- (incomplete_amount
254
- (binary_number_expr
255
- (binary_number_expr (number) (plus) (unary_number_expr (minus) (number)))
256
- (asterisk)
257
- (number)
258
- )
259
- (currency)
260
- )
261
- )
262
- )
263
- )
264
-
265
- ============
266
- expr groups
267
- ============
268
-
269
- 2013-05-18 * "Test"
270
- Assets:Something (2 + -3) * 4 USD
271
- Assets:Something 2 * (2 + -3) USD
272
-
273
- ---
274
-
275
- (file
276
- (transaction
277
- (date)
278
- (txn)
279
- (narration)
280
- (posting
281
- (account)
282
- (incomplete_amount
283
- (binary_number_expr
284
- (binary_number_expr (number) (plus) (unary_number_expr (minus) (number)))
285
- (asterisk)
286
- (number)
287
- )
288
- (currency)
289
- )
290
- )
291
- (posting
292
- (account)
293
- (incomplete_amount
294
- (binary_number_expr
295
- (number)
296
- (asterisk)
297
- (binary_number_expr (number) (plus) (unary_number_expr (minus) (number)))
298
- )
299
- (currency)
300
- )
301
- )
302
- )
303
- )
304
-
305
- ======================
306
- expr different places
307
- ======================
308
-
309
- 2013-05-18 * "Test"
310
- Assets:Something -(3 * 4) HOOL {120.01 * 2.1 USD} @ 134.02 * 2.1 USD
311
- Assets:Something 1000000 USD ;; No balance checks.
312
-
313
- 2014-01-01 balance Assets:Something 3 * 4 * 120.01 * 2.1 USD
314
- number: -(5662.23 + 22.3)
315
-
316
- ---
317
-
318
- (file
319
- (transaction
320
- (date)
321
- (txn)
322
- (narration)
323
- (posting
324
- (account)
325
- (incomplete_amount
326
- (unary_number_expr (minus) (binary_number_expr (number) (asterisk) (number)))
327
- (currency)
328
- )
329
- (cost_spec
330
- (cost_comp
331
- (compound_amount
332
- (binary_number_expr (number) (asterisk) (number))
333
- (currency)
334
- )
335
- )
336
- )
337
- (at)
338
- (price_annotation
339
- (incomplete_amount
340
- (binary_number_expr (number) (asterisk) (number))
341
- (currency)
342
- )
343
- )
344
- )
345
- (posting
346
- (account)
347
- (incomplete_amount (number) (currency))
348
- (comment)
349
- )
350
- )
351
- (balance
352
- (date)
353
- (account)
354
- (amount_tolerance
355
- (binary_number_expr
356
- (binary_number_expr
357
- (binary_number_expr (number) (asterisk) (number))
358
- (asterisk)
359
- (number)
360
- )
361
- (asterisk)
362
- (number)
363
- )
364
- (currency)
365
- )
366
- (key_value
367
- (key)
368
- (value
369
- (unary_number_expr (minus) (binary_number_expr (number) (plus) (number)))
370
- )
371
- )
372
- )
373
- )
@@ -1,172 +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
- )
@@ -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
- )