tree-sitter-beancount 2.1.3 → 2.3.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.
- package/.gitattributes +6 -0
- package/.github/workflows/cicd.yml +2 -2
- package/.github/workflows/release.yml +5 -5
- package/CHANGELOG.md +19 -0
- package/Cargo.toml +1 -1
- package/Package.swift +20 -0
- package/binding.gyp +1 -1
- package/bindings/rust/build.rs +2 -0
- package/flake.lock +19 -19
- package/flake.nix +7 -8
- package/grammar.js +3 -3
- package/package.json +1 -1
- package/src/grammar.json +30 -18
- package/src/node-types.json +20 -8
- package/src/parser.c +2265 -2240
- package/src/scanner.c +208 -0
- package/src/tree_sitter/parser.h +11 -5
- package/src/scanner.cc +0 -171
package/.gitattributes
ADDED
|
@@ -12,10 +12,10 @@ jobs:
|
|
|
12
12
|
runs-on: ubuntu-latest
|
|
13
13
|
steps:
|
|
14
14
|
- name: Checkout code
|
|
15
|
-
uses: actions/checkout@
|
|
15
|
+
uses: actions/checkout@v4
|
|
16
16
|
|
|
17
17
|
- name: Setup Node
|
|
18
|
-
uses: actions/setup-node@
|
|
18
|
+
uses: actions/setup-node@v4.0.2
|
|
19
19
|
with:
|
|
20
20
|
node-version: '18'
|
|
21
21
|
|
|
@@ -9,7 +9,7 @@ jobs:
|
|
|
9
9
|
outputs:
|
|
10
10
|
release_created: ${{ steps.release.outputs.release_created }}
|
|
11
11
|
steps:
|
|
12
|
-
- uses: google-github-actions/release-please-action@
|
|
12
|
+
- uses: google-github-actions/release-please-action@v4
|
|
13
13
|
id: release
|
|
14
14
|
with:
|
|
15
15
|
release-type: node
|
|
@@ -32,9 +32,9 @@ jobs:
|
|
|
32
32
|
profile: minimal
|
|
33
33
|
override: true
|
|
34
34
|
- name: Checking out sources
|
|
35
|
-
uses: actions/checkout@
|
|
35
|
+
uses: actions/checkout@v4
|
|
36
36
|
- name: Cache Cargo
|
|
37
|
-
uses: actions/cache@
|
|
37
|
+
uses: actions/cache@v4
|
|
38
38
|
with:
|
|
39
39
|
path: |
|
|
40
40
|
~/.cargo/registry
|
|
@@ -57,9 +57,9 @@ jobs:
|
|
|
57
57
|
if: needs.release-please.outputs.release_created
|
|
58
58
|
steps:
|
|
59
59
|
- name: Checking out sources
|
|
60
|
-
uses: actions/checkout@
|
|
60
|
+
uses: actions/checkout@v4
|
|
61
61
|
- name: Set up Node
|
|
62
|
-
uses: actions/setup-node@
|
|
62
|
+
uses: actions/setup-node@v4.0.2
|
|
63
63
|
with:
|
|
64
64
|
node-version: '16'
|
|
65
65
|
registry-url: 'https://registry.npmjs.org'
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2.3.0](https://github.com/polarmutex/tree-sitter-beancount/compare/v2.2.0...v2.3.0) (2024-02-29)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* Add swift bindings ([0e08ee4](https://github.com/polarmutex/tree-sitter-beancount/commit/0e08ee4212edef5088bb3dd93ab0ba01f94792b0))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* remove unneeded excludes ([cd08aef](https://github.com/polarmutex/tree-sitter-beancount/commit/cd08aefa20dc0f3d5984b08b5d468f75bf4fd096))
|
|
14
|
+
|
|
15
|
+
## [2.2.0](https://github.com/polarmutex/tree-sitter-beancount/compare/v2.1.3...v2.2.0) (2023-10-10)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
* add named field for narration and payee ([0631b99](https://github.com/polarmutex/tree-sitter-beancount/commit/0631b99d9096e10f4e289efe618e518debe918b4))
|
|
21
|
+
|
|
3
22
|
## [2.1.3](https://github.com/polarmutex/tree-sitter-beancount/compare/v2.1.2...v2.1.3) (2023-07-02)
|
|
4
23
|
|
|
5
24
|
|
package/Cargo.toml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "tree-sitter-beancount"
|
|
3
3
|
description = "beancount grammar for the tree-sitter parsing library"
|
|
4
|
-
version = "2.
|
|
4
|
+
version = "2.2.0" # {x-release-please-version}
|
|
5
5
|
keywords = ["incremental", "parsing", "beancount", "tree-sitter"]
|
|
6
6
|
categories = ["parsing", "text-editors"]
|
|
7
7
|
repository = "https://github.com/polarmutex/tree-sitter-beancount"
|
package/Package.swift
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// swift-tools-version:5.3
|
|
2
|
+
import PackageDescription
|
|
3
|
+
|
|
4
|
+
let package = Package(
|
|
5
|
+
name: "TreeSitterBeancount",
|
|
6
|
+
products: [
|
|
7
|
+
.library(name: "TreeSitterBeancount", targets: ["TreeSitterBeancount"]),
|
|
8
|
+
],
|
|
9
|
+
dependencies: [],
|
|
10
|
+
targets: [
|
|
11
|
+
.target(name: "TreeSitterBeancount",
|
|
12
|
+
path: ".",
|
|
13
|
+
sources: [
|
|
14
|
+
"src/parser.c",
|
|
15
|
+
"src/scanner.cc",
|
|
16
|
+
],
|
|
17
|
+
publicHeadersPath: "bindings/swift",
|
|
18
|
+
cSettings: [.headerSearchPath("src")])
|
|
19
|
+
]
|
|
20
|
+
)
|
package/binding.gyp
CHANGED
package/bindings/rust/build.rs
CHANGED
|
@@ -25,6 +25,7 @@ fn main() {
|
|
|
25
25
|
// If your language uses an external scanner written in C++,
|
|
26
26
|
// then include this block of code:
|
|
27
27
|
|
|
28
|
+
/*
|
|
28
29
|
let mut cpp_config = cc::Build::new();
|
|
29
30
|
cpp_config.cpp(true);
|
|
30
31
|
cpp_config.include(&src_dir);
|
|
@@ -35,4 +36,5 @@ fn main() {
|
|
|
35
36
|
cpp_config.file(&scanner_path);
|
|
36
37
|
cpp_config.compile("scanner");
|
|
37
38
|
println!("cargo:rerun-if-changed={}", scanner_path.to_str().unwrap());
|
|
39
|
+
*/
|
|
38
40
|
}
|
package/flake.lock
CHANGED
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
"flake-compat": {
|
|
4
4
|
"flake": false,
|
|
5
5
|
"locked": {
|
|
6
|
-
"lastModified":
|
|
7
|
-
"narHash": "sha256-
|
|
6
|
+
"lastModified": 1696426674,
|
|
7
|
+
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
|
|
8
8
|
"owner": "edolstra",
|
|
9
9
|
"repo": "flake-compat",
|
|
10
|
-
"rev": "
|
|
10
|
+
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
|
|
11
11
|
"type": "github"
|
|
12
12
|
},
|
|
13
13
|
"original": {
|
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
"systems": "systems"
|
|
22
22
|
},
|
|
23
23
|
"locked": {
|
|
24
|
-
"lastModified":
|
|
25
|
-
"narHash": "sha256-
|
|
24
|
+
"lastModified": 1709126324,
|
|
25
|
+
"narHash": "sha256-q6EQdSeUZOG26WelxqkmR7kArjgWCdw5sfJVHPH/7j8=",
|
|
26
26
|
"owner": "numtide",
|
|
27
27
|
"repo": "flake-utils",
|
|
28
|
-
"rev": "
|
|
28
|
+
"rev": "d465f4819400de7c8d874d50b982301f28a84605",
|
|
29
29
|
"type": "github"
|
|
30
30
|
},
|
|
31
31
|
"original": {
|
|
@@ -42,11 +42,11 @@
|
|
|
42
42
|
]
|
|
43
43
|
},
|
|
44
44
|
"locked": {
|
|
45
|
-
"lastModified":
|
|
46
|
-
"narHash": "sha256-
|
|
45
|
+
"lastModified": 1703887061,
|
|
46
|
+
"narHash": "sha256-gGPa9qWNc6eCXT/+Z5/zMkyYOuRZqeFZBDbopNZQkuY=",
|
|
47
47
|
"owner": "hercules-ci",
|
|
48
48
|
"repo": "gitignore.nix",
|
|
49
|
-
"rev": "
|
|
49
|
+
"rev": "43e1aa1308018f37118e34d3a9cb4f5e75dc11d5",
|
|
50
50
|
"type": "github"
|
|
51
51
|
},
|
|
52
52
|
"original": {
|
|
@@ -57,11 +57,11 @@
|
|
|
57
57
|
},
|
|
58
58
|
"nixpkgs": {
|
|
59
59
|
"locked": {
|
|
60
|
-
"lastModified":
|
|
61
|
-
"narHash": "sha256-
|
|
60
|
+
"lastModified": 1708984720,
|
|
61
|
+
"narHash": "sha256-gJctErLbXx4QZBBbGp78PxtOOzsDaQ+yw1ylNQBuSUY=",
|
|
62
62
|
"owner": "NixOS",
|
|
63
63
|
"repo": "nixpkgs",
|
|
64
|
-
"rev": "
|
|
64
|
+
"rev": "13aff9b34cc32e59d35c62ac9356e4a41198a538",
|
|
65
65
|
"type": "github"
|
|
66
66
|
},
|
|
67
67
|
"original": {
|
|
@@ -73,16 +73,16 @@
|
|
|
73
73
|
},
|
|
74
74
|
"nixpkgs-stable": {
|
|
75
75
|
"locked": {
|
|
76
|
-
"lastModified":
|
|
77
|
-
"narHash": "sha256-
|
|
76
|
+
"lastModified": 1704874635,
|
|
77
|
+
"narHash": "sha256-YWuCrtsty5vVZvu+7BchAxmcYzTMfolSPP5io8+WYCg=",
|
|
78
78
|
"owner": "NixOS",
|
|
79
79
|
"repo": "nixpkgs",
|
|
80
|
-
"rev": "
|
|
80
|
+
"rev": "3dc440faeee9e889fe2d1b4d25ad0f430d449356",
|
|
81
81
|
"type": "github"
|
|
82
82
|
},
|
|
83
83
|
"original": {
|
|
84
84
|
"owner": "NixOS",
|
|
85
|
-
"ref": "nixos-23.
|
|
85
|
+
"ref": "nixos-23.11",
|
|
86
86
|
"repo": "nixpkgs",
|
|
87
87
|
"type": "github"
|
|
88
88
|
}
|
|
@@ -100,11 +100,11 @@
|
|
|
100
100
|
"nixpkgs-stable": "nixpkgs-stable"
|
|
101
101
|
},
|
|
102
102
|
"locked": {
|
|
103
|
-
"lastModified":
|
|
104
|
-
"narHash": "sha256-
|
|
103
|
+
"lastModified": 1708018599,
|
|
104
|
+
"narHash": "sha256-M+Ng6+SePmA8g06CmUZWi1AjG2tFBX9WCXElBHEKnyM=",
|
|
105
105
|
"owner": "cachix",
|
|
106
106
|
"repo": "pre-commit-hooks.nix",
|
|
107
|
-
"rev": "
|
|
107
|
+
"rev": "5df5a70ad7575f6601d91f0efec95dd9bc619431",
|
|
108
108
|
"type": "github"
|
|
109
109
|
},
|
|
110
110
|
"original": {
|
package/flake.nix
CHANGED
|
@@ -82,13 +82,8 @@
|
|
|
82
82
|
nativeBuildInputs = with pkgs; [
|
|
83
83
|
nodejs
|
|
84
84
|
nodePackages.node-gyp
|
|
85
|
-
#
|
|
86
|
-
|
|
87
|
-
#rustc
|
|
88
|
-
#cargo
|
|
89
|
-
#rustfmt
|
|
90
|
-
#clippy
|
|
91
|
-
(tree-sitter.overrideAttrs (_: {webUISupport = true;}))
|
|
85
|
+
# broken (tree-sitter.override {webUISupport = true;})
|
|
86
|
+
tree-sitter
|
|
92
87
|
];
|
|
93
88
|
|
|
94
89
|
inherit (checks.pre-commit) shellHook;
|
|
@@ -98,7 +93,11 @@
|
|
|
98
93
|
packages = {
|
|
99
94
|
default = packages.tree-sitter-beancount;
|
|
100
95
|
|
|
101
|
-
|
|
96
|
+
tree-sitter-beancount = pkgs.callPackage (nixpkgs + "/pkgs/development/tools/parsing/tree-sitter/grammar.nix") {} {
|
|
97
|
+
language = "beancount";
|
|
98
|
+
src = ./.;
|
|
99
|
+
inherit (pkgs.tree-sitter) version;
|
|
100
|
+
};
|
|
102
101
|
|
|
103
102
|
inherit (pkgs) tree-sitter;
|
|
104
103
|
};
|
package/grammar.js
CHANGED
|
@@ -169,10 +169,10 @@ module.exports = grammar({
|
|
|
169
169
|
_txn_strings: $ =>
|
|
170
170
|
choice(
|
|
171
171
|
seq(
|
|
172
|
-
alias($.string, $.payee),
|
|
173
|
-
alias($.string, $.narration),
|
|
172
|
+
field("payee", alias($.string, $.payee)),
|
|
173
|
+
field("narration", alias($.string, $.narration)),
|
|
174
174
|
),
|
|
175
|
-
alias($.string, $.narration),
|
|
175
|
+
field("narration", alias($.string, $.narration)),
|
|
176
176
|
),
|
|
177
177
|
|
|
178
178
|
// OPTIONAL
|
package/package.json
CHANGED
package/src/grammar.json
CHANGED
|
@@ -474,33 +474,45 @@
|
|
|
474
474
|
"type": "SEQ",
|
|
475
475
|
"members": [
|
|
476
476
|
{
|
|
477
|
-
"type": "
|
|
477
|
+
"type": "FIELD",
|
|
478
|
+
"name": "payee",
|
|
478
479
|
"content": {
|
|
479
|
-
"type": "
|
|
480
|
-
"
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
480
|
+
"type": "ALIAS",
|
|
481
|
+
"content": {
|
|
482
|
+
"type": "SYMBOL",
|
|
483
|
+
"name": "string"
|
|
484
|
+
},
|
|
485
|
+
"named": true,
|
|
486
|
+
"value": "payee"
|
|
487
|
+
}
|
|
484
488
|
},
|
|
485
489
|
{
|
|
486
|
-
"type": "
|
|
490
|
+
"type": "FIELD",
|
|
491
|
+
"name": "narration",
|
|
487
492
|
"content": {
|
|
488
|
-
"type": "
|
|
489
|
-
"
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
+
"type": "ALIAS",
|
|
494
|
+
"content": {
|
|
495
|
+
"type": "SYMBOL",
|
|
496
|
+
"name": "string"
|
|
497
|
+
},
|
|
498
|
+
"named": true,
|
|
499
|
+
"value": "narration"
|
|
500
|
+
}
|
|
493
501
|
}
|
|
494
502
|
]
|
|
495
503
|
},
|
|
496
504
|
{
|
|
497
|
-
"type": "
|
|
505
|
+
"type": "FIELD",
|
|
506
|
+
"name": "narration",
|
|
498
507
|
"content": {
|
|
499
|
-
"type": "
|
|
500
|
-
"
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
508
|
+
"type": "ALIAS",
|
|
509
|
+
"content": {
|
|
510
|
+
"type": "SYMBOL",
|
|
511
|
+
"name": "string"
|
|
512
|
+
},
|
|
513
|
+
"named": true,
|
|
514
|
+
"value": "narration"
|
|
515
|
+
}
|
|
504
516
|
}
|
|
505
517
|
]
|
|
506
518
|
},
|
package/src/node-types.json
CHANGED
|
@@ -1349,6 +1349,26 @@
|
|
|
1349
1349
|
}
|
|
1350
1350
|
]
|
|
1351
1351
|
},
|
|
1352
|
+
"narration": {
|
|
1353
|
+
"multiple": false,
|
|
1354
|
+
"required": false,
|
|
1355
|
+
"types": [
|
|
1356
|
+
{
|
|
1357
|
+
"type": "narration",
|
|
1358
|
+
"named": true
|
|
1359
|
+
}
|
|
1360
|
+
]
|
|
1361
|
+
},
|
|
1362
|
+
"payee": {
|
|
1363
|
+
"multiple": false,
|
|
1364
|
+
"required": false,
|
|
1365
|
+
"types": [
|
|
1366
|
+
{
|
|
1367
|
+
"type": "payee",
|
|
1368
|
+
"named": true
|
|
1369
|
+
}
|
|
1370
|
+
]
|
|
1371
|
+
},
|
|
1352
1372
|
"tags_links": {
|
|
1353
1373
|
"multiple": false,
|
|
1354
1374
|
"required": false,
|
|
@@ -1382,14 +1402,6 @@
|
|
|
1382
1402
|
"type": "key_value",
|
|
1383
1403
|
"named": true
|
|
1384
1404
|
},
|
|
1385
|
-
{
|
|
1386
|
-
"type": "narration",
|
|
1387
|
-
"named": true
|
|
1388
|
-
},
|
|
1389
|
-
{
|
|
1390
|
-
"type": "payee",
|
|
1391
|
-
"named": true
|
|
1392
|
-
},
|
|
1393
1405
|
{
|
|
1394
1406
|
"type": "posting",
|
|
1395
1407
|
"named": true
|