@willbooster/tree-sitter-rust 14.0.1 → 14.0.2
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 +2 -4
- package/package.json +1 -1
- package/tree-sitter-rust.wasm +0 -0
- package/tree-sitter.json +1 -1
package/grammar.js
CHANGED
|
@@ -155,6 +155,7 @@ module.exports = grammar({
|
|
|
155
155
|
sym('_orphan_block_doc_comment_start'),
|
|
156
156
|
sym('_orphan_doc_missing_owner'),
|
|
157
157
|
sym('_trailing_type_bound_plus'),
|
|
158
|
+
sym('shebang'),
|
|
158
159
|
],
|
|
159
160
|
|
|
160
161
|
supertypes: ($) => [
|
|
@@ -220,7 +221,7 @@ module.exports = grammar({
|
|
|
220
221
|
|
|
221
222
|
rules: {
|
|
222
223
|
source_file: ($) =>
|
|
223
|
-
seq(sym('_frontmatter_context'), optional(
|
|
224
|
+
seq(sym('_frontmatter_context'), optional(sym('shebang')), optional($.frontmatter), repeat($._statement)),
|
|
224
225
|
|
|
225
226
|
_statement: ($) => choice($.expression_statement, $._declaration_statement),
|
|
226
227
|
|
|
@@ -1870,9 +1871,6 @@ module.exports = grammar({
|
|
|
1870
1871
|
|
|
1871
1872
|
identifier: () => /(r#)?[_\p{XID_Start}][_\p{XID_Continue}]*/u,
|
|
1872
1873
|
|
|
1873
|
-
// oxlint-disable-next-line no-useless-escape -- tree-sitter's regex parser rejects an unescaped `[` in a character class.
|
|
1874
|
-
shebang: () => /#![\r\f\t\v ]*([^\[\n].*)?\n/,
|
|
1875
|
-
|
|
1876
1874
|
_reserved_identifier: ($) => alias(choice(...reservedIdentifiers, 'auto', 'macro_rules'), $.identifier),
|
|
1877
1875
|
|
|
1878
1876
|
_type_identifier: ($) => alias(choice($.identifier, 'auto', 'macro_rules'), sym('type_identifier')),
|
package/package.json
CHANGED
package/tree-sitter-rust.wasm
CHANGED
|
Binary file
|