@willbooster/tree-sitter-rust 3.1.4 → 3.1.6
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 +18 -6
- package/package.json +1 -1
- package/src/node-types.json +4 -0
- package/tree-sitter-rust.wasm +0 -0
- package/tree-sitter.json +1 -1
package/grammar.js
CHANGED
|
@@ -120,7 +120,7 @@ const fieldIdentifierKeywords = [...reservedIdentifiers, ...primitiveTypes, 'aut
|
|
|
120
120
|
module.exports = grammar({
|
|
121
121
|
name: 'rust',
|
|
122
122
|
|
|
123
|
-
extras: ($) => [
|
|
123
|
+
extras: ($) => [/[\s\u0085\u200E\u200F\u2028\u2029]/, $.line_comment, $.block_comment],
|
|
124
124
|
|
|
125
125
|
externals: () => [
|
|
126
126
|
sym('string_content'),
|
|
@@ -1426,11 +1426,23 @@ module.exports = grammar({
|
|
|
1426
1426
|
field_pattern: ($) =>
|
|
1427
1427
|
seq(
|
|
1428
1428
|
repeat($.attribute_item),
|
|
1429
|
-
optional('ref'),
|
|
1430
|
-
optional($.mutable_specifier),
|
|
1431
1429
|
choice(
|
|
1432
|
-
|
|
1433
|
-
|
|
1430
|
+
seq(
|
|
1431
|
+
optional('ref'),
|
|
1432
|
+
optional($.mutable_specifier),
|
|
1433
|
+
choice(
|
|
1434
|
+
field('name', alias($.identifier, sym('shorthand_field_identifier'))),
|
|
1435
|
+
seq(field('name', $._field_identifier), ':', field('pattern', $._pattern))
|
|
1436
|
+
)
|
|
1437
|
+
),
|
|
1438
|
+
seq(
|
|
1439
|
+
field(
|
|
1440
|
+
'name',
|
|
1441
|
+
alias(/([0-9][0-9_]*|0b_*[01][01_]*|0o_*[0-7][0-7_]*|0x_*[0-9a-fA-F][0-9a-fA-F_]*)/, $.integer_literal)
|
|
1442
|
+
),
|
|
1443
|
+
':',
|
|
1444
|
+
field('pattern', $._pattern)
|
|
1445
|
+
)
|
|
1434
1446
|
)
|
|
1435
1447
|
),
|
|
1436
1448
|
|
|
@@ -1668,7 +1680,7 @@ module.exports = grammar({
|
|
|
1668
1680
|
*/
|
|
1669
1681
|
function macroRepetitionSeparator(start, content, end) {
|
|
1670
1682
|
return choice(
|
|
1671
|
-
/[^\s/+*?$"][^/+*?$"]*|\/(?:[^/*+*?$"][^/+*?$"]*)?|\$/,
|
|
1683
|
+
/[^\s\u0085\u200E\u200F\u2028\u2029/+*?$"][^/+*?$"]*|\/(?:[^/*+*?$"][^/+*?$"]*)?|\$/,
|
|
1672
1684
|
/[bc]?"(?:[^"\\]|\\[\s\S])*"/,
|
|
1673
1685
|
/b?'(?:\\(?:[^xu]|u[0-9a-fA-F]{4}|u\{[0-9a-fA-F][0-9a-fA-F_]*\}|x[0-9a-fA-F]{2})|[^\\'])'/,
|
|
1674
1686
|
seq(start, content, end)
|
package/package.json
CHANGED
package/src/node-types.json
CHANGED
package/tree-sitter-rust.wasm
CHANGED
|
Binary file
|