tree-sitter-beancount 2.4.1 → 2.4.2
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 +17 -1
- package/bindings/node/binding_test.js +9 -0
- package/bindings/node/index.js +5 -1
- package/grammar.js +2 -1
- package/package.json +6 -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 +1 -1
- package/src/parser.c +2299 -1521
package/README.md
CHANGED
|
@@ -63,8 +63,24 @@ tree-sitter-beancount = "2.3.3"
|
|
|
63
63
|
|
|
64
64
|
### Python
|
|
65
65
|
|
|
66
|
+
Install from source:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
git clone https://github.com/polarmutex/tree-sitter-beancount
|
|
70
|
+
cd tree-sitter-beancount
|
|
71
|
+
pip install .
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Or install via pip (once published to PyPI):
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
pip install tree-sitter-beancount
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
You'll also need the tree-sitter Python package:
|
|
81
|
+
|
|
66
82
|
```bash
|
|
67
|
-
pip install tree-sitter
|
|
83
|
+
pip install tree-sitter
|
|
68
84
|
```
|
|
69
85
|
|
|
70
86
|
## Usage
|
package/bindings/node/index.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
const root = require("path").join(__dirname, "..", "..");
|
|
2
2
|
|
|
3
|
-
module.exports =
|
|
3
|
+
module.exports =
|
|
4
|
+
typeof process.versions.bun === "string"
|
|
5
|
+
// Support `bun build --compile` by being statically analyzable enough to find the .node file at build-time
|
|
6
|
+
? require(`../../prebuilds/${process.platform}-${process.arch}/tree-sitter-beancount.node`)
|
|
7
|
+
: require("node-gyp-build")(root);
|
|
4
8
|
|
|
5
9
|
try {
|
|
6
10
|
module.exports.nodeTypeInfo = require("../../src/node-types.json");
|
package/grammar.js
CHANGED
|
@@ -638,7 +638,8 @@ module.exports = grammar({
|
|
|
638
638
|
comment: $ => token(seq(';', /[^\r\n]*/)),
|
|
639
639
|
|
|
640
640
|
// NOTE: includes reserved identifiers
|
|
641
|
-
|
|
641
|
+
// Allow uppercase letters to support incomplete account names for LSP completion
|
|
642
|
+
identifier: $ => /[a-zA-Z]+/,
|
|
642
643
|
|
|
643
644
|
_skipped_lines: $ =>
|
|
644
645
|
choice(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tree-sitter-beancount",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.2",
|
|
4
4
|
"description": "a tree-sitter parser for the beancount syntax",
|
|
5
5
|
"main": "bindings/node",
|
|
6
6
|
"types": "bindings/node",
|
|
@@ -33,8 +33,9 @@
|
|
|
33
33
|
},
|
|
34
34
|
"homepage": "https://github.com/bryall/tree-sitter-beancount#readme",
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"node-addon-api": "^
|
|
37
|
-
"node-gyp-build": "^4.8.0"
|
|
36
|
+
"node-addon-api": "^8.5.0",
|
|
37
|
+
"node-gyp-build": "^4.8.0",
|
|
38
|
+
"tar-fs": "^2.1.4"
|
|
38
39
|
},
|
|
39
40
|
"peerDependencies": {
|
|
40
41
|
"tree-sitter": "^0.25.0"
|
|
@@ -45,8 +46,8 @@
|
|
|
45
46
|
}
|
|
46
47
|
},
|
|
47
48
|
"devDependencies": {
|
|
48
|
-
"
|
|
49
|
-
"
|
|
49
|
+
"prebuildify": "^6.0.0",
|
|
50
|
+
"tree-sitter-cli": "^0.25.9"
|
|
50
51
|
},
|
|
51
52
|
"engines": {
|
|
52
53
|
"node": ">=22.0.0"
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|