@willbooster/tree-sitter-bash 2.1.5 → 2.1.7
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 +13 -3
- package/package.json +1 -1
- package/tree-sitter-bash.wasm +0 -0
- package/tree-sitter.json +1 -1
package/grammar.js
CHANGED
|
@@ -143,9 +143,12 @@ 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
|
|
|
@@ -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(
|
|
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('$((',
|
|
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
package/tree-sitter-bash.wasm
CHANGED
|
Binary file
|