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,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
|
-
)
|