@willbooster/tree-sitter-rust 3.0.1 → 3.0.3
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 +10 -6
- package/package.json +1 -1
- package/tree-sitter-rust.wasm +0 -0
- package/tree-sitter.json +1 -1
package/grammar.js
CHANGED
|
@@ -423,9 +423,8 @@ module.exports = grammar({
|
|
|
423
423
|
field('name', $._type_identifier),
|
|
424
424
|
field('type_parameters', optional($.type_parameters)),
|
|
425
425
|
choice(
|
|
426
|
-
seq(optional($.where_clause), field('body', $.field_declaration_list)),
|
|
427
|
-
seq(field('body', $.ordered_field_declaration_list), optional($.where_clause), ';')
|
|
428
|
-
';'
|
|
426
|
+
seq(optional($.where_clause), choice(field('body', $.field_declaration_list), ';')),
|
|
427
|
+
seq(field('body', $.ordered_field_declaration_list), optional($.where_clause), ';')
|
|
429
428
|
)
|
|
430
429
|
),
|
|
431
430
|
|
|
@@ -1509,14 +1508,19 @@ module.exports = grammar({
|
|
|
1509
1508
|
optional('b'),
|
|
1510
1509
|
"'",
|
|
1511
1510
|
optional(
|
|
1512
|
-
choice(
|
|
1511
|
+
choice(
|
|
1512
|
+
seq('\\', choice(/[^xu]/, /u[0-9a-fA-F]{4}/, /u\{[0-9a-fA-F][0-9a-fA-F_]*\}/, /x[0-9a-fA-F]{2}/)),
|
|
1513
|
+
/[^\\']/
|
|
1514
|
+
)
|
|
1513
1515
|
),
|
|
1514
1516
|
"'"
|
|
1515
1517
|
)
|
|
1516
1518
|
),
|
|
1517
1519
|
|
|
1518
1520
|
escape_sequence: () =>
|
|
1519
|
-
token.immediate(
|
|
1521
|
+
token.immediate(
|
|
1522
|
+
seq('\\', choice(/[^xu]/, /u[0-9a-fA-F]{4}/, /u\{[0-9a-fA-F][0-9a-fA-F_]*\}/, /x[0-9a-fA-F]{2}/))
|
|
1523
|
+
),
|
|
1520
1524
|
|
|
1521
1525
|
boolean_literal: () => choice('true', 'false'),
|
|
1522
1526
|
|
|
@@ -1604,7 +1608,7 @@ function macroRepetitionSeparator(start, content, end) {
|
|
|
1604
1608
|
return choice(
|
|
1605
1609
|
/[^\s/+*?$"][^/+*?$"]*|\/(?:[^/*+*?$"][^/+*?$"]*)?|\$/,
|
|
1606
1610
|
/[bc]?"(?:[^"\\]|\\[\s\S])*"/,
|
|
1607
|
-
/b?'(?:\\(?:[^xu]|u[0-9a-fA-F]{4}|u\{[0-9a-fA-F]
|
|
1611
|
+
/b?'(?:\\(?:[^xu]|u[0-9a-fA-F]{4}|u\{[0-9a-fA-F][0-9a-fA-F_]*\}|x[0-9a-fA-F]{2})|[^\\'])'/,
|
|
1608
1612
|
seq(start, content, end)
|
|
1609
1613
|
);
|
|
1610
1614
|
}
|
package/package.json
CHANGED
package/tree-sitter-rust.wasm
CHANGED
|
Binary file
|