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 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 tree-sitter-beancount
83
+ pip install tree-sitter
68
84
  ```
69
85
 
70
86
  ## Usage
@@ -0,0 +1,9 @@
1
+ const assert = require("node:assert");
2
+ const { test } = require("node:test");
3
+
4
+ const Parser = require("tree-sitter");
5
+
6
+ test("can load grammar", () => {
7
+ const parser = new Parser();
8
+ assert.doesNotThrow(() => parser.setLanguage(require(".")));
9
+ });
@@ -1,6 +1,10 @@
1
1
  const root = require("path").join(__dirname, "..", "..");
2
2
 
3
- module.exports = require("node-gyp-build")(root);
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
- identifier: $ => /[a-z]+/,
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.1",
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": "^7.1.0",
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
- "tree-sitter-cli": "^0.25.0",
49
- "prebuildify": "^6.0.0"
49
+ "prebuildify": "^6.0.0",
50
+ "tree-sitter-cli": "^0.25.9"
50
51
  },
51
52
  "engines": {
52
53
  "node": ">=22.0.0"
package/src/grammar.json CHANGED
@@ -2336,7 +2336,7 @@
2336
2336
  },
2337
2337
  "identifier": {
2338
2338
  "type": "PATTERN",
2339
- "value": "[a-z]+"
2339
+ "value": "[a-zA-Z]+"
2340
2340
  },
2341
2341
  "_skipped_lines": {
2342
2342
  "type": "CHOICE",