tree-sitter-beancount 2.3.1 → 2.3.3

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.
@@ -1,11 +1,26 @@
1
1
  version: 2
2
2
  updates:
3
- - package-ecosystem: github-actions
3
+ - package-ecosystem: "cargo"
4
4
  directory: "/"
5
5
  schedule:
6
- interval: daily
7
- open-pull-requests-limit: 10
6
+ interval: "weekly"
8
7
  commit-message:
9
- prefix: "chore:"
8
+ prefix: "chore(deps):"
10
9
  labels:
11
- - dependabot
10
+ - "dependencies"
11
+ - "cargo"
12
+ groups:
13
+ cargo:
14
+ patterns: ["*"]
15
+ - package-ecosystem: "github-actions"
16
+ directory: "/"
17
+ schedule:
18
+ interval: "weekly"
19
+ commit-message:
20
+ prefix: "ci:"
21
+ labels:
22
+ - "dependencies"
23
+ - "github-actions"
24
+ groups:
25
+ actions:
26
+ patterns: ["*"]
@@ -15,7 +15,7 @@ jobs:
15
15
  uses: actions/checkout@v4
16
16
 
17
17
  - name: Setup Node
18
- uses: actions/setup-node@v4.0.2
18
+ uses: actions/setup-node@v4.0.3
19
19
  with:
20
20
  node-version: '18'
21
21
 
@@ -59,7 +59,7 @@ jobs:
59
59
  - name: Checking out sources
60
60
  uses: actions/checkout@v4
61
61
  - name: Set up Node
62
- uses: actions/setup-node@v4.0.2
62
+ uses: actions/setup-node@v4.0.3
63
63
  with:
64
64
  node-version: '16'
65
65
  registry-url: 'https://registry.npmjs.org'
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.3.3](https://github.com/polarmutex/tree-sitter-beancount/compare/v2.3.2...v2.3.3) (2024-07-20)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * support comments as part of key value lists ([c25f803](https://github.com/polarmutex/tree-sitter-beancount/commit/c25f8034c977681653a8acd541c8b4877a58f474))
9
+ * support embedded escaped quotes in strings ([9f6eb73](https://github.com/polarmutex/tree-sitter-beancount/commit/9f6eb73b2cc06325f6c31f9c58f84ba802a88fd0))
10
+
11
+ ## [2.3.2](https://github.com/polarmutex/tree-sitter-beancount/compare/v2.3.1...v2.3.2) (2024-03-09)
12
+
13
+
14
+ ### Bug Fixes
15
+
16
+ * binding and lock files for rust ([0727d62](https://github.com/polarmutex/tree-sitter-beancount/commit/0727d62af0dea0a78bbf132f53876888fc656c19))
17
+ * fix other scanner.cc references ([1f19abf](https://github.com/polarmutex/tree-sitter-beancount/commit/1f19abf1e162e1828013cb5434c6cf30f4054e80))
18
+
3
19
  ## [2.3.1](https://github.com/polarmutex/tree-sitter-beancount/compare/v2.3.0...v2.3.1) (2024-02-29)
4
20
 
5
21
 
package/Cargo.lock CHANGED
@@ -4,30 +4,42 @@ version = 3
4
4
 
5
5
  [[package]]
6
6
  name = "aho-corasick"
7
- version = "0.7.20"
7
+ version = "1.1.3"
8
8
  source = "registry+https://github.com/rust-lang/crates.io-index"
9
- checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac"
9
+ checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916"
10
10
  dependencies = [
11
11
  "memchr",
12
12
  ]
13
13
 
14
14
  [[package]]
15
15
  name = "cc"
16
- version = "1.0.78"
16
+ version = "1.1.6"
17
17
  source = "registry+https://github.com/rust-lang/crates.io-index"
18
- checksum = "a20104e2335ce8a659d6dd92a51a767a0c062599c73b343fd152cb401e828c3d"
18
+ checksum = "2aba8f4e9906c7ce3c73463f62a7f0c65183ada1a2d47e397cc8810827f9694f"
19
19
 
20
20
  [[package]]
21
21
  name = "memchr"
22
- version = "2.5.0"
22
+ version = "2.7.4"
23
23
  source = "registry+https://github.com/rust-lang/crates.io-index"
24
- checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d"
24
+ checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3"
25
25
 
26
26
  [[package]]
27
27
  name = "regex"
28
- version = "1.7.1"
28
+ version = "1.10.5"
29
29
  source = "registry+https://github.com/rust-lang/crates.io-index"
30
- checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733"
30
+ checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f"
31
+ dependencies = [
32
+ "aho-corasick",
33
+ "memchr",
34
+ "regex-automata",
35
+ "regex-syntax",
36
+ ]
37
+
38
+ [[package]]
39
+ name = "regex-automata"
40
+ version = "0.4.7"
41
+ source = "registry+https://github.com/rust-lang/crates.io-index"
42
+ checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df"
31
43
  dependencies = [
32
44
  "aho-corasick",
33
45
  "memchr",
@@ -36,15 +48,15 @@ dependencies = [
36
48
 
37
49
  [[package]]
38
50
  name = "regex-syntax"
39
- version = "0.6.28"
51
+ version = "0.8.4"
40
52
  source = "registry+https://github.com/rust-lang/crates.io-index"
41
- checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848"
53
+ checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b"
42
54
 
43
55
  [[package]]
44
56
  name = "tree-sitter"
45
- version = "0.20.9"
57
+ version = "0.22.6"
46
58
  source = "registry+https://github.com/rust-lang/crates.io-index"
47
- checksum = "d4423c784fe11398ca91e505cdc71356b07b1a924fc8735cfab5333afe3e18bc"
59
+ checksum = "df7cc499ceadd4dcdf7ec6d4cbc34ece92c3fa07821e287aedecd4416c516dca"
48
60
  dependencies = [
49
61
  "cc",
50
62
  "regex",
@@ -52,7 +64,7 @@ dependencies = [
52
64
 
53
65
  [[package]]
54
66
  name = "tree-sitter-beancount"
55
- version = "2.1.1"
67
+ version = "2.3.2"
56
68
  dependencies = [
57
69
  "cc",
58
70
  "tree-sitter",
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.3.1" # {x-release-please-version}
4
+ version = "2.3.2" # {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"
@@ -20,7 +20,7 @@ include = [
20
20
  path = "bindings/rust/lib.rs"
21
21
 
22
22
  [dependencies]
23
- tree-sitter = "~0.20.0"
23
+ tree-sitter = "~0.22.6"
24
24
 
25
25
  [build-dependencies]
26
26
  cc = "1.0"
package/Package.swift CHANGED
@@ -12,7 +12,7 @@ let package = Package(
12
12
  path: ".",
13
13
  sources: [
14
14
  "src/parser.c",
15
- "src/scanner.cc",
15
+ "src/scanner.c",
16
16
  ],
17
17
  publicHeadersPath: "bindings/swift",
18
18
  cSettings: [.headerSearchPath("src")])
package/binding.gyp CHANGED
@@ -10,6 +10,7 @@
10
10
  "bindings/node/binding.cc",
11
11
  # If your language uses an external scanner, add it here.
12
12
  "src/parser.c",
13
+ # "src/scanner.c",
13
14
  ],
14
15
  "cflags_c": [
15
16
  "-std=c99",
@@ -6,18 +6,17 @@ fn main() {
6
6
  c_config
7
7
  .flag_if_supported("-Wno-unused-parameter")
8
8
  .flag_if_supported("-Wno-unused-but-set-variable")
9
- .flag_if_supported("-Wno-trigraphs");
9
+ .flag_if_supported("-Wno-trigraphs")
10
+ .flag_if_supported("-O");
10
11
  let parser_path = src_dir.join("parser.c");
11
12
  c_config.file(&parser_path);
12
13
 
13
14
  // If your language uses an external scanner written in C,
14
15
  // then include this block of code:
15
16
 
16
- /*
17
17
  let scanner_path = src_dir.join("scanner.c");
18
18
  c_config.file(&scanner_path);
19
19
  println!("cargo:rerun-if-changed={}", scanner_path.to_str().unwrap());
20
- */
21
20
 
22
21
  c_config.compile("parser");
23
22
  println!("cargo:rerun-if-changed={}", parser_path.to_str().unwrap());
package/flake.nix CHANGED
@@ -84,6 +84,7 @@
84
84
  nodePackages.node-gyp
85
85
  # broken (tree-sitter.override {webUISupport = true;})
86
86
  tree-sitter
87
+ cargo
87
88
  ];
88
89
 
89
90
  inherit (checks.pre-commit) shellHook;
package/grammar.js CHANGED
@@ -94,7 +94,7 @@ module.exports = grammar({
94
94
  ),
95
95
  ),
96
96
  currency: $ => token(/[A-Z][A-Z0-9\'\._\-]{0,22}[A-Z0-9]/),
97
- string: $ => token(/"[^"]*"/),
97
+ string: $ => token(/"([^"]|\\")*"/),
98
98
  number: $ => token(/([0-9]+|[0-9][0-9,]+[0-9])(\.[0-9]*)?/),
99
99
  tag: $ => token(/#[A-Za-z0-9\-_/.]+/),
100
100
  link: $ => token(/\^[A-Za-z0-9\-_/.]+/),
@@ -211,7 +211,7 @@ module.exports = grammar({
211
211
  $.posting,
212
212
  seq(
213
213
  $._indent,
214
- $.comment,
214
+ field("comment", $.comment),
215
215
  $._eol
216
216
  )
217
217
  )
@@ -326,7 +326,12 @@ module.exports = grammar({
326
326
  ),
327
327
  seq(
328
328
  $._key_value_line
329
- )
329
+ ),
330
+ seq(
331
+ $._indent,
332
+ field("comment", $.comment),
333
+ $._eol
334
+ ),
330
335
  )
331
336
  ),
332
337
 
@@ -522,6 +527,7 @@ module.exports = grammar({
522
527
  "price",
523
528
  field("currency", $.currency),
524
529
  field("amount", $.amount),
530
+ field("comment", optional($.comment)),
525
531
  $._eol,
526
532
  optional($._key_value_list)
527
533
  ),
@@ -532,6 +538,7 @@ module.exports = grammar({
532
538
  "event",
533
539
  field("type", $.string),
534
540
  field("desc", $.string),
541
+ field("comment", optional($.comment)),
535
542
  $._eol,
536
543
  optional($._key_value_list)
537
544
  ),
@@ -542,6 +549,7 @@ module.exports = grammar({
542
549
  "query",
543
550
  field("name", $.string),
544
551
  field("query", $.string),
552
+ field("comment", optional($.comment)),
545
553
  $._eol,
546
554
  optional($._key_value_list)
547
555
  ),
@@ -552,6 +560,7 @@ module.exports = grammar({
552
560
  "note",
553
561
  field("account", $.account),
554
562
  field("note", $.string),
563
+ field("comment", optional($.comment)),
555
564
  $._eol,
556
565
  optional($._key_value_list)
557
566
  ),
@@ -565,6 +574,7 @@ module.exports = grammar({
565
574
  field("account", $.account),
566
575
  field("filename", $.filename),
567
576
  field("tags_links", optional($.tags_links)),
577
+ field("comment", optional($.comment)),
568
578
  $._eol,
569
579
  optional($._key_value_list)
570
580
  ),
@@ -590,6 +600,7 @@ module.exports = grammar({
590
600
  $.custom_value
591
601
  ),
592
602
  )),
603
+ field("comment", optional($.comment)),
593
604
  $._eol,
594
605
  optional($._key_value_list)
595
606
  ),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tree-sitter-beancount",
3
- "version": "2.3.1",
3
+ "version": "2.3.3",
4
4
  "description": "a tree-sitter parser for the beancount syntax",
5
5
  "main": "bindings/node",
6
6
  "scripts": {
package/src/grammar.json CHANGED
@@ -256,7 +256,7 @@
256
256
  "type": "TOKEN",
257
257
  "content": {
258
258
  "type": "PATTERN",
259
- "value": "\"[^\"]*\""
259
+ "value": "\"([^\"]|\\\\\")*\""
260
260
  }
261
261
  },
262
262
  "number": {
@@ -653,8 +653,12 @@
653
653
  "name": "_indent"
654
654
  },
655
655
  {
656
- "type": "SYMBOL",
657
- "name": "comment"
656
+ "type": "FIELD",
657
+ "name": "comment",
658
+ "content": {
659
+ "type": "SYMBOL",
660
+ "name": "comment"
661
+ }
658
662
  },
659
663
  {
660
664
  "type": "SYMBOL",
@@ -1174,6 +1178,27 @@
1174
1178
  "name": "_key_value_line"
1175
1179
  }
1176
1180
  ]
1181
+ },
1182
+ {
1183
+ "type": "SEQ",
1184
+ "members": [
1185
+ {
1186
+ "type": "SYMBOL",
1187
+ "name": "_indent"
1188
+ },
1189
+ {
1190
+ "type": "FIELD",
1191
+ "name": "comment",
1192
+ "content": {
1193
+ "type": "SYMBOL",
1194
+ "name": "comment"
1195
+ }
1196
+ },
1197
+ {
1198
+ "type": "SYMBOL",
1199
+ "name": "_eol"
1200
+ }
1201
+ ]
1177
1202
  }
1178
1203
  ]
1179
1204
  }
@@ -1920,6 +1945,22 @@
1920
1945
  "name": "amount"
1921
1946
  }
1922
1947
  },
1948
+ {
1949
+ "type": "FIELD",
1950
+ "name": "comment",
1951
+ "content": {
1952
+ "type": "CHOICE",
1953
+ "members": [
1954
+ {
1955
+ "type": "SYMBOL",
1956
+ "name": "comment"
1957
+ },
1958
+ {
1959
+ "type": "BLANK"
1960
+ }
1961
+ ]
1962
+ }
1963
+ },
1923
1964
  {
1924
1965
  "type": "SYMBOL",
1925
1966
  "name": "_eol"
@@ -1969,6 +2010,22 @@
1969
2010
  "name": "string"
1970
2011
  }
1971
2012
  },
2013
+ {
2014
+ "type": "FIELD",
2015
+ "name": "comment",
2016
+ "content": {
2017
+ "type": "CHOICE",
2018
+ "members": [
2019
+ {
2020
+ "type": "SYMBOL",
2021
+ "name": "comment"
2022
+ },
2023
+ {
2024
+ "type": "BLANK"
2025
+ }
2026
+ ]
2027
+ }
2028
+ },
1972
2029
  {
1973
2030
  "type": "SYMBOL",
1974
2031
  "name": "_eol"
@@ -2018,6 +2075,22 @@
2018
2075
  "name": "string"
2019
2076
  }
2020
2077
  },
2078
+ {
2079
+ "type": "FIELD",
2080
+ "name": "comment",
2081
+ "content": {
2082
+ "type": "CHOICE",
2083
+ "members": [
2084
+ {
2085
+ "type": "SYMBOL",
2086
+ "name": "comment"
2087
+ },
2088
+ {
2089
+ "type": "BLANK"
2090
+ }
2091
+ ]
2092
+ }
2093
+ },
2021
2094
  {
2022
2095
  "type": "SYMBOL",
2023
2096
  "name": "_eol"
@@ -2067,6 +2140,22 @@
2067
2140
  "name": "string"
2068
2141
  }
2069
2142
  },
2143
+ {
2144
+ "type": "FIELD",
2145
+ "name": "comment",
2146
+ "content": {
2147
+ "type": "CHOICE",
2148
+ "members": [
2149
+ {
2150
+ "type": "SYMBOL",
2151
+ "name": "comment"
2152
+ },
2153
+ {
2154
+ "type": "BLANK"
2155
+ }
2156
+ ]
2157
+ }
2158
+ },
2070
2159
  {
2071
2160
  "type": "SYMBOL",
2072
2161
  "name": "_eol"
@@ -2136,6 +2225,22 @@
2136
2225
  ]
2137
2226
  }
2138
2227
  },
2228
+ {
2229
+ "type": "FIELD",
2230
+ "name": "comment",
2231
+ "content": {
2232
+ "type": "CHOICE",
2233
+ "members": [
2234
+ {
2235
+ "type": "SYMBOL",
2236
+ "name": "comment"
2237
+ },
2238
+ {
2239
+ "type": "BLANK"
2240
+ }
2241
+ ]
2242
+ }
2243
+ },
2139
2244
  {
2140
2245
  "type": "SYMBOL",
2141
2246
  "name": "_eol"
@@ -2225,6 +2330,22 @@
2225
2330
  ]
2226
2331
  }
2227
2332
  },
2333
+ {
2334
+ "type": "FIELD",
2335
+ "name": "comment",
2336
+ "content": {
2337
+ "type": "CHOICE",
2338
+ "members": [
2339
+ {
2340
+ "type": "SYMBOL",
2341
+ "name": "comment"
2342
+ },
2343
+ {
2344
+ "type": "BLANK"
2345
+ }
2346
+ ]
2347
+ }
2348
+ },
2228
2349
  {
2229
2350
  "type": "SYMBOL",
2230
2351
  "name": "_eol"
@@ -171,7 +171,7 @@
171
171
  ]
172
172
  },
173
173
  "comment": {
174
- "multiple": false,
174
+ "multiple": true,
175
175
  "required": false,
176
176
  "types": [
177
177
  {
@@ -256,7 +256,7 @@
256
256
  ]
257
257
  },
258
258
  "comment": {
259
- "multiple": false,
259
+ "multiple": true,
260
260
  "required": false,
261
261
  "types": [
262
262
  {
@@ -297,7 +297,7 @@
297
297
  "named": true,
298
298
  "fields": {
299
299
  "comment": {
300
- "multiple": false,
300
+ "multiple": true,
301
301
  "required": false,
302
302
  "types": [
303
303
  {
@@ -453,6 +453,16 @@
453
453
  "type": "custom",
454
454
  "named": true,
455
455
  "fields": {
456
+ "comment": {
457
+ "multiple": true,
458
+ "required": false,
459
+ "types": [
460
+ {
461
+ "type": "comment",
462
+ "named": true
463
+ }
464
+ ]
465
+ },
456
466
  "custom_value_list": {
457
467
  "multiple": true,
458
468
  "required": false,
@@ -552,6 +562,16 @@
552
562
  }
553
563
  ]
554
564
  },
565
+ "comment": {
566
+ "multiple": true,
567
+ "required": false,
568
+ "types": [
569
+ {
570
+ "type": "comment",
571
+ "named": true
572
+ }
573
+ ]
574
+ },
555
575
  "date": {
556
576
  "multiple": false,
557
577
  "required": true,
@@ -598,6 +618,16 @@
598
618
  "type": "event",
599
619
  "named": true,
600
620
  "fields": {
621
+ "comment": {
622
+ "multiple": true,
623
+ "required": false,
624
+ "types": [
625
+ {
626
+ "type": "comment",
627
+ "named": true
628
+ }
629
+ ]
630
+ },
601
631
  "date": {
602
632
  "multiple": false,
603
633
  "required": true,
@@ -782,6 +812,16 @@
782
812
  }
783
813
  ]
784
814
  },
815
+ "comment": {
816
+ "multiple": true,
817
+ "required": false,
818
+ "types": [
819
+ {
820
+ "type": "comment",
821
+ "named": true
822
+ }
823
+ ]
824
+ },
785
825
  "date": {
786
826
  "multiple": false,
787
827
  "required": true,
@@ -829,7 +869,7 @@
829
869
  ]
830
870
  },
831
871
  "comment": {
832
- "multiple": false,
872
+ "multiple": true,
833
873
  "required": false,
834
874
  "types": [
835
875
  {
@@ -955,7 +995,7 @@
955
995
  ]
956
996
  },
957
997
  "comment": {
958
- "multiple": false,
998
+ "multiple": true,
959
999
  "required": false,
960
1000
  "types": [
961
1001
  {
@@ -1135,6 +1175,16 @@
1135
1175
  }
1136
1176
  ]
1137
1177
  },
1178
+ "comment": {
1179
+ "multiple": true,
1180
+ "required": false,
1181
+ "types": [
1182
+ {
1183
+ "type": "comment",
1184
+ "named": true
1185
+ }
1186
+ ]
1187
+ },
1138
1188
  "currency": {
1139
1189
  "multiple": false,
1140
1190
  "required": true,
@@ -1216,6 +1266,16 @@
1216
1266
  "type": "query",
1217
1267
  "named": true,
1218
1268
  "fields": {
1269
+ "comment": {
1270
+ "multiple": true,
1271
+ "required": false,
1272
+ "types": [
1273
+ {
1274
+ "type": "comment",
1275
+ "named": true
1276
+ }
1277
+ ]
1278
+ },
1219
1279
  "date": {
1220
1280
  "multiple": false,
1221
1281
  "required": true,
@@ -1330,7 +1390,7 @@
1330
1390
  "named": true,
1331
1391
  "fields": {
1332
1392
  "comment": {
1333
- "multiple": false,
1393
+ "multiple": true,
1334
1394
  "required": false,
1335
1395
  "types": [
1336
1396
  {
@@ -1394,10 +1454,6 @@
1394
1454
  "multiple": true,
1395
1455
  "required": false,
1396
1456
  "types": [
1397
- {
1398
- "type": "comment",
1399
- "named": true
1400
- },
1401
1457
  {
1402
1458
  "type": "key_value",
1403
1459
  "named": true