@willbooster/tree-sitter-bash 1.1.3 → 2.0.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/README.md +19 -8
- package/grammar.js +692 -550
- package/package.json +15 -20
- package/src/grammar.json +171 -14
- package/src/node-types.json +84 -13
- package/src/parser.c +170186 -133781
- package/src/scanner.c +466 -110
- package/tree-sitter-bash.wasm +0 -0
- package/tree-sitter.json +2 -2
- package/binding.gyp +0 -30
- package/bindings/node/binding.cc +0 -20
- package/bindings/node/binding_test.js +0 -9
- package/bindings/node/index.d.ts +0 -28
- package/bindings/node/index.js +0 -11
- package/prebuilds/darwin-arm64/tree-sitter-bash.node +0 -0
- package/prebuilds/darwin-x64/tree-sitter-bash.node +0 -0
- package/prebuilds/linux-arm64/tree-sitter-bash.node +0 -0
- package/prebuilds/linux-x64/tree-sitter-bash.node +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@willbooster/tree-sitter-bash",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Bash grammar for tree-sitter",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"incremental",
|
|
@@ -14,58 +14,53 @@
|
|
|
14
14
|
},
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"author": "WillBooster Inc.",
|
|
17
|
-
"main": "bindings/node",
|
|
18
|
-
"types": "bindings/node",
|
|
19
17
|
"files": [
|
|
20
18
|
"grammar.js",
|
|
21
19
|
"tree-sitter.json",
|
|
22
|
-
"binding.gyp",
|
|
23
|
-
"prebuilds/**",
|
|
24
|
-
"bindings/node/*",
|
|
25
20
|
"queries/*",
|
|
26
21
|
"src/**",
|
|
27
22
|
"*.wasm"
|
|
28
23
|
],
|
|
29
24
|
"scripts": {
|
|
30
|
-
"build-prebuilds": "prebuildify --napi --strip --name tree-sitter-bash",
|
|
31
25
|
"build-wasm": "tree-sitter build --wasm",
|
|
32
|
-
"build/ci": "tree-sitter generate &&
|
|
26
|
+
"build/ci": "tree-sitter generate && tree-sitter build --wasm",
|
|
33
27
|
"cleanup": "bun wb lint --fix --format",
|
|
34
28
|
"format": "bun wb lint --format",
|
|
35
|
-
"install": "node-gyp-build",
|
|
36
29
|
"lint": "bun wb lint",
|
|
37
30
|
"lint-fix": "bun wb lint --fix",
|
|
38
31
|
"prepare": "(bun lefthook install || true) && (test ! -f .lefthook/normalize-bun-lockfile.sh || bash .lefthook/normalize-bun-lockfile.sh)",
|
|
39
32
|
"release": "wb release",
|
|
40
|
-
"release-test": "node node_modules/semantic-release/bin/semantic-release.js --dry-run --plugins @semantic-release/commit-analyzer @semantic-release/release-notes-generator",
|
|
41
33
|
"prestart": "bun run build-wasm",
|
|
42
34
|
"start": "tree-sitter playground",
|
|
43
35
|
"test": "bun wb test",
|
|
44
36
|
"test/ci": "bun wb test-on-ci",
|
|
37
|
+
"typecheck": "bun wb typecheck",
|
|
45
38
|
"verify": "bun wb verify",
|
|
46
39
|
"verify-full": "bun wb verify --full"
|
|
47
40
|
},
|
|
48
|
-
"dependencies": {
|
|
49
|
-
"node-addon-api": "^8.2.1",
|
|
50
|
-
"node-gyp-build": "^4.8.2"
|
|
51
|
-
},
|
|
52
41
|
"devDependencies": {
|
|
53
42
|
"@semantic-release/exec": "7.1.0",
|
|
43
|
+
"@tsconfig/bun": "1.0.11",
|
|
44
|
+
"@types/bun": "1.4.2",
|
|
45
|
+
"@willbooster/oxfmt-config": "1.2.2",
|
|
46
|
+
"@willbooster/oxlint-config": "1.4.8",
|
|
54
47
|
"@willbooster/wb": "22.8.0",
|
|
55
48
|
"conventional-changelog-conventionalcommits": "10.4.0",
|
|
56
49
|
"lefthook": "2.1.14",
|
|
57
|
-
"
|
|
58
|
-
"
|
|
50
|
+
"oxfmt": "0.68.0",
|
|
51
|
+
"oxlint": "1.83.0",
|
|
52
|
+
"oxlint-tsgolint": "7.0.2002",
|
|
59
53
|
"semantic-release": "25.0.9",
|
|
60
54
|
"sort-package-json": "4.0.0",
|
|
61
|
-
"tree-sitter": "
|
|
62
|
-
"
|
|
55
|
+
"tree-sitter-cli": "0.27.0",
|
|
56
|
+
"typescript": "7.0.2",
|
|
57
|
+
"web-tree-sitter": "0.27.0"
|
|
63
58
|
},
|
|
64
59
|
"peerDependencies": {
|
|
65
|
-
"tree-sitter": "^0.
|
|
60
|
+
"web-tree-sitter": "^0.27.0"
|
|
66
61
|
},
|
|
67
62
|
"peerDependenciesMeta": {
|
|
68
|
-
"tree-sitter": {
|
|
63
|
+
"web-tree-sitter": {
|
|
69
64
|
"optional": true
|
|
70
65
|
}
|
|
71
66
|
},
|
package/src/grammar.json
CHANGED
|
@@ -1602,17 +1602,77 @@
|
|
|
1602
1602
|
"value": "=~"
|
|
1603
1603
|
}
|
|
1604
1604
|
},
|
|
1605
|
+
{
|
|
1606
|
+
"type": "SYMBOL",
|
|
1607
|
+
"name": "_regex_start"
|
|
1608
|
+
},
|
|
1605
1609
|
{
|
|
1606
1610
|
"type": "FIELD",
|
|
1607
1611
|
"name": "right",
|
|
1608
1612
|
"content": {
|
|
1609
|
-
"type": "
|
|
1610
|
-
"
|
|
1613
|
+
"type": "CHOICE",
|
|
1614
|
+
"members": [
|
|
1615
|
+
{
|
|
1616
|
+
"type": "SYMBOL",
|
|
1617
|
+
"name": "_regex_part"
|
|
1618
|
+
},
|
|
1619
|
+
{
|
|
1620
|
+
"type": "ALIAS",
|
|
1621
|
+
"content": {
|
|
1622
|
+
"type": "SYMBOL",
|
|
1623
|
+
"name": "_regex_concatenation"
|
|
1624
|
+
},
|
|
1625
|
+
"named": true,
|
|
1626
|
+
"value": "concatenation"
|
|
1627
|
+
}
|
|
1628
|
+
]
|
|
1629
|
+
}
|
|
1630
|
+
}
|
|
1631
|
+
]
|
|
1632
|
+
}
|
|
1633
|
+
},
|
|
1634
|
+
"_regex_concatenation": {
|
|
1635
|
+
"type": "PREC_RIGHT",
|
|
1636
|
+
"value": 0,
|
|
1637
|
+
"content": {
|
|
1638
|
+
"type": "SEQ",
|
|
1639
|
+
"members": [
|
|
1640
|
+
{
|
|
1641
|
+
"type": "SYMBOL",
|
|
1642
|
+
"name": "_regex_part"
|
|
1643
|
+
},
|
|
1644
|
+
{
|
|
1645
|
+
"type": "REPEAT1",
|
|
1646
|
+
"content": {
|
|
1647
|
+
"type": "SEQ",
|
|
1648
|
+
"members": [
|
|
1649
|
+
{
|
|
1650
|
+
"type": "SYMBOL",
|
|
1651
|
+
"name": "_regex_concat"
|
|
1652
|
+
},
|
|
1653
|
+
{
|
|
1654
|
+
"type": "SYMBOL",
|
|
1655
|
+
"name": "_regex_part"
|
|
1656
|
+
}
|
|
1657
|
+
]
|
|
1611
1658
|
}
|
|
1612
1659
|
}
|
|
1613
1660
|
]
|
|
1614
1661
|
}
|
|
1615
1662
|
},
|
|
1663
|
+
"_regex_part": {
|
|
1664
|
+
"type": "CHOICE",
|
|
1665
|
+
"members": [
|
|
1666
|
+
{
|
|
1667
|
+
"type": "SYMBOL",
|
|
1668
|
+
"name": "regex"
|
|
1669
|
+
},
|
|
1670
|
+
{
|
|
1671
|
+
"type": "SYMBOL",
|
|
1672
|
+
"name": "_quoted_or_expansion"
|
|
1673
|
+
}
|
|
1674
|
+
]
|
|
1675
|
+
},
|
|
1616
1676
|
"_test_negation": {
|
|
1617
1677
|
"type": "PREC",
|
|
1618
1678
|
"value": 14,
|
|
@@ -2881,12 +2941,72 @@
|
|
|
2881
2941
|
]
|
|
2882
2942
|
},
|
|
2883
2943
|
"raw_string": {
|
|
2884
|
-
"type": "
|
|
2885
|
-
"
|
|
2944
|
+
"type": "CHOICE",
|
|
2945
|
+
"members": [
|
|
2946
|
+
{
|
|
2947
|
+
"type": "PATTERN",
|
|
2948
|
+
"value": "'[^']*'"
|
|
2949
|
+
},
|
|
2950
|
+
{
|
|
2951
|
+
"type": "SEQ",
|
|
2952
|
+
"members": [
|
|
2953
|
+
{
|
|
2954
|
+
"type": "SYMBOL",
|
|
2955
|
+
"name": "_closer_line_raw_string_start"
|
|
2956
|
+
},
|
|
2957
|
+
{
|
|
2958
|
+
"type": "REPEAT",
|
|
2959
|
+
"content": {
|
|
2960
|
+
"type": "ALIAS",
|
|
2961
|
+
"content": {
|
|
2962
|
+
"type": "SYMBOL",
|
|
2963
|
+
"name": "_closer_line_raw_string_content"
|
|
2964
|
+
},
|
|
2965
|
+
"named": true,
|
|
2966
|
+
"value": "string_content"
|
|
2967
|
+
}
|
|
2968
|
+
},
|
|
2969
|
+
{
|
|
2970
|
+
"type": "STRING",
|
|
2971
|
+
"value": "'"
|
|
2972
|
+
}
|
|
2973
|
+
]
|
|
2974
|
+
}
|
|
2975
|
+
]
|
|
2886
2976
|
},
|
|
2887
2977
|
"ansi_c_string": {
|
|
2888
|
-
"type": "
|
|
2889
|
-
"
|
|
2978
|
+
"type": "CHOICE",
|
|
2979
|
+
"members": [
|
|
2980
|
+
{
|
|
2981
|
+
"type": "PATTERN",
|
|
2982
|
+
"value": "\\$'([^'\\\\]|\\\\(.|\\n))*'"
|
|
2983
|
+
},
|
|
2984
|
+
{
|
|
2985
|
+
"type": "SEQ",
|
|
2986
|
+
"members": [
|
|
2987
|
+
{
|
|
2988
|
+
"type": "SYMBOL",
|
|
2989
|
+
"name": "_closer_line_ansi_c_string_start"
|
|
2990
|
+
},
|
|
2991
|
+
{
|
|
2992
|
+
"type": "REPEAT",
|
|
2993
|
+
"content": {
|
|
2994
|
+
"type": "ALIAS",
|
|
2995
|
+
"content": {
|
|
2996
|
+
"type": "SYMBOL",
|
|
2997
|
+
"name": "_closer_line_ansi_c_string_content"
|
|
2998
|
+
},
|
|
2999
|
+
"named": true,
|
|
3000
|
+
"value": "string_content"
|
|
3001
|
+
}
|
|
3002
|
+
},
|
|
3003
|
+
{
|
|
3004
|
+
"type": "STRING",
|
|
3005
|
+
"value": "'"
|
|
3006
|
+
}
|
|
3007
|
+
]
|
|
3008
|
+
}
|
|
3009
|
+
]
|
|
2890
3010
|
},
|
|
2891
3011
|
"translated_string": {
|
|
2892
3012
|
"type": "SEQ",
|
|
@@ -4689,15 +4809,24 @@
|
|
|
4689
4809
|
]
|
|
4690
4810
|
},
|
|
4691
4811
|
"comment": {
|
|
4692
|
-
"type": "
|
|
4693
|
-
"
|
|
4694
|
-
|
|
4695
|
-
|
|
4696
|
-
|
|
4697
|
-
|
|
4698
|
-
|
|
4812
|
+
"type": "CHOICE",
|
|
4813
|
+
"members": [
|
|
4814
|
+
{
|
|
4815
|
+
"type": "TOKEN",
|
|
4816
|
+
"content": {
|
|
4817
|
+
"type": "PREC",
|
|
4818
|
+
"value": -10,
|
|
4819
|
+
"content": {
|
|
4820
|
+
"type": "PATTERN",
|
|
4821
|
+
"value": "#.*"
|
|
4822
|
+
}
|
|
4823
|
+
}
|
|
4824
|
+
},
|
|
4825
|
+
{
|
|
4826
|
+
"type": "SYMBOL",
|
|
4827
|
+
"name": "_joined_comment"
|
|
4699
4828
|
}
|
|
4700
|
-
|
|
4829
|
+
]
|
|
4701
4830
|
}
|
|
4702
4831
|
},
|
|
4703
4832
|
"extras": [
|
|
@@ -4826,6 +4955,34 @@
|
|
|
4826
4955
|
"type": "SYMBOL",
|
|
4827
4956
|
"name": "_bracket_substitution_start"
|
|
4828
4957
|
},
|
|
4958
|
+
{
|
|
4959
|
+
"type": "SYMBOL",
|
|
4960
|
+
"name": "_regex_start"
|
|
4961
|
+
},
|
|
4962
|
+
{
|
|
4963
|
+
"type": "SYMBOL",
|
|
4964
|
+
"name": "_regex_concat"
|
|
4965
|
+
},
|
|
4966
|
+
{
|
|
4967
|
+
"type": "SYMBOL",
|
|
4968
|
+
"name": "_closer_line_raw_string_start"
|
|
4969
|
+
},
|
|
4970
|
+
{
|
|
4971
|
+
"type": "SYMBOL",
|
|
4972
|
+
"name": "_closer_line_ansi_c_string_start"
|
|
4973
|
+
},
|
|
4974
|
+
{
|
|
4975
|
+
"type": "SYMBOL",
|
|
4976
|
+
"name": "_closer_line_raw_string_content"
|
|
4977
|
+
},
|
|
4978
|
+
{
|
|
4979
|
+
"type": "SYMBOL",
|
|
4980
|
+
"name": "_closer_line_ansi_c_string_content"
|
|
4981
|
+
},
|
|
4982
|
+
{
|
|
4983
|
+
"type": "SYMBOL",
|
|
4984
|
+
"name": "_joined_comment"
|
|
4985
|
+
},
|
|
4829
4986
|
{
|
|
4830
4987
|
"type": "SYMBOL",
|
|
4831
4988
|
"name": "__error_recovery"
|
package/src/node-types.json
CHANGED
|
@@ -135,6 +135,21 @@
|
|
|
135
135
|
}
|
|
136
136
|
]
|
|
137
137
|
},
|
|
138
|
+
{
|
|
139
|
+
"type": "ansi_c_string",
|
|
140
|
+
"named": true,
|
|
141
|
+
"fields": {},
|
|
142
|
+
"children": {
|
|
143
|
+
"multiple": true,
|
|
144
|
+
"required": false,
|
|
145
|
+
"types": [
|
|
146
|
+
{
|
|
147
|
+
"type": "string_content",
|
|
148
|
+
"named": true
|
|
149
|
+
}
|
|
150
|
+
]
|
|
151
|
+
}
|
|
152
|
+
},
|
|
138
153
|
{
|
|
139
154
|
"type": "arithmetic_command",
|
|
140
155
|
"named": true,
|
|
@@ -888,6 +903,12 @@
|
|
|
888
903
|
]
|
|
889
904
|
}
|
|
890
905
|
},
|
|
906
|
+
{
|
|
907
|
+
"type": "comment",
|
|
908
|
+
"named": true,
|
|
909
|
+
"extra": true,
|
|
910
|
+
"fields": {}
|
|
911
|
+
},
|
|
891
912
|
{
|
|
892
913
|
"type": "compound_statement",
|
|
893
914
|
"named": true,
|
|
@@ -939,6 +960,10 @@
|
|
|
939
960
|
"type": "raw_string",
|
|
940
961
|
"named": true
|
|
941
962
|
},
|
|
963
|
+
{
|
|
964
|
+
"type": "regex",
|
|
965
|
+
"named": true
|
|
966
|
+
},
|
|
942
967
|
{
|
|
943
968
|
"type": "simple_expansion",
|
|
944
969
|
"named": true
|
|
@@ -2398,6 +2423,21 @@
|
|
|
2398
2423
|
]
|
|
2399
2424
|
}
|
|
2400
2425
|
},
|
|
2426
|
+
{
|
|
2427
|
+
"type": "raw_string",
|
|
2428
|
+
"named": true,
|
|
2429
|
+
"fields": {},
|
|
2430
|
+
"children": {
|
|
2431
|
+
"multiple": true,
|
|
2432
|
+
"required": false,
|
|
2433
|
+
"types": [
|
|
2434
|
+
{
|
|
2435
|
+
"type": "string_content",
|
|
2436
|
+
"named": true
|
|
2437
|
+
}
|
|
2438
|
+
]
|
|
2439
|
+
}
|
|
2440
|
+
},
|
|
2401
2441
|
{
|
|
2402
2442
|
"type": "redirected_statement",
|
|
2403
2443
|
"named": true,
|
|
@@ -2540,9 +2580,49 @@
|
|
|
2540
2580
|
"multiple": false,
|
|
2541
2581
|
"required": true,
|
|
2542
2582
|
"types": [
|
|
2583
|
+
{
|
|
2584
|
+
"type": "ansi_c_string",
|
|
2585
|
+
"named": true
|
|
2586
|
+
},
|
|
2587
|
+
{
|
|
2588
|
+
"type": "arithmetic_expansion",
|
|
2589
|
+
"named": true
|
|
2590
|
+
},
|
|
2591
|
+
{
|
|
2592
|
+
"type": "command_substitution",
|
|
2593
|
+
"named": true
|
|
2594
|
+
},
|
|
2595
|
+
{
|
|
2596
|
+
"type": "concatenation",
|
|
2597
|
+
"named": true
|
|
2598
|
+
},
|
|
2599
|
+
{
|
|
2600
|
+
"type": "expansion",
|
|
2601
|
+
"named": true
|
|
2602
|
+
},
|
|
2603
|
+
{
|
|
2604
|
+
"type": "process_substitution",
|
|
2605
|
+
"named": true
|
|
2606
|
+
},
|
|
2607
|
+
{
|
|
2608
|
+
"type": "raw_string",
|
|
2609
|
+
"named": true
|
|
2610
|
+
},
|
|
2543
2611
|
{
|
|
2544
2612
|
"type": "regex",
|
|
2545
2613
|
"named": true
|
|
2614
|
+
},
|
|
2615
|
+
{
|
|
2616
|
+
"type": "simple_expansion",
|
|
2617
|
+
"named": true
|
|
2618
|
+
},
|
|
2619
|
+
{
|
|
2620
|
+
"type": "string",
|
|
2621
|
+
"named": true
|
|
2622
|
+
},
|
|
2623
|
+
{
|
|
2624
|
+
"type": "translated_string",
|
|
2625
|
+
"named": true
|
|
2546
2626
|
}
|
|
2547
2627
|
]
|
|
2548
2628
|
}
|
|
@@ -3209,6 +3289,10 @@
|
|
|
3209
3289
|
"type": "&>>",
|
|
3210
3290
|
"named": false
|
|
3211
3291
|
},
|
|
3292
|
+
{
|
|
3293
|
+
"type": "'",
|
|
3294
|
+
"named": false
|
|
3295
|
+
},
|
|
3212
3296
|
{
|
|
3213
3297
|
"type": "(",
|
|
3214
3298
|
"named": false
|
|
@@ -3429,19 +3513,10 @@
|
|
|
3429
3513
|
"type": "`",
|
|
3430
3514
|
"named": false
|
|
3431
3515
|
},
|
|
3432
|
-
{
|
|
3433
|
-
"type": "ansi_c_string",
|
|
3434
|
-
"named": true
|
|
3435
|
-
},
|
|
3436
3516
|
{
|
|
3437
3517
|
"type": "case",
|
|
3438
3518
|
"named": false
|
|
3439
3519
|
},
|
|
3440
|
-
{
|
|
3441
|
-
"type": "comment",
|
|
3442
|
-
"named": true,
|
|
3443
|
-
"extra": true
|
|
3444
|
-
},
|
|
3445
3520
|
{
|
|
3446
3521
|
"type": "coproc",
|
|
3447
3522
|
"named": false
|
|
@@ -3506,10 +3581,6 @@
|
|
|
3506
3581
|
"type": "operator",
|
|
3507
3582
|
"named": true
|
|
3508
3583
|
},
|
|
3509
|
-
{
|
|
3510
|
-
"type": "raw_string",
|
|
3511
|
-
"named": true
|
|
3512
|
-
},
|
|
3513
3584
|
{
|
|
3514
3585
|
"type": "regex",
|
|
3515
3586
|
"named": true
|