@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 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(seq('\\', choice(/[^xu]/, /u[0-9a-fA-F]{4}/, /u\{[0-9a-fA-F]+\}/, /x[0-9a-fA-F]{2}/)), /[^\\']/)
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(seq('\\', choice(/[^xu]/, /u[0-9a-fA-F]{4}/, /u\{[0-9a-fA-F]+\}/, /x[0-9a-fA-F]{2}/))),
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]+\}|x[0-9a-fA-F]{2})|[^\\'])'/,
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@willbooster/tree-sitter-rust",
3
- "version": "3.0.1",
3
+ "version": "3.0.3",
4
4
  "description": "Rust grammar for tree-sitter",
5
5
  "keywords": [
6
6
  "incremental",
Binary file
package/tree-sitter.json CHANGED
@@ -22,7 +22,7 @@
22
22
  }
23
23
  ],
24
24
  "metadata": {
25
- "version": "3.0.1",
25
+ "version": "3.0.3",
26
26
  "license": "MIT",
27
27
  "description": "Rust grammar for tree-sitter",
28
28
  "authors": [