tree-sitter-sh 0.10.0 → 0.12.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/grammar.js +40 -8
- package/package.json +2 -1
- package/src/arithmetic.h +1346 -0
- package/src/grammar.json +134 -40
- package/src/node-types.json +4 -0
- package/src/parser.c +361857 -350872
- package/src/scanner.c +541 -182
- package/tree-sitter.json +2 -1
package/grammar.js
CHANGED
|
@@ -469,7 +469,7 @@ const patternCharacterClassSource = ($, content) =>
|
|
|
469
469
|
seq(
|
|
470
470
|
patternSpecialStart($, alias($._pattern_character_class_colon, ":")),
|
|
471
471
|
patternCharacterClassBody($, content),
|
|
472
|
-
patternSpecialEnd($, alias($.
|
|
472
|
+
patternSpecialEnd($, alias($._pattern_character_class_end_colon, ":")),
|
|
473
473
|
),
|
|
474
474
|
);
|
|
475
475
|
|
|
@@ -821,6 +821,8 @@ export default grammar({
|
|
|
821
821
|
$._quoted_here_document_body_start,
|
|
822
822
|
$._quoted_here_document_end_begin,
|
|
823
823
|
$._quoted_here_document_end_text,
|
|
824
|
+
$._quoted_here_document_text,
|
|
825
|
+
$._quoted_here_document_text_run_begin,
|
|
824
826
|
$._here_document_end_begin,
|
|
825
827
|
$._here_document_end_leading_tabs,
|
|
826
828
|
$._here_document_end_commit,
|
|
@@ -861,8 +863,10 @@ export default grammar({
|
|
|
861
863
|
$._command_substitution_body_begin,
|
|
862
864
|
$._subshell_close,
|
|
863
865
|
$._word_bracket_literal_start,
|
|
866
|
+
$._assignment_bracket_literal_start,
|
|
864
867
|
$._parameter_bracket_literal_start,
|
|
865
868
|
$._word_bracket_fallback_end,
|
|
869
|
+
$._assignment_bracket_fallback_end,
|
|
866
870
|
$._parameter_bracket_fallback_end,
|
|
867
871
|
$._pattern_bracket_character_token,
|
|
868
872
|
$._parameter_pattern_bracket_character_token,
|
|
@@ -897,6 +901,7 @@ export default grammar({
|
|
|
897
901
|
$._backquote_dollar_single_quote_text,
|
|
898
902
|
$._backquote_dollar_single_quote_prefix,
|
|
899
903
|
$._backquote_pattern_escape,
|
|
904
|
+
$._pattern_character_class_end_colon,
|
|
900
905
|
],
|
|
901
906
|
|
|
902
907
|
conflicts: ($) => [
|
|
@@ -1499,9 +1504,18 @@ export default grammar({
|
|
|
1499
1504
|
choice(
|
|
1500
1505
|
seq(
|
|
1501
1506
|
$._quoted_here_document_end_begin,
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1507
|
+
repeat(
|
|
1508
|
+
choice(
|
|
1509
|
+
$._here_document_end_leading_tabs,
|
|
1510
|
+
$._line_continuation,
|
|
1511
|
+
seq(
|
|
1512
|
+
optional($._quoted_here_document_text_run_begin),
|
|
1513
|
+
alias(
|
|
1514
|
+
$._quoted_here_document_end_text,
|
|
1515
|
+
$.here_document_end_text,
|
|
1516
|
+
),
|
|
1517
|
+
),
|
|
1518
|
+
),
|
|
1505
1519
|
),
|
|
1506
1520
|
),
|
|
1507
1521
|
seq(
|
|
@@ -1580,9 +1594,16 @@ export default grammar({
|
|
|
1580
1594
|
token.immediate(seq("\\", /[^\\\n$`]/)),
|
|
1581
1595
|
|
|
1582
1596
|
quoted_here_document_body: ($) =>
|
|
1583
|
-
repeat1(
|
|
1584
|
-
|
|
1585
|
-
|
|
1597
|
+
repeat1(
|
|
1598
|
+
choice(
|
|
1599
|
+
seq(
|
|
1600
|
+
optional($._quoted_here_document_text_run_begin),
|
|
1601
|
+
alias($._quoted_here_document_text, $.quoted_here_document_text),
|
|
1602
|
+
),
|
|
1603
|
+
$._line_continuation,
|
|
1604
|
+
$._newline,
|
|
1605
|
+
),
|
|
1606
|
+
),
|
|
1586
1607
|
|
|
1587
1608
|
assignment_word: ($) =>
|
|
1588
1609
|
prec.dynamic(
|
|
@@ -1635,10 +1656,21 @@ export default grammar({
|
|
|
1635
1656
|
_assignment_word_part: ($) =>
|
|
1636
1657
|
choice(
|
|
1637
1658
|
$._assignment_non_delimiter_part,
|
|
1638
|
-
$.
|
|
1659
|
+
$._assignment_incomplete_bracket_literal,
|
|
1639
1660
|
prec(-1, alias($._literal_slash, $.literal)),
|
|
1640
1661
|
),
|
|
1641
1662
|
|
|
1663
|
+
_assignment_incomplete_bracket_literal: ($) =>
|
|
1664
|
+
incompleteBracketLiteral(
|
|
1665
|
+
$,
|
|
1666
|
+
$._assignment_bracket_literal_start,
|
|
1667
|
+
choice(
|
|
1668
|
+
$._word_incomplete_bracket_literal_part,
|
|
1669
|
+
prec(-1, $._pattern_special_literal_left),
|
|
1670
|
+
),
|
|
1671
|
+
$._assignment_bracket_fallback_end,
|
|
1672
|
+
),
|
|
1673
|
+
|
|
1642
1674
|
_assignment_literal: ($) => prec.right(assignmentPlainChunk($)),
|
|
1643
1675
|
|
|
1644
1676
|
_assignment_colon_part: ($) =>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tree-sitter-sh",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Tree-sitter grammar for POSIX sh.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
"grammar.js",
|
|
10
10
|
"queries/*.scm",
|
|
11
11
|
"src/*.c",
|
|
12
|
+
"src/*.h",
|
|
12
13
|
"src/*.json",
|
|
13
14
|
"src/tree_sitter/*.h",
|
|
14
15
|
"tree-sitter.json"
|