@konomanoasa/tree-sitter-diagnostic-sh 0.5.0 → 0.6.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/Cargo.toml CHANGED
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "konomanoasa-tree-sitter-diagnostic-sh"
3
- version = "0.5.0"
3
+ version = "0.6.0"
4
4
  edition = "2024"
5
5
  description = "Tree-sitter grammar for diagnostics of POSIX sh."
6
6
  readme = "README.md"
package/PARSING_POLICY.md CHANGED
@@ -1,11 +1,13 @@
1
1
  # Parsing Policy
2
2
 
3
- The parser checks the syntax of source as written. It parses the following
4
- commands but does not apply their effects to parsing.
3
+ The parser supports the mandatory syntax of [POSIX.1-2024](https://pubs.opengroup.org/onlinepubs/9799919799.2024edition/utilities/V3_chap02.html). Optional syntax,
4
+ optional features, and implementation-specific extensions are not supported.
5
+ Where POSIX does not uniquely determine the syntax interpretation, the parser
6
+ follows [dash 0.5.13.5](https://manpages.debian.org/experimental/dash/dash.1.en.html). Explicit POSIX requirements take precedence.
5
7
 
6
- | Command | Effects not applied |
7
- | ------------------ | ----------------------------------------------------------------- |
8
- | `.` | Loading another file or applying changes made by its execution. |
9
- | `alias`, `unalias` | Alias substitution or changes to alias definitions. |
10
- | `eval` | Reparsing code constructed from its arguments. |
11
- | `set` | Changing parsing conditions in response to shell option settings. |
8
+ The following commands can affect how subsequent source is parsed. The parser
9
+ recognizes these commands but does not apply their effects.
10
+
11
+ | Command | Effects not applied |
12
+ | ------------------ | --------------------------------------------------- |
13
+ | `alias`, `unalias` | Alias substitution or changes to alias definitions. |
package/README.md CHANGED
@@ -15,6 +15,10 @@ Guarantees cover fresh parsing only.
15
15
  npm install @konomanoasa/tree-sitter-diagnostic-sh
16
16
  ```
17
17
 
18
+ ## Parsing Policy
19
+
20
+ [Parsing Policy](PARSING_POLICY.md)
21
+
18
22
  ## Development
19
23
 
20
24
  ```sh
@@ -23,10 +27,6 @@ npm run build
23
27
  npm test
24
28
  ```
25
29
 
26
- ## Parsing Policy
27
-
28
- [Parsing Policy](PARSING_POLICY.md)
29
-
30
30
  ## Specification
31
31
 
32
32
  [POSIX.1-2024 Shell Command Language](https://pubs.opengroup.org/onlinepubs/9799919799.2024edition/utilities/V3_chap02.html)
package/grammar.js CHANGED
@@ -52,15 +52,11 @@ const faults = [
52
52
  "unexpected_negation",
53
53
  "command_gap",
54
54
  "separator_gap",
55
- "unspecified_negation_spacing",
56
- "reserved_colon_word",
57
55
  "redirection_target_gap",
58
56
  "invalid_redirection_target",
59
57
  "here_document_delimiter_gap",
60
58
  "invalid_here_document_delimiter",
61
59
  "here_document_ending_gap",
62
- "unspecified_here_document_start",
63
- "unspecified_here_document_newline",
64
60
  "for_name_gap",
65
61
  "invalid_for_name",
66
62
  "for_separator_gap",
@@ -89,11 +85,7 @@ const faults = [
89
85
  "double_quote_gap",
90
86
  "dollar_quote_gap",
91
87
  "incomplete_escape",
92
- "unspecified_dollar_quote_escape",
93
- "unspecified_empty_hex_escape",
94
- "unspecified_control_escape",
95
- "unspecified_hex_escape",
96
- "unspecified_octal_escape",
88
+ "invalid_control_escape",
97
89
  "parameter_name_gap",
98
90
  "invalid_parameter_name",
99
91
  "parameter_operator_gap",
@@ -101,14 +93,10 @@ const faults = [
101
93
  "parameter_length_suffix_error",
102
94
  "parameter_word_gap",
103
95
  "parameter_ending_gap",
104
- "unspecified_parameter_quote",
105
- "unspecified_expansion_start",
106
96
  "arithmetic_ending_gap",
107
97
  "substitution_ending_gap",
108
98
  "backquote_gap",
109
99
  "undefined_backquote_quote",
110
- "undefined_backquote_comment",
111
- "undefined_backquote_here_document",
112
100
  "undefined_backquote_substitution",
113
101
  ];
114
102
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@konomanoasa/tree-sitter-diagnostic-sh",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "type": "module",
5
5
  "description": "Tree-sitter grammar for diagnostics of POSIX sh.",
6
6
  "license": "MIT",
package/src/grammar.json CHANGED
@@ -1665,14 +1665,6 @@
1665
1665
  "type": "SYMBOL",
1666
1666
  "name": "separator_gap"
1667
1667
  },
1668
- {
1669
- "type": "SYMBOL",
1670
- "name": "unspecified_negation_spacing"
1671
- },
1672
- {
1673
- "type": "SYMBOL",
1674
- "name": "reserved_colon_word"
1675
- },
1676
1668
  {
1677
1669
  "type": "SYMBOL",
1678
1670
  "name": "redirection_target_gap"
@@ -1693,14 +1685,6 @@
1693
1685
  "type": "SYMBOL",
1694
1686
  "name": "here_document_ending_gap"
1695
1687
  },
1696
- {
1697
- "type": "SYMBOL",
1698
- "name": "unspecified_here_document_start"
1699
- },
1700
- {
1701
- "type": "SYMBOL",
1702
- "name": "unspecified_here_document_newline"
1703
- },
1704
1688
  {
1705
1689
  "type": "SYMBOL",
1706
1690
  "name": "for_name_gap"
@@ -1815,23 +1799,7 @@
1815
1799
  },
1816
1800
  {
1817
1801
  "type": "SYMBOL",
1818
- "name": "unspecified_dollar_quote_escape"
1819
- },
1820
- {
1821
- "type": "SYMBOL",
1822
- "name": "unspecified_empty_hex_escape"
1823
- },
1824
- {
1825
- "type": "SYMBOL",
1826
- "name": "unspecified_control_escape"
1827
- },
1828
- {
1829
- "type": "SYMBOL",
1830
- "name": "unspecified_hex_escape"
1831
- },
1832
- {
1833
- "type": "SYMBOL",
1834
- "name": "unspecified_octal_escape"
1802
+ "name": "invalid_control_escape"
1835
1803
  },
1836
1804
  {
1837
1805
  "type": "SYMBOL",
@@ -1861,14 +1829,6 @@
1861
1829
  "type": "SYMBOL",
1862
1830
  "name": "parameter_ending_gap"
1863
1831
  },
1864
- {
1865
- "type": "SYMBOL",
1866
- "name": "unspecified_parameter_quote"
1867
- },
1868
- {
1869
- "type": "SYMBOL",
1870
- "name": "unspecified_expansion_start"
1871
- },
1872
1832
  {
1873
1833
  "type": "SYMBOL",
1874
1834
  "name": "arithmetic_ending_gap"
@@ -1885,14 +1845,6 @@
1885
1845
  "type": "SYMBOL",
1886
1846
  "name": "undefined_backquote_quote"
1887
1847
  },
1888
- {
1889
- "type": "SYMBOL",
1890
- "name": "undefined_backquote_comment"
1891
- },
1892
- {
1893
- "type": "SYMBOL",
1894
- "name": "undefined_backquote_here_document"
1895
- },
1896
1848
  {
1897
1849
  "type": "SYMBOL",
1898
1850
  "name": "undefined_backquote_substitution"
@@ -2041,14 +1993,6 @@
2041
1993
  "type": "SYMBOL",
2042
1994
  "name": "separator_gap"
2043
1995
  },
2044
- {
2045
- "type": "SYMBOL",
2046
- "name": "unspecified_negation_spacing"
2047
- },
2048
- {
2049
- "type": "SYMBOL",
2050
- "name": "reserved_colon_word"
2051
- },
2052
1996
  {
2053
1997
  "type": "SYMBOL",
2054
1998
  "name": "redirection_target_gap"
@@ -2069,14 +2013,6 @@
2069
2013
  "type": "SYMBOL",
2070
2014
  "name": "here_document_ending_gap"
2071
2015
  },
2072
- {
2073
- "type": "SYMBOL",
2074
- "name": "unspecified_here_document_start"
2075
- },
2076
- {
2077
- "type": "SYMBOL",
2078
- "name": "unspecified_here_document_newline"
2079
- },
2080
2016
  {
2081
2017
  "type": "SYMBOL",
2082
2018
  "name": "for_name_gap"
@@ -2191,23 +2127,7 @@
2191
2127
  },
2192
2128
  {
2193
2129
  "type": "SYMBOL",
2194
- "name": "unspecified_dollar_quote_escape"
2195
- },
2196
- {
2197
- "type": "SYMBOL",
2198
- "name": "unspecified_empty_hex_escape"
2199
- },
2200
- {
2201
- "type": "SYMBOL",
2202
- "name": "unspecified_control_escape"
2203
- },
2204
- {
2205
- "type": "SYMBOL",
2206
- "name": "unspecified_hex_escape"
2207
- },
2208
- {
2209
- "type": "SYMBOL",
2210
- "name": "unspecified_octal_escape"
2130
+ "name": "invalid_control_escape"
2211
2131
  },
2212
2132
  {
2213
2133
  "type": "SYMBOL",
@@ -2237,14 +2157,6 @@
2237
2157
  "type": "SYMBOL",
2238
2158
  "name": "parameter_ending_gap"
2239
2159
  },
2240
- {
2241
- "type": "SYMBOL",
2242
- "name": "unspecified_parameter_quote"
2243
- },
2244
- {
2245
- "type": "SYMBOL",
2246
- "name": "unspecified_expansion_start"
2247
- },
2248
2160
  {
2249
2161
  "type": "SYMBOL",
2250
2162
  "name": "arithmetic_ending_gap"
@@ -2261,14 +2173,6 @@
2261
2173
  "type": "SYMBOL",
2262
2174
  "name": "undefined_backquote_quote"
2263
2175
  },
2264
- {
2265
- "type": "SYMBOL",
2266
- "name": "undefined_backquote_comment"
2267
- },
2268
- {
2269
- "type": "SYMBOL",
2270
- "name": "undefined_backquote_here_document"
2271
- },
2272
2176
  {
2273
2177
  "type": "SYMBOL",
2274
2178
  "name": "undefined_backquote_substitution"
@@ -2563,14 +2467,6 @@
2563
2467
  "type": "SYMBOL",
2564
2468
  "name": "separator_gap"
2565
2469
  },
2566
- {
2567
- "type": "SYMBOL",
2568
- "name": "unspecified_negation_spacing"
2569
- },
2570
- {
2571
- "type": "SYMBOL",
2572
- "name": "reserved_colon_word"
2573
- },
2574
2470
  {
2575
2471
  "type": "SYMBOL",
2576
2472
  "name": "redirection_target_gap"
@@ -2591,14 +2487,6 @@
2591
2487
  "type": "SYMBOL",
2592
2488
  "name": "here_document_ending_gap"
2593
2489
  },
2594
- {
2595
- "type": "SYMBOL",
2596
- "name": "unspecified_here_document_start"
2597
- },
2598
- {
2599
- "type": "SYMBOL",
2600
- "name": "unspecified_here_document_newline"
2601
- },
2602
2490
  {
2603
2491
  "type": "SYMBOL",
2604
2492
  "name": "for_name_gap"
@@ -2713,23 +2601,7 @@
2713
2601
  },
2714
2602
  {
2715
2603
  "type": "SYMBOL",
2716
- "name": "unspecified_dollar_quote_escape"
2717
- },
2718
- {
2719
- "type": "SYMBOL",
2720
- "name": "unspecified_empty_hex_escape"
2721
- },
2722
- {
2723
- "type": "SYMBOL",
2724
- "name": "unspecified_control_escape"
2725
- },
2726
- {
2727
- "type": "SYMBOL",
2728
- "name": "unspecified_hex_escape"
2729
- },
2730
- {
2731
- "type": "SYMBOL",
2732
- "name": "unspecified_octal_escape"
2604
+ "name": "invalid_control_escape"
2733
2605
  },
2734
2606
  {
2735
2607
  "type": "SYMBOL",
@@ -2759,14 +2631,6 @@
2759
2631
  "type": "SYMBOL",
2760
2632
  "name": "parameter_ending_gap"
2761
2633
  },
2762
- {
2763
- "type": "SYMBOL",
2764
- "name": "unspecified_parameter_quote"
2765
- },
2766
- {
2767
- "type": "SYMBOL",
2768
- "name": "unspecified_expansion_start"
2769
- },
2770
2634
  {
2771
2635
  "type": "SYMBOL",
2772
2636
  "name": "arithmetic_ending_gap"
@@ -2783,14 +2647,6 @@
2783
2647
  "type": "SYMBOL",
2784
2648
  "name": "undefined_backquote_quote"
2785
2649
  },
2786
- {
2787
- "type": "SYMBOL",
2788
- "name": "undefined_backquote_comment"
2789
- },
2790
- {
2791
- "type": "SYMBOL",
2792
- "name": "undefined_backquote_here_document"
2793
- },
2794
2650
  {
2795
2651
  "type": "SYMBOL",
2796
2652
  "name": "undefined_backquote_substitution"
@@ -3952,6 +3952,10 @@
3952
3952
  "type": "invalid_case_word",
3953
3953
  "named": true
3954
3954
  },
3955
+ {
3956
+ "type": "invalid_control_escape",
3957
+ "named": true
3958
+ },
3955
3959
  {
3956
3960
  "type": "invalid_do",
3957
3961
  "named": true
@@ -4028,10 +4032,6 @@
4028
4032
  "type": "redirection_target_gap",
4029
4033
  "named": true
4030
4034
  },
4031
- {
4032
- "type": "reserved_colon_word",
4033
- "named": true
4034
- },
4035
4035
  {
4036
4036
  "type": "separator_gap",
4037
4037
  "named": true
@@ -4052,14 +4052,6 @@
4052
4052
  "type": "then_gap",
4053
4053
  "named": true
4054
4054
  },
4055
- {
4056
- "type": "undefined_backquote_comment",
4057
- "named": true
4058
- },
4059
- {
4060
- "type": "undefined_backquote_here_document",
4061
- "named": true
4062
- },
4063
4055
  {
4064
4056
  "type": "undefined_backquote_quote",
4065
4057
  "named": true
@@ -4139,46 +4131,6 @@
4139
4131
  {
4140
4132
  "type": "unmatched_parenthesis",
4141
4133
  "named": true
4142
- },
4143
- {
4144
- "type": "unspecified_control_escape",
4145
- "named": true
4146
- },
4147
- {
4148
- "type": "unspecified_dollar_quote_escape",
4149
- "named": true
4150
- },
4151
- {
4152
- "type": "unspecified_empty_hex_escape",
4153
- "named": true
4154
- },
4155
- {
4156
- "type": "unspecified_expansion_start",
4157
- "named": true
4158
- },
4159
- {
4160
- "type": "unspecified_here_document_newline",
4161
- "named": true
4162
- },
4163
- {
4164
- "type": "unspecified_here_document_start",
4165
- "named": true
4166
- },
4167
- {
4168
- "type": "unspecified_hex_escape",
4169
- "named": true
4170
- },
4171
- {
4172
- "type": "unspecified_negation_spacing",
4173
- "named": true
4174
- },
4175
- {
4176
- "type": "unspecified_octal_escape",
4177
- "named": true
4178
- },
4179
- {
4180
- "type": "unspecified_parameter_quote",
4181
- "named": true
4182
4134
  }
4183
4135
  ]
4184
4136
  },
@@ -4730,6 +4682,10 @@
4730
4682
  "type": "invalid_case_word",
4731
4683
  "named": true
4732
4684
  },
4685
+ {
4686
+ "type": "invalid_control_escape",
4687
+ "named": true
4688
+ },
4733
4689
  {
4734
4690
  "type": "invalid_do",
4735
4691
  "named": true
@@ -4818,10 +4774,6 @@
4818
4774
  "type": "redirection_target_gap",
4819
4775
  "named": true
4820
4776
  },
4821
- {
4822
- "type": "reserved_colon_word",
4823
- "named": true
4824
- },
4825
4777
  {
4826
4778
  "type": "separator_gap",
4827
4779
  "named": true
@@ -4846,14 +4798,6 @@
4846
4798
  "type": "then_gap",
4847
4799
  "named": true
4848
4800
  },
4849
- {
4850
- "type": "undefined_backquote_comment",
4851
- "named": true
4852
- },
4853
- {
4854
- "type": "undefined_backquote_here_document",
4855
- "named": true
4856
- },
4857
4801
  {
4858
4802
  "type": "undefined_backquote_quote",
4859
4803
  "named": true
@@ -4933,45 +4877,5 @@
4933
4877
  {
4934
4878
  "type": "unmatched_parenthesis",
4935
4879
  "named": true
4936
- },
4937
- {
4938
- "type": "unspecified_control_escape",
4939
- "named": true
4940
- },
4941
- {
4942
- "type": "unspecified_dollar_quote_escape",
4943
- "named": true
4944
- },
4945
- {
4946
- "type": "unspecified_empty_hex_escape",
4947
- "named": true
4948
- },
4949
- {
4950
- "type": "unspecified_expansion_start",
4951
- "named": true
4952
- },
4953
- {
4954
- "type": "unspecified_here_document_newline",
4955
- "named": true
4956
- },
4957
- {
4958
- "type": "unspecified_here_document_start",
4959
- "named": true
4960
- },
4961
- {
4962
- "type": "unspecified_hex_escape",
4963
- "named": true
4964
- },
4965
- {
4966
- "type": "unspecified_negation_spacing",
4967
- "named": true
4968
- },
4969
- {
4970
- "type": "unspecified_octal_escape",
4971
- "named": true
4972
- },
4973
- {
4974
- "type": "unspecified_parameter_quote",
4975
- "named": true
4976
4880
  }
4977
4881
  ]