@willbooster/tree-sitter-xml 3.0.1 → 3.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/README.md CHANGED
@@ -23,6 +23,8 @@ upstream's 0.7.0 packages in these ways:
23
23
  - Where a NUL character cannot be part of any token, the `ERROR` node covers it as it covers any other unexpected
24
24
  character, without the unexpected-character node that upstream's parsers put inside it.
25
25
 
26
+ - Names and enumeration tokens use the [XML 1.0 Unicode character ranges](https://www.w3.org/TR/xml/#NT-NameStartChar),
27
+ including supplementary characters, in attributes, references, and DTD declarations.
26
28
  - Generic processing instructions accept multiline content and question marks up to the closing `?>`, including
27
29
  when another instruction or markup immediately follows.
28
30
  - Nonempty attribute values (`AttValue` and `PseudoAttValue`) and entity values (`EntityValue`) expose their full
package/common/common.mjs CHANGED
@@ -70,6 +70,9 @@ export const rseq = (...rules) => repeat(seq(...rules));
70
70
  /** @param {RuleOrLiteral[]} rules */
71
71
  export const rseq1 = (...rules) => repeat1(seq(...rules));
72
72
 
73
+ const nameStartChars = String.raw`:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u{10000}-\u{EFFFF}`;
74
+ const nameChars = String.raw`${nameStartChars}\-.0-9\u00B7\u0300-\u036F\u203F-\u2040`;
75
+
73
76
  const O = optional;
74
77
 
75
78
  /** @type {Record<string, ($: GrammarSymbols<any>) => RuleOrLiteral>} */
@@ -309,9 +312,9 @@ export const rules = {
309
312
 
310
313
  _S: _ => /[ \t\r\n]+/,
311
314
 
312
- Name: _ => /[a-zA-Z_][a-zA-Z0-9_:.·-]*/,
315
+ Name: _ => new RegExp(`[${nameStartChars}][${nameChars}]*`, 'u'),
313
316
 
314
- Nmtoken: _ => /[a-zA-Z0-9_:.·-]+/,
317
+ Nmtoken: _ => new RegExp(`[${nameChars}]+`, 'u'),
315
318
 
316
319
  _Reference: $ => choice($.EntityRef, $.CharRef),
317
320
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@willbooster/tree-sitter-xml",
3
- "version": "3.0.1",
3
+ "version": "3.0.2",
4
4
  "description": "XML & DTD grammars for tree-sitter",
5
5
  "keywords": [
6
6
  "incremental",
Binary file
Binary file
package/tree-sitter.json CHANGED
@@ -36,7 +36,7 @@
36
36
  }
37
37
  ],
38
38
  "metadata": {
39
- "version": "3.0.1",
39
+ "version": "3.0.2",
40
40
  "license": "MIT",
41
41
  "description": "XML & DTD grammars for tree-sitter",
42
42
  "authors": [