@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 +2 -0
- package/common/common.mjs +5 -2
- package/package.json +1 -1
- package/tree-sitter-dtd.wasm +0 -0
- package/tree-sitter-xml.wasm +0 -0
- package/tree-sitter.json +1 -1
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: _ =>
|
|
315
|
+
Name: _ => new RegExp(`[${nameStartChars}][${nameChars}]*`, 'u'),
|
|
313
316
|
|
|
314
|
-
Nmtoken: _ =>
|
|
317
|
+
Nmtoken: _ => new RegExp(`[${nameChars}]+`, 'u'),
|
|
315
318
|
|
|
316
319
|
_Reference: $ => choice($.EntityRef, $.CharRef),
|
|
317
320
|
|
package/package.json
CHANGED
package/tree-sitter-dtd.wasm
CHANGED
|
Binary file
|
package/tree-sitter-xml.wasm
CHANGED
|
Binary file
|