@willbooster/tree-sitter-bash 2.1.6 → 2.1.8

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/grammar.js CHANGED
@@ -143,13 +143,16 @@ module.exports = grammar({
143
143
  $._backtick_comment,
144
144
  $._backtick_comment_boundary,
145
145
  $.__error_recovery,
146
+ $._command_substitution_start,
147
+ $._arithmetic_substitution_start,
148
+ $._arithmetic_cache_reset,
146
149
  ],
147
150
 
148
- extras: ($) => [$.comment, $.heredoc_body, /[ \t\n]/, /\\\n/, $._line_continuation],
151
+ extras: ($) => [$.comment, $.heredoc_body, /[ \t\n]/, /\\\n/, $._line_continuation, $._arithmetic_cache_reset],
149
152
 
150
153
  supertypes: ($) => [$._statement, $._arithmetic_expression],
151
154
 
152
- inline: ($) => [$._terminator, $._command_statement],
155
+ inline: ($) => [$._terminator, $._command_statement, $._compound_command],
153
156
 
154
157
  // Until `;;` or `esac`, a case item's statements may belong to a middle item or to the last one.
155
158
  conflicts: ($) => [[$._statements, $._last_case_item]],
@@ -801,7 +804,14 @@ module.exports = grammar({
801
804
  // inside a substitution has its body read before the substitution ends.
802
805
  command_substitution: ($) =>
803
806
  choice(
804
- seq('$(', $._substitution_start, optional($._statements), $._substitution_end, ')'),
807
+ seq(
808
+ $._command_substitution_start,
809
+ '$(',
810
+ $._substitution_start,
811
+ optional($._statements),
812
+ $._substitution_end,
813
+ ')'
814
+ ),
805
815
  // bash 5.3 runs `${ list; }` and `${| list; }` in the current shell.
806
816
  seq(
807
817
  alias(token(/\$\{[ \t\n|]/), '${'),
@@ -819,7 +829,7 @@ module.exports = grammar({
819
829
  // Arithmetic may span lines, and a heredoc body starts only after it, so it counts as nesting.
820
830
  arithmetic_expansion: ($) =>
821
831
  choice(
822
- seq('$((', $._substitution_start, optional($._arithmetic_expression), $._substitution_end, '))'),
832
+ seq($._arithmetic_substitution_start, '$((', optional($._arithmetic_expression), $._substitution_end, '))'),
823
833
  seq('$[', $._bracket_substitution_start, optional($._arithmetic_expression), $._bracket_substitution_end, ']')
824
834
  ),
825
835
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@willbooster/tree-sitter-bash",
3
- "version": "2.1.6",
3
+ "version": "2.1.8",
4
4
  "description": "Bash grammar for tree-sitter",
5
5
  "keywords": [
6
6
  "incremental",
Binary file
package/tree-sitter.json CHANGED
@@ -18,7 +18,7 @@
18
18
  }
19
19
  ],
20
20
  "metadata": {
21
- "version": "2.1.6",
21
+ "version": "2.1.8",
22
22
  "license": "MIT",
23
23
  "description": "Bash grammar for tree-sitter",
24
24
  "authors": [