@b9g/crank 0.7.5 → 0.7.7
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 +15 -9
- package/_svg.cjs +94 -0
- package/_svg.cjs.map +1 -0
- package/_svg.d.ts +1 -0
- package/_svg.js +92 -0
- package/_svg.js.map +1 -0
- package/async.cjs +2 -1
- package/async.cjs.map +1 -1
- package/async.js +2 -1
- package/async.js.map +1 -1
- package/crank.cjs +193 -16
- package/crank.cjs.map +1 -1
- package/crank.d.ts +1 -0
- package/crank.js +193 -16
- package/crank.js.map +1 -1
- package/dom.cjs +326 -258
- package/dom.cjs.map +1 -1
- package/dom.js +326 -258
- package/dom.js.map +1 -1
- package/html.cjs +35 -5
- package/html.cjs.map +1 -1
- package/html.d.ts +2 -2
- package/html.js +35 -5
- package/html.js.map +1 -1
- package/jsx-tag.cjs +86 -21
- package/jsx-tag.cjs.map +1 -1
- package/jsx-tag.d.ts +41 -0
- package/jsx-tag.js +86 -22
- package/jsx-tag.js.map +1 -1
- package/package.json +1 -2
- package/standalone.cjs +7 -0
- package/standalone.cjs.map +1 -1
- package/standalone.d.ts +3 -1
- package/standalone.js +2 -0
- package/standalone.js.map +1 -1
- package/umd.js +648 -285
- package/umd.js.map +1 -1
package/html.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="html.d.ts" />
|
|
2
2
|
import { Renderer, Portal } from './crank.js';
|
|
3
3
|
import { camelToKebabCase, formatStyleValue } from './_css.js';
|
|
4
|
+
import { REACT_SVG_PROPS } from './_svg.js';
|
|
4
5
|
|
|
5
6
|
const voidTags = new Set([
|
|
6
7
|
"area",
|
|
@@ -49,12 +50,20 @@ function printStyleObject(style) {
|
|
|
49
50
|
}
|
|
50
51
|
return cssStrings.join("");
|
|
51
52
|
}
|
|
52
|
-
function printAttrs(props) {
|
|
53
|
+
function printAttrs(props, isSVG) {
|
|
53
54
|
const attrs = [];
|
|
54
55
|
for (let [name, value] of Object.entries(props)) {
|
|
55
|
-
if (name === "innerHTML" ||
|
|
56
|
+
if (name === "innerHTML" ||
|
|
57
|
+
name === "dangerouslySetInnerHTML" ||
|
|
58
|
+
name.startsWith("prop:")) {
|
|
56
59
|
continue;
|
|
57
60
|
}
|
|
61
|
+
else if (name === "htmlFor") {
|
|
62
|
+
if ("for" in props || value == null || value === false) {
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
attrs.push(`for="${escape(String(value === true ? "" : value))}"`);
|
|
66
|
+
}
|
|
58
67
|
else if (name === "style") {
|
|
59
68
|
if (typeof value === "string") {
|
|
60
69
|
attrs.push(`style="${escape(value)}"`);
|
|
@@ -87,6 +96,9 @@ function printAttrs(props) {
|
|
|
87
96
|
if (name.startsWith("attr:")) {
|
|
88
97
|
name = name.slice("attr:".length);
|
|
89
98
|
}
|
|
99
|
+
else if (isSVG && name in REACT_SVG_PROPS) {
|
|
100
|
+
name = REACT_SVG_PROPS[name];
|
|
101
|
+
}
|
|
90
102
|
if (typeof value === "string") {
|
|
91
103
|
attrs.push(`${escape(name)}="${escape(value)}"`);
|
|
92
104
|
}
|
|
@@ -109,6 +121,20 @@ function join(children) {
|
|
|
109
121
|
return result;
|
|
110
122
|
}
|
|
111
123
|
const impl = {
|
|
124
|
+
scope({ scope, tag, }) {
|
|
125
|
+
if (tag === Portal) {
|
|
126
|
+
return undefined;
|
|
127
|
+
}
|
|
128
|
+
switch (tag) {
|
|
129
|
+
case "svg":
|
|
130
|
+
return "svg";
|
|
131
|
+
case "math":
|
|
132
|
+
return "math";
|
|
133
|
+
case "foreignObject":
|
|
134
|
+
return undefined;
|
|
135
|
+
}
|
|
136
|
+
return scope;
|
|
137
|
+
},
|
|
112
138
|
create() {
|
|
113
139
|
return { value: "" };
|
|
114
140
|
},
|
|
@@ -129,14 +155,14 @@ const impl = {
|
|
|
129
155
|
return value.value || "";
|
|
130
156
|
}
|
|
131
157
|
},
|
|
132
|
-
arrange({ tag, tagName, node, props, children, }) {
|
|
158
|
+
arrange({ tag, tagName, node, props, children, scope, }) {
|
|
133
159
|
if (tag === Portal) {
|
|
134
160
|
return;
|
|
135
161
|
}
|
|
136
162
|
else if (typeof tag !== "string") {
|
|
137
163
|
throw new Error(`Unknown tag: ${tagName}`);
|
|
138
164
|
}
|
|
139
|
-
const attrs = printAttrs(props);
|
|
165
|
+
const attrs = printAttrs(props, scope === "svg" || tag === "foreignObject");
|
|
140
166
|
const open = `<${tag}${attrs.length ? " " : ""}${attrs}>`;
|
|
141
167
|
let result;
|
|
142
168
|
if (voidTags.has(tag)) {
|
|
@@ -144,7 +170,11 @@ const impl = {
|
|
|
144
170
|
}
|
|
145
171
|
else {
|
|
146
172
|
const close = `</${tag}>`;
|
|
147
|
-
const contents = "innerHTML" in props
|
|
173
|
+
const contents = "innerHTML" in props
|
|
174
|
+
? props["innerHTML"]
|
|
175
|
+
: "dangerouslySetInnerHTML" in props
|
|
176
|
+
? (props["dangerouslySetInnerHTML"]?.__html ?? "")
|
|
177
|
+
: join(children);
|
|
148
178
|
result = `${open}${contents}${close}`;
|
|
149
179
|
}
|
|
150
180
|
node.value = result;
|
package/html.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html.js","sources":["../src/html.ts"],"sourcesContent":["import {Portal, Renderer} from \"./crank.js\";\nimport type {ElementValue, RenderAdapter} from \"./crank.js\";\nimport {camelToKebabCase, formatStyleValue} from \"./_css.js\";\n\nconst voidTags = new Set([\n\t\"area\",\n\t\"base\",\n\t\"br\",\n\t\"col\",\n\t\"command\",\n\t\"embed\",\n\t\"hr\",\n\t\"img\",\n\t\"input\",\n\t\"keygen\",\n\t\"link\",\n\t\"meta\",\n\t\"param\",\n\t\"source\",\n\t\"track\",\n\t\"wbr\",\n]);\n\nfunction escape(text: string): string {\n\treturn text.replace(/[&<>\"']/g, (match) => {\n\t\tswitch (match) {\n\t\t\tcase \"&\":\n\t\t\t\treturn \"&\";\n\t\t\tcase \"<\":\n\t\t\t\treturn \"<\";\n\t\t\tcase \">\":\n\t\t\t\treturn \">\";\n\t\t\tcase '\"':\n\t\t\t\treturn \""\";\n\t\t\tcase \"'\":\n\t\t\t\treturn \"'\";\n\t\t\tdefault:\n\t\t\t\treturn \"\";\n\t\t}\n\t});\n}\n\nfunction printStyleObject(style: Record<string, any>): string {\n\tconst cssStrings = [];\n\tfor (const [name, value] of Object.entries(style)) {\n\t\tif (value != null) {\n\t\t\tconst cssName = camelToKebabCase(name);\n\t\t\tconst cssValue = formatStyleValue(cssName, value);\n\t\t\tcssStrings.push(`${cssName}:${cssValue};`);\n\t\t}\n\t}\n\n\treturn cssStrings.join(\"\");\n}\n\nfunction printAttrs(props: Record<string, any>): string {\n\tconst attrs: string[] = [];\n\tfor (let [name, value] of Object.entries(props)) {\n\t\tif (name === \"innerHTML\" || name.startsWith(\"prop:\")) {\n\t\t\tcontinue;\n\t\t} else if (name === \"style\") {\n\t\t\tif (typeof value === \"string\") {\n\t\t\t\tattrs.push(`style=\"${escape(value)}\"`);\n\t\t\t} else if (typeof value === \"object\" && value !== null) {\n\t\t\t\tattrs.push(`style=\"${escape(printStyleObject(value))}\"`);\n\t\t\t}\n\t\t} else if (name === \"className\") {\n\t\t\tif (\"class\" in props || typeof value !== \"string\") {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tattrs.push(`class=\"${escape(value)}\"`);\n\t\t} else if (name === \"class\") {\n\t\t\tif (typeof value === \"string\") {\n\t\t\t\tattrs.push(`class=\"${escape(value)}\"`);\n\t\t\t} else if (typeof value === \"object\" && value !== null) {\n\t\t\t\t// class={{\"foo bar\": true, \"baz\": false}} syntax\n\t\t\t\tconst classes = Object.keys(value)\n\t\t\t\t\t.filter((k) => value[k])\n\t\t\t\t\t.join(\" \");\n\t\t\t\tif (classes) {\n\t\t\t\t\tattrs.push(`class=\"${escape(classes)}\"`);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif (name.startsWith(\"attr:\")) {\n\t\t\t\tname = name.slice(\"attr:\".length);\n\t\t\t}\n\t\t\tif (typeof value === \"string\") {\n\t\t\t\tattrs.push(`${escape(name)}=\"${escape(value)}\"`);\n\t\t\t} else if (typeof value === \"number\") {\n\t\t\t\tattrs.push(`${escape(name)}=\"${value}\"`);\n\t\t\t} else if (value === true) {\n\t\t\t\tattrs.push(`${escape(name)}`);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn attrs.join(\" \");\n}\n\n/**\n * The equivalent of DOM Node for the HTML Renderer. Not to be confused with\n * the DOM's Text node. It's just an object with value string so that\n * we can reference the value of the HTML by reference, not value.\n *\n * TextNode is never actually\n */\ninterface TextNode {\n\tvalue?: string;\n}\n\nfunction join(children: Array<TextNode | string>): string {\n\tlet result = \"\";\n\tfor (let i = 0; i < children.length; i++) {\n\t\tconst child = children[i];\n\t\tresult += typeof child === \"string\" ? child : child.value;\n\t}\n\n\treturn result;\n}\n\nexport const impl: Partial<\n\tRenderAdapter<TextNode, undefined, TextNode, string>\n> = {\n\tcreate(): TextNode {\n\t\treturn {value: \"\"};\n\t},\n\n\ttext({value}: {value: string}): TextNode {\n\t\treturn {value: escape(value)};\n\t},\n\n\tread(value: ElementValue<TextNode>): string {\n\t\tif (Array.isArray(value)) {\n\t\t\treturn join(value);\n\t\t} else if (typeof value === \"undefined\") {\n\t\t\treturn \"\";\n\t\t} else if (typeof value === \"string\") {\n\t\t\treturn value;\n\t\t} else {\n\t\t\treturn value.value || \"\";\n\t\t}\n\t},\n\n\tarrange({\n\t\ttag,\n\t\ttagName,\n\t\tnode,\n\t\tprops,\n\t\tchildren,\n\t}: {\n\t\ttag: string | symbol;\n\t\ttagName: string;\n\t\tnode: TextNode;\n\t\tprops: Record<string, any>;\n\t\tchildren: Array<TextNode | string>;\n\t\troot: TextNode | undefined;\n\t}): void {\n\t\tif (tag === Portal) {\n\t\t\treturn;\n\t\t} else if (typeof tag !== \"string\") {\n\t\t\tthrow new Error(`Unknown tag: ${tagName}`);\n\t\t}\n\n\t\tconst attrs = printAttrs(props);\n\t\tconst open = `<${tag}${attrs.length ? \" \" : \"\"}${attrs}>`;\n\t\tlet result: string;\n\t\tif (voidTags.has(tag)) {\n\t\t\tresult = open;\n\t\t} else {\n\t\t\tconst close = `</${tag}>`;\n\t\t\tconst contents =\n\t\t\t\t\"innerHTML\" in props ? props[\"innerHTML\"] : join(children);\n\t\t\tresult = `${open}${contents}${close}`;\n\t\t}\n\n\t\tnode.value = result;\n\t},\n};\n\nexport class HTMLRenderer extends Renderer<TextNode, undefined, any, string> {\n\tconstructor() {\n\t\tsuper(impl);\n\t}\n}\n\nexport const renderer = new HTMLRenderer();\n\ndeclare global {\n\tmodule Crank {\n\t\tinterface EventMap extends GlobalEventHandlersEventMap {}\n\t}\n}\n"],"names":[],"mappings":";;;;AAIA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAG,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAG,CAAC;IACxB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM;IACN,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM;IACN,CAAA,CAAA,CAAA,CAAI;IACJ,CAAA,CAAA,CAAA,CAAA,CAAK;IACL,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS;IACT,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO;IACP,CAAA,CAAA,CAAA,CAAI;IACJ,CAAA,CAAA,CAAA,CAAA,CAAK;IACL,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO;IACP,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ;IACR,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM;IACN,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM;IACN,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO;IACP,CAAA,CAAA,CAAA,CAAA,CAAA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crank.js\";\nimport type {ElementValue, RenderAdapter} from \"./crank.js\";\nimport {camelToKebabCase, formatStyleValue} from \"./_css.js\";\nimport {REACT_SVG_PROPS} from \"./_svg.js\";\n\nconst voidTags = new Set([\n\t\"area\",\n\t\"base\",\n\t\"br\",\n\t\"col\",\n\t\"command\",\n\t\"embed\",\n\t\"hr\",\n\t\"img\",\n\t\"input\",\n\t\"keygen\",\n\t\"link\",\n\t\"meta\",\n\t\"param\",\n\t\"source\",\n\t\"track\",\n\t\"wbr\",\n]);\n\nfunction escape(text: string): string {\n\treturn text.replace(/[&<>\"']/g, (match) => {\n\t\tswitch (match) {\n\t\t\tcase \"&\":\n\t\t\t\treturn \"&\";\n\t\t\tcase \"<\":\n\t\t\t\treturn \"<\";\n\t\t\tcase \">\":\n\t\t\t\treturn \">\";\n\t\t\tcase '\"':\n\t\t\t\treturn \""\";\n\t\t\tcase \"'\":\n\t\t\t\treturn \"'\";\n\t\t\tdefault:\n\t\t\t\treturn \"\";\n\t\t}\n\t});\n}\n\nfunction printStyleObject(style: Record<string, any>): string {\n\tconst cssStrings = [];\n\tfor (const [name, value] of Object.entries(style)) {\n\t\tif (value != null) {\n\t\t\tconst cssName = camelToKebabCase(name);\n\t\t\tconst cssValue = formatStyleValue(cssName, value);\n\t\t\tcssStrings.push(`${cssName}:${cssValue};`);\n\t\t}\n\t}\n\n\treturn cssStrings.join(\"\");\n}\n\nfunction printAttrs(props: Record<string, any>, isSVG?: boolean): string {\n\tconst attrs: string[] = [];\n\tfor (let [name, value] of Object.entries(props)) {\n\t\tif (\n\t\t\tname === \"innerHTML\" ||\n\t\t\tname === \"dangerouslySetInnerHTML\" ||\n\t\t\tname.startsWith(\"prop:\")\n\t\t) {\n\t\t\tcontinue;\n\t\t} else if (name === \"htmlFor\") {\n\t\t\tif (\"for\" in props || value == null || value === false) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tattrs.push(`for=\"${escape(String(value === true ? \"\" : value))}\"`);\n\t\t} else if (name === \"style\") {\n\t\t\tif (typeof value === \"string\") {\n\t\t\t\tattrs.push(`style=\"${escape(value)}\"`);\n\t\t\t} else if (typeof value === \"object\" && value !== null) {\n\t\t\t\tattrs.push(`style=\"${escape(printStyleObject(value))}\"`);\n\t\t\t}\n\t\t} else if (name === \"className\") {\n\t\t\tif (\"class\" in props || typeof value !== \"string\") {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tattrs.push(`class=\"${escape(value)}\"`);\n\t\t} else if (name === \"class\") {\n\t\t\tif (typeof value === \"string\") {\n\t\t\t\tattrs.push(`class=\"${escape(value)}\"`);\n\t\t\t} else if (typeof value === \"object\" && value !== null) {\n\t\t\t\t// class={{\"foo bar\": true, \"baz\": false}} syntax\n\t\t\t\tconst classes = Object.keys(value)\n\t\t\t\t\t.filter((k) => value[k])\n\t\t\t\t\t.join(\" \");\n\t\t\t\tif (classes) {\n\t\t\t\t\tattrs.push(`class=\"${escape(classes)}\"`);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif (name.startsWith(\"attr:\")) {\n\t\t\t\tname = name.slice(\"attr:\".length);\n\t\t\t} else if (isSVG && name in REACT_SVG_PROPS) {\n\t\t\t\tname = REACT_SVG_PROPS[name];\n\t\t\t}\n\t\t\tif (typeof value === \"string\") {\n\t\t\t\tattrs.push(`${escape(name)}=\"${escape(value)}\"`);\n\t\t\t} else if (typeof value === \"number\") {\n\t\t\t\tattrs.push(`${escape(name)}=\"${value}\"`);\n\t\t\t} else if (value === true) {\n\t\t\t\tattrs.push(`${escape(name)}`);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn attrs.join(\" \");\n}\n\n/**\n * The equivalent of DOM Node for the HTML Renderer. Not to be confused with\n * the DOM's Text node. It's just an object with value string so that\n * we can reference the value of the HTML by reference, not value.\n *\n * TextNode is never actually\n */\ninterface TextNode {\n\tvalue?: string;\n}\n\nfunction join(children: Array<TextNode | string>): string {\n\tlet result = \"\";\n\tfor (let i = 0; i < children.length; i++) {\n\t\tconst child = children[i];\n\t\tresult += typeof child === \"string\" ? child : child.value;\n\t}\n\n\treturn result;\n}\n\nexport const impl: Partial<RenderAdapter<TextNode, string, TextNode, string>> =\n\t{\n\t\tscope({\n\t\t\tscope,\n\t\t\ttag,\n\t\t}: {\n\t\t\tscope: string | undefined;\n\t\t\ttag: string | symbol;\n\t\t\tprops: Record<string, any>;\n\t\t\troot: TextNode | undefined;\n\t\t}): string | undefined {\n\t\t\tif (tag === Portal) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tswitch (tag) {\n\t\t\t\tcase \"svg\":\n\t\t\t\t\treturn \"svg\";\n\t\t\t\tcase \"math\":\n\t\t\t\t\treturn \"math\";\n\t\t\t\tcase \"foreignObject\":\n\t\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\treturn scope;\n\t\t},\n\n\t\tcreate(): TextNode {\n\t\t\treturn {value: \"\"};\n\t\t},\n\n\t\ttext({value}: {value: string}): TextNode {\n\t\t\treturn {value: escape(value)};\n\t\t},\n\n\t\tread(value: ElementValue<TextNode>): string {\n\t\t\tif (Array.isArray(value)) {\n\t\t\t\treturn join(value);\n\t\t\t} else if (typeof value === \"undefined\") {\n\t\t\t\treturn \"\";\n\t\t\t} else if (typeof value === \"string\") {\n\t\t\t\treturn value;\n\t\t\t} else {\n\t\t\t\treturn value.value || \"\";\n\t\t\t}\n\t\t},\n\n\t\tarrange({\n\t\t\ttag,\n\t\t\ttagName,\n\t\t\tnode,\n\t\t\tprops,\n\t\t\tchildren,\n\t\t\tscope,\n\t\t}: {\n\t\t\ttag: string | symbol;\n\t\t\ttagName: string;\n\t\t\tnode: TextNode;\n\t\t\tprops: Record<string, any>;\n\t\t\tchildren: Array<TextNode | string>;\n\t\t\tscope: string | undefined;\n\t\t\troot: TextNode | undefined;\n\t\t}): void {\n\t\t\tif (tag === Portal) {\n\t\t\t\treturn;\n\t\t\t} else if (typeof tag !== \"string\") {\n\t\t\t\tthrow new Error(`Unknown tag: ${tagName}`);\n\t\t\t}\n\n\t\t\tconst attrs = printAttrs(\n\t\t\t\tprops,\n\t\t\t\tscope === \"svg\" || tag === \"foreignObject\",\n\t\t\t);\n\t\t\tconst open = `<${tag}${attrs.length ? \" \" : \"\"}${attrs}>`;\n\t\t\tlet result: string;\n\t\t\tif (voidTags.has(tag)) {\n\t\t\t\tresult = open;\n\t\t\t} else {\n\t\t\t\tconst close = `</${tag}>`;\n\t\t\t\tconst contents =\n\t\t\t\t\t\"innerHTML\" in props\n\t\t\t\t\t\t? props[\"innerHTML\"]\n\t\t\t\t\t\t: \"dangerouslySetInnerHTML\" in props\n\t\t\t\t\t\t\t? (props[\"dangerouslySetInnerHTML\"]?.__html ?? \"\")\n\t\t\t\t\t\t\t: join(children);\n\t\t\t\tresult = `${open}${contents}${close}`;\n\t\t\t}\n\n\t\t\tnode.value = result;\n\t\t},\n\t};\n\nexport class HTMLRenderer extends Renderer<TextNode, string, any, string> {\n\tconstructor() {\n\t\tsuper(impl);\n\t}\n}\n\nexport const renderer = new HTMLRenderer();\n\ndeclare global {\n\tmodule Crank {\n\t\tinterface EventMap extends GlobalEventHandlersEventMap {}\n\t}\n}\n"],"names":[],"mappings":";;;;;AAKA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAG,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAG,CAAC;IACxB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM;IACN,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM;IACN,CAAA,CAAA,CAAA,CAAI;IACJ,CAAA,CAAA,CAAA,CAAA,CAAK;IACL,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS;IACT,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO;IACP,CAAA,CAAA,CAAA,CAAI;IACJ,CAAA,CAAA,CAAA,CAAA,CAAK;IACL,CAAA,CAAA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A,CAAA,CAAA,CAAA,CAAI,CAAC,CAAA,CAAA,CAAA,CAAA,CAAK,CAAA,CAAA,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM;IACpB,CAAC;;AAGG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAuC,CAAA;AACxE,CAAA,CAAA,CAAA,CAAA,WAAA,CAAA,CAAA,CAAA;QACC,CAAA,CAAA,CAAA,CAAA,CAAK,CAAC,CAAA,CAAA,CAAA,CAAI,CAAC;IACZ;AACA;AAEM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAG,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,CAAA,CAAA;;"}
|
package/jsx-tag.cjs
CHANGED
|
@@ -8,7 +8,17 @@ function jsx(spans, ...expressions) {
|
|
|
8
8
|
let parseResult = cache.get(key);
|
|
9
9
|
if (parseResult == null) {
|
|
10
10
|
parseResult = parse(spans.raw);
|
|
11
|
-
|
|
11
|
+
let hasError = false;
|
|
12
|
+
for (let i = 0; i < parseResult.targets.length; i++) {
|
|
13
|
+
const t = parseResult.targets[i];
|
|
14
|
+
if (t && t.type === "error") {
|
|
15
|
+
hasError = true;
|
|
16
|
+
break;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
if (!hasError) {
|
|
20
|
+
cache.set(key, parseResult);
|
|
21
|
+
}
|
|
12
22
|
}
|
|
13
23
|
const { element, targets } = parseResult;
|
|
14
24
|
for (let i = 0; i < expressions.length; i++) {
|
|
@@ -16,12 +26,15 @@ function jsx(spans, ...expressions) {
|
|
|
16
26
|
const target = targets[i];
|
|
17
27
|
if (target) {
|
|
18
28
|
if (target.type === "error") {
|
|
19
|
-
|
|
29
|
+
const msg = target.message.replace("${}", formatTagForError(exp));
|
|
30
|
+
throw new SyntaxError(target.spanIndex != null && target.charIndex != null
|
|
31
|
+
? formatSyntaxError(msg, spans.raw, target.spanIndex, target.charIndex)
|
|
32
|
+
: msg);
|
|
20
33
|
}
|
|
21
34
|
target.value = exp;
|
|
22
35
|
}
|
|
23
36
|
}
|
|
24
|
-
return build(element);
|
|
37
|
+
return build(element, parseResult.spans);
|
|
25
38
|
}
|
|
26
39
|
/** Alias for `jsx` template tag. */
|
|
27
40
|
const html = jsx;
|
|
@@ -113,16 +126,20 @@ function parse(spans) {
|
|
|
113
126
|
type: "tag",
|
|
114
127
|
slash: closingSlash,
|
|
115
128
|
value: tagName,
|
|
129
|
+
spanIndex: s,
|
|
130
|
+
charIndex: match.index,
|
|
116
131
|
};
|
|
117
132
|
if (!stack.length) {
|
|
118
133
|
if (end !== span.length) {
|
|
119
|
-
throw new SyntaxError(`Unmatched closing tag "${tagName}"
|
|
134
|
+
throw new SyntaxError(formatSyntaxError(`Unmatched closing tag "${tagName}"`, spans, s, match.index));
|
|
120
135
|
}
|
|
121
136
|
// ERROR EXPRESSION
|
|
122
137
|
expressionTarget = {
|
|
123
138
|
type: "error",
|
|
124
139
|
message: "Unmatched closing tag ${}",
|
|
125
140
|
value: null,
|
|
141
|
+
spanIndex: s,
|
|
142
|
+
charIndex: match.index,
|
|
126
143
|
};
|
|
127
144
|
}
|
|
128
145
|
else {
|
|
@@ -141,6 +158,8 @@ function parse(spans) {
|
|
|
141
158
|
type: "tag",
|
|
142
159
|
slash: "",
|
|
143
160
|
value: tagName,
|
|
161
|
+
spanIndex: s,
|
|
162
|
+
charIndex: match.index,
|
|
144
163
|
},
|
|
145
164
|
close: null,
|
|
146
165
|
props: [],
|
|
@@ -175,7 +194,7 @@ function parse(spans) {
|
|
|
175
194
|
if (match) {
|
|
176
195
|
const [, tagEnd, spread, name, equals, string] = match;
|
|
177
196
|
if (i < match.index) {
|
|
178
|
-
throw new SyntaxError(`Unexpected text \`${span.slice(i, match.index).trim()}
|
|
197
|
+
throw new SyntaxError(formatSyntaxError(`Unexpected text \`${span.slice(i, match.index).trim()}\``, spans, s, i));
|
|
179
198
|
}
|
|
180
199
|
if (tagEnd) {
|
|
181
200
|
if (tagEnd[0] === "/") {
|
|
@@ -194,7 +213,7 @@ function parse(spans) {
|
|
|
194
213
|
// SPREAD PROP EXPRESSION
|
|
195
214
|
expressionTarget = value;
|
|
196
215
|
if (!(expressing && end === span.length)) {
|
|
197
|
-
throw new SyntaxError('Expression expected after "..."');
|
|
216
|
+
throw new SyntaxError(formatSyntaxError('Expression expected after "..."', spans, s, match.index));
|
|
198
217
|
}
|
|
199
218
|
}
|
|
200
219
|
else if (name) {
|
|
@@ -204,14 +223,14 @@ function parse(spans) {
|
|
|
204
223
|
value = { type: "value", value: true };
|
|
205
224
|
}
|
|
206
225
|
else if (end < span.length) {
|
|
207
|
-
throw new SyntaxError(`Unexpected text \`${span.slice(end, end + 20)}
|
|
226
|
+
throw new SyntaxError(formatSyntaxError(`Unexpected text \`${span.slice(end, end + 20)}\``, spans, s, end));
|
|
208
227
|
}
|
|
209
228
|
else {
|
|
210
229
|
value = { type: "value", value: null };
|
|
211
230
|
// PROP EXPRESSION
|
|
212
231
|
expressionTarget = value;
|
|
213
232
|
if (!(expressing && end === span.length)) {
|
|
214
|
-
throw new SyntaxError(`Expression expected for prop "${name}"
|
|
233
|
+
throw new SyntaxError(formatSyntaxError(`Expression expected for prop "${name}"`, spans, s, match.index));
|
|
215
234
|
}
|
|
216
235
|
}
|
|
217
236
|
}
|
|
@@ -237,10 +256,10 @@ function parse(spans) {
|
|
|
237
256
|
else {
|
|
238
257
|
if (!expressing) {
|
|
239
258
|
if (i === span.length) {
|
|
240
|
-
throw new SyntaxError(`Expected props but reached end of document
|
|
259
|
+
throw new SyntaxError(formatSyntaxError(`Expected props but reached end of document`, spans, s, i));
|
|
241
260
|
}
|
|
242
261
|
else {
|
|
243
|
-
throw new SyntaxError(`Unexpected text \`${span.slice(i, i + 20).trim()}
|
|
262
|
+
throw new SyntaxError(formatSyntaxError(`Unexpected text \`${span.slice(i, i + 20).trim()}\``, spans, s, i));
|
|
244
263
|
}
|
|
245
264
|
}
|
|
246
265
|
// Unexpected expression errors are handled in the outer loop.
|
|
@@ -255,13 +274,13 @@ function parse(spans) {
|
|
|
255
274
|
// We're in a closing tag and looking for the >.
|
|
256
275
|
if (match) {
|
|
257
276
|
if (i < match.index) {
|
|
258
|
-
throw new SyntaxError(`Unexpected text \`${span.slice(i, match.index).trim()}
|
|
277
|
+
throw new SyntaxError(formatSyntaxError(`Unexpected text \`${span.slice(i, match.index).trim()}\``, spans, s, i));
|
|
259
278
|
}
|
|
260
279
|
matcher = CHILDREN_RE;
|
|
261
280
|
}
|
|
262
281
|
else {
|
|
263
282
|
if (!expressing) {
|
|
264
|
-
throw new SyntaxError(`Unexpected text \`${span.slice(i, i + 20).trim()}
|
|
283
|
+
throw new SyntaxError(formatSyntaxError(`Unexpected text \`${span.slice(i, i + 20).trim()}\``, spans, s, i));
|
|
265
284
|
}
|
|
266
285
|
}
|
|
267
286
|
break;
|
|
@@ -277,7 +296,7 @@ function parse(spans) {
|
|
|
277
296
|
}
|
|
278
297
|
else {
|
|
279
298
|
if (!expressing) {
|
|
280
|
-
throw new SyntaxError(`Missing \`${matcher === CLOSING_SINGLE_QUOTE_RE ? "'" : '"'}
|
|
299
|
+
throw new SyntaxError(formatSyntaxError(`Missing \`${matcher === CLOSING_SINGLE_QUOTE_RE ? "'" : '"'}\``, spans, s, i));
|
|
281
300
|
}
|
|
282
301
|
}
|
|
283
302
|
break;
|
|
@@ -288,7 +307,7 @@ function parse(spans) {
|
|
|
288
307
|
}
|
|
289
308
|
else {
|
|
290
309
|
if (!expressing) {
|
|
291
|
-
throw new SyntaxError("Expected `-->` but reached end of template");
|
|
310
|
+
throw new SyntaxError(formatSyntaxError("Expected `-->` but reached end of template", spans, s, i));
|
|
292
311
|
}
|
|
293
312
|
}
|
|
294
313
|
break;
|
|
@@ -322,40 +341,45 @@ function parse(spans) {
|
|
|
322
341
|
targets.push(null);
|
|
323
342
|
break;
|
|
324
343
|
default:
|
|
325
|
-
throw new SyntaxError("Unexpected expression");
|
|
344
|
+
throw new SyntaxError(formatSyntaxError("Unexpected expression", spans, s, spans[s].length));
|
|
326
345
|
}
|
|
327
346
|
}
|
|
328
347
|
else if (expressionTarget) {
|
|
329
|
-
throw new SyntaxError("Expression expected");
|
|
348
|
+
throw new SyntaxError(formatSyntaxError("Expression expected", spans, s, spans[s].length));
|
|
330
349
|
}
|
|
331
350
|
lineStart = false;
|
|
332
351
|
}
|
|
333
352
|
if (stack.length) {
|
|
334
353
|
const ti = targets.indexOf(element.open);
|
|
335
354
|
if (ti === -1) {
|
|
336
|
-
throw new SyntaxError(`Unmatched opening tag "${element.open.value}"
|
|
355
|
+
throw new SyntaxError(formatSyntaxError(`Unmatched opening tag "${element.open.value}"`, spans, element.open.spanIndex ?? 0, element.open.charIndex ?? 0));
|
|
337
356
|
}
|
|
338
357
|
targets[ti] = {
|
|
339
358
|
type: "error",
|
|
340
359
|
message: "Unmatched opening tag ${}",
|
|
341
360
|
value: null,
|
|
361
|
+
spanIndex: element.open.spanIndex,
|
|
362
|
+
charIndex: element.open.charIndex,
|
|
342
363
|
};
|
|
343
364
|
}
|
|
344
365
|
if (element.children.length === 1 && element.children[0].type === "element") {
|
|
345
366
|
element = element.children[0];
|
|
346
367
|
}
|
|
347
|
-
return { element, targets };
|
|
368
|
+
return { element, targets, spans };
|
|
348
369
|
}
|
|
349
|
-
function build(parsed) {
|
|
370
|
+
function build(parsed, spans) {
|
|
350
371
|
if (parsed.close !== null &&
|
|
351
372
|
parsed.close.slash !== "//" &&
|
|
352
373
|
parsed.open.value !== parsed.close.value) {
|
|
353
|
-
|
|
374
|
+
const msg = `Unmatched closing tag ${formatTagForError(parsed.close.value)}, expected ${formatTagForError(parsed.open.value)}`;
|
|
375
|
+
throw new SyntaxError(spans && parsed.close.spanIndex != null && parsed.close.charIndex != null
|
|
376
|
+
? formatSyntaxError(msg, spans, parsed.close.spanIndex, parsed.close.charIndex)
|
|
377
|
+
: msg);
|
|
354
378
|
}
|
|
355
379
|
const children = [];
|
|
356
380
|
for (let i = 0; i < parsed.children.length; i++) {
|
|
357
381
|
const child = parsed.children[i];
|
|
358
|
-
children.push(child.type === "element" ? build(child) : child.value);
|
|
382
|
+
children.push(child.type === "element" ? build(child, spans) : child.value);
|
|
359
383
|
}
|
|
360
384
|
let props = parsed.props.length ? {} : null;
|
|
361
385
|
for (let i = 0; i < parsed.props.length; i++) {
|
|
@@ -426,7 +450,48 @@ function formatTagForError(tag) {
|
|
|
426
450
|
? `"${tag}"`
|
|
427
451
|
: JSON.stringify(tag);
|
|
428
452
|
}
|
|
453
|
+
function formatSyntaxError(message, spans, spanIndex, charIndex) {
|
|
454
|
+
// Reconstruct full template source with ${} placeholders
|
|
455
|
+
let source = spans[0];
|
|
456
|
+
for (let i = 1; i < spans.length; i++) {
|
|
457
|
+
source += "${}" + spans[i];
|
|
458
|
+
}
|
|
459
|
+
// Compute absolute offset
|
|
460
|
+
let offset = 0;
|
|
461
|
+
for (let i = 0; i < spanIndex; i++) {
|
|
462
|
+
offset += spans[i].length + 3; // 3 = "${}".length
|
|
463
|
+
}
|
|
464
|
+
offset += charIndex;
|
|
465
|
+
// Split into lines and find line/column
|
|
466
|
+
const lines = source.split(/\n/);
|
|
467
|
+
let line = 0;
|
|
468
|
+
let col = offset;
|
|
469
|
+
for (let i = 0; i < lines.length; i++) {
|
|
470
|
+
if (col <= lines[i].length) {
|
|
471
|
+
line = i;
|
|
472
|
+
break;
|
|
473
|
+
}
|
|
474
|
+
col -= lines[i].length + 1; // +1 for the newline
|
|
475
|
+
}
|
|
476
|
+
// Build context lines
|
|
477
|
+
let result = `${message}\n\n`;
|
|
478
|
+
const start = Math.max(0, line - 1);
|
|
479
|
+
const end = Math.min(lines.length - 1, line + 1);
|
|
480
|
+
const gutterWidth = String(end + 1).length;
|
|
481
|
+
for (let i = start; i <= end; i++) {
|
|
482
|
+
const num = String(i + 1).padStart(gutterWidth);
|
|
483
|
+
if (i === line) {
|
|
484
|
+
result += `> ${num} | ${lines[i]}\n`;
|
|
485
|
+
result += ` ${" ".repeat(gutterWidth)} | ${" ".repeat(col)}^\n`;
|
|
486
|
+
}
|
|
487
|
+
else {
|
|
488
|
+
result += ` ${num} | ${lines[i]}\n`;
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
return result.trimEnd();
|
|
492
|
+
}
|
|
429
493
|
|
|
430
494
|
exports.html = html;
|
|
431
495
|
exports.jsx = jsx;
|
|
496
|
+
exports.parse = parse;
|
|
432
497
|
//# sourceMappingURL=jsx-tag.cjs.map
|
package/jsx-tag.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsx-tag.cjs","sources":["../src/jsx-tag.ts"],"sourcesContent":["import {createElement} from \"./crank.js\";\nimport type {Element} from \"./crank.js\";\n\nconst cache = new Map<string, ParseResult>();\nexport function jsx(\n\tspans: TemplateStringsArray,\n\t...expressions: Array<unknown>\n): Element {\n\tconst key = JSON.stringify(spans.raw);\n\tlet parseResult = cache.get(key);\n\tif (parseResult == null) {\n\t\tparseResult = parse(spans.raw);\n\t\tcache.set(key, parseResult);\n\t}\n\n\tconst {element, targets} = parseResult;\n\tfor (let i = 0; i < expressions.length; i++) {\n\t\tconst exp = expressions[i];\n\t\tconst target = targets[i];\n\t\tif (target) {\n\t\t\tif (target.type === \"error\") {\n\t\t\t\tthrow new SyntaxError(\n\t\t\t\t\ttarget.message.replace(\"${}\", formatTagForError(exp)),\n\t\t\t\t);\n\t\t\t}\n\n\t\t\ttarget.value = exp;\n\t\t}\n\t}\n\n\treturn build(element);\n}\n\n/** Alias for `jsx` template tag. */\nexport const html = jsx;\n\n// Type definitions for a bare-bones AST\ninterface ParseElement {\n\ttype: \"element\";\n\topen: ParseTag;\n\tclose: ParseTag | null;\n\t// ParseValue is used to represent spread props.\n\tprops: Array<ParseProp | ParseValue>;\n\tchildren: Array<ParseElement | ParseValue>;\n}\n\ninterface ParseValue {\n\ttype: \"value\";\n\tvalue: any;\n}\n\ninterface ParseTag {\n\ttype: \"tag\";\n\tslash: string;\n\tvalue: any;\n}\n\ninterface ParseProp {\n\ttype: \"prop\";\n\tname: string;\n\tvalue: ParseValue | ParsePropString;\n}\n\ninterface ParsePropString {\n\ttype: \"propString\";\n\tparts: Array<string | ParseValue>;\n}\n\ninterface ParseError {\n\ttype: \"error\";\n\tmessage: string;\n\tvalue: any;\n}\n\n// The parse result includes an array of targets, references to objects in the\n// parse tree whose `value` property is overwritten with expressions when the\n// template function is called. By separating the logic of parsing static\n// template spans from the handling of dynamic expressions, we can cache parse\n// results for successive calls.\ntype ExpressionTarget = ParseValue | ParseTag | ParseProp | ParseError;\n\ninterface ParseResult {\n\telement: ParseElement;\n\ttargets: Array<ExpressionTarget | null>;\n}\n\n/**\n * Matches first significant character in children mode.\n *\n * Group 1: newline\n * Group 2: comment\n * Group 3: tag\n * Group 4: closing slash\n * Group 5: tag name\n *\n * The comment group must appear first because the tag group can potentially\n * match a comment, so that we can handle tag expressions where we've reached\n * the end of a span.\n */\nconst CHILDREN_RE =\n\t/((?:\\r|\\n|\\r\\n)\\s*)|(<!--[\\S\\s]*?(?:-->|$))|(<\\s*(\\/{0,2})\\s*([-_$\\w]*))/g;\n\n/**\n * Matches props after element tags.\n *\n * Group 1: tag end\n * Group 2: spread props\n * Group 3: prop name\n * Group 4: equals\n * Group 5: prop value string\n */\nconst PROPS_RE =\n\t/\\s*(?:(\\/?\\s*>)|(\\.\\.\\.\\s*)|(?:([-_$\\w]+)\\s*(=)?\\s*(?:(\"(\\\\\"|[\\S\\s])*?(?:\"|$)|'(?:\\\\'|[\\S\\s])*?(?:'|$)))?))/g;\n\nconst CLOSING_BRACKET_RE = />/g;\n\nconst CLOSING_SINGLE_QUOTE_RE = /[^\\\\]?'/g;\n\nconst CLOSING_DOUBLE_QUOTE_RE = /[^\\\\]?\"/g;\n\nconst CLOSING_COMMENT_RE = /-->/g;\n\nfunction parse(spans: ArrayLike<string>): ParseResult {\n\tlet matcher = CHILDREN_RE;\n\tconst stack: Array<ParseElement> = [];\n\tlet element: ParseElement = {\n\t\ttype: \"element\",\n\t\topen: {type: \"tag\", slash: \"\", value: \"\"},\n\t\tclose: null,\n\t\tprops: [],\n\t\tchildren: [],\n\t};\n\n\tconst targets: Array<ExpressionTarget | null> = [];\n\tlet lineStart = true;\n\tfor (let s = 0; s < spans.length; s++) {\n\t\tconst span = spans[s];\n\t\t// Whether or not an expression is upcoming. Used to provide better errors.\n\t\tconst expressing = s < spans.length - 1;\n\t\tlet expressionTarget: ExpressionTarget | null = null;\n\t\tfor (let i = 0, end = i; i < span.length; i = end) {\n\t\t\tmatcher.lastIndex = i;\n\t\t\tconst match = matcher.exec(span);\n\t\t\tend = match ? match.index + match[0].length : span.length;\n\t\t\tswitch (matcher) {\n\t\t\t\tcase CHILDREN_RE: {\n\t\t\t\t\tif (match) {\n\t\t\t\t\t\tconst [, newline, comment, tag, closingSlash, tagName] = match;\n\t\t\t\t\t\tif (i < match.index) {\n\t\t\t\t\t\t\tlet before = span.slice(i, match.index);\n\t\t\t\t\t\t\tif (lineStart) {\n\t\t\t\t\t\t\t\tbefore = before.replace(/^\\s*/, \"\");\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (newline) {\n\t\t\t\t\t\t\t\tif (span[Math.max(0, match.index - 1)] === \"\\\\\") {\n\t\t\t\t\t\t\t\t\t// We preserve whitespace before escaped newlines and have to\n\t\t\t\t\t\t\t\t\t// remove the backslash.\n\t\t\t\t\t\t\t\t\t// jsx` \\\n\t\t\t\t\t\t\t\t\t// `\n\t\t\t\t\t\t\t\t\tbefore = before.slice(0, -1);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tbefore = before.replace(/\\s*$/, \"\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (before) {\n\t\t\t\t\t\t\t\telement.children.push({type: \"value\", value: before});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlineStart = !!newline;\n\t\t\t\t\t\tif (comment) {\n\t\t\t\t\t\t\tif (end === span.length) {\n\t\t\t\t\t\t\t\t// Expression in a comment:\n\t\t\t\t\t\t\t\t// jsx`<!-- ${exp} -->`\n\t\t\t\t\t\t\t\tmatcher = CLOSING_COMMENT_RE;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (tag) {\n\t\t\t\t\t\t\tif (closingSlash) {\n\t\t\t\t\t\t\t\telement.close = {\n\t\t\t\t\t\t\t\t\ttype: \"tag\",\n\t\t\t\t\t\t\t\t\tslash: closingSlash,\n\t\t\t\t\t\t\t\t\tvalue: tagName,\n\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t\tif (!stack.length) {\n\t\t\t\t\t\t\t\t\tif (end !== span.length) {\n\t\t\t\t\t\t\t\t\t\tthrow new SyntaxError(`Unmatched closing tag \"${tagName}\"`);\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t// ERROR EXPRESSION\n\t\t\t\t\t\t\t\t\texpressionTarget = {\n\t\t\t\t\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\t\t\t\t\tmessage: \"Unmatched closing tag ${}\",\n\t\t\t\t\t\t\t\t\t\tvalue: null,\n\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tif (end === span.length) {\n\t\t\t\t\t\t\t\t\t\t// TAG EXPRESSION\n\t\t\t\t\t\t\t\t\t\texpressionTarget = element.close;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\telement = stack.pop()!;\n\t\t\t\t\t\t\t\t\tmatcher = CLOSING_BRACKET_RE;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tconst next: ParseElement = {\n\t\t\t\t\t\t\t\t\ttype: \"element\",\n\t\t\t\t\t\t\t\t\topen: {\n\t\t\t\t\t\t\t\t\t\ttype: \"tag\",\n\t\t\t\t\t\t\t\t\t\tslash: \"\",\n\t\t\t\t\t\t\t\t\t\tvalue: tagName,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tclose: null,\n\t\t\t\t\t\t\t\t\tprops: [],\n\t\t\t\t\t\t\t\t\tchildren: [],\n\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t\telement.children.push(next);\n\t\t\t\t\t\t\t\tstack.push(element);\n\t\t\t\t\t\t\t\telement = next;\n\t\t\t\t\t\t\t\tmatcher = PROPS_RE;\n\t\t\t\t\t\t\t\tif (end === span.length) {\n\t\t\t\t\t\t\t\t\t// TAG EXPRESSION\n\t\t\t\t\t\t\t\t\texpressionTarget = element.open;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (i < span.length) {\n\t\t\t\t\t\t\tlet after = span.slice(i);\n\t\t\t\t\t\t\tif (!expressing) {\n\t\t\t\t\t\t\t\t// trim trailing whitespace\n\t\t\t\t\t\t\t\tafter = after.replace(/\\s*$/, \"\");\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (after) {\n\t\t\t\t\t\t\t\telement.children.push({type: \"value\", value: after});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase PROPS_RE: {\n\t\t\t\t\tif (match) {\n\t\t\t\t\t\tconst [, tagEnd, spread, name, equals, string] = match;\n\t\t\t\t\t\tif (i < match.index) {\n\t\t\t\t\t\t\tthrow new SyntaxError(\n\t\t\t\t\t\t\t\t`Unexpected text \\`${span.slice(i, match.index).trim()}\\``,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (tagEnd) {\n\t\t\t\t\t\t\tif (tagEnd[0] === \"/\") {\n\t\t\t\t\t\t\t\t// This is a self-closing element, so there will always be a\n\t\t\t\t\t\t\t\t// result on the stack.\n\t\t\t\t\t\t\t\telement = stack.pop()!;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tmatcher = CHILDREN_RE;\n\t\t\t\t\t\t} else if (spread) {\n\t\t\t\t\t\t\tconst value = {\n\t\t\t\t\t\t\t\ttype: \"value\" as const,\n\t\t\t\t\t\t\t\tvalue: null,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\telement.props.push(value);\n\t\t\t\t\t\t\t// SPREAD PROP EXPRESSION\n\t\t\t\t\t\t\texpressionTarget = value;\n\t\t\t\t\t\t\tif (!(expressing && end === span.length)) {\n\t\t\t\t\t\t\t\tthrow new SyntaxError('Expression expected after \"...\"');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (name) {\n\t\t\t\t\t\t\tlet value: ParseValue | ParsePropString;\n\t\t\t\t\t\t\tif (string == null) {\n\t\t\t\t\t\t\t\tif (!equals) {\n\t\t\t\t\t\t\t\t\tvalue = {type: \"value\", value: true};\n\t\t\t\t\t\t\t\t} else if (end < span.length) {\n\t\t\t\t\t\t\t\t\tthrow new SyntaxError(\n\t\t\t\t\t\t\t\t\t\t`Unexpected text \\`${span.slice(end, end + 20)}\\``,\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tvalue = {type: \"value\" as const, value: null};\n\t\t\t\t\t\t\t\t\t// PROP EXPRESSION\n\t\t\t\t\t\t\t\t\texpressionTarget = value;\n\t\t\t\t\t\t\t\t\tif (!(expressing && end === span.length)) {\n\t\t\t\t\t\t\t\t\t\tthrow new SyntaxError(\n\t\t\t\t\t\t\t\t\t\t\t`Expression expected for prop \"${name}\"`,\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tconst quote = string[0];\n\t\t\t\t\t\t\t\tvalue = {type: \"propString\", parts: []};\n\t\t\t\t\t\t\t\tvalue.parts.push(string);\n\t\t\t\t\t\t\t\tif (end === span.length) {\n\t\t\t\t\t\t\t\t\tmatcher =\n\t\t\t\t\t\t\t\t\t\tquote === \"'\"\n\t\t\t\t\t\t\t\t\t\t\t? CLOSING_SINGLE_QUOTE_RE\n\t\t\t\t\t\t\t\t\t\t\t: CLOSING_DOUBLE_QUOTE_RE;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tconst prop = {\n\t\t\t\t\t\t\t\ttype: \"prop\" as const,\n\t\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\telement.props.push(prop);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (!expressing) {\n\t\t\t\t\t\t\tif (i === span.length) {\n\t\t\t\t\t\t\t\tthrow new SyntaxError(\n\t\t\t\t\t\t\t\t\t`Expected props but reached end of document`,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthrow new SyntaxError(\n\t\t\t\t\t\t\t\t\t`Unexpected text \\`${span.slice(i, i + 20).trim()}\\``,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Unexpected expression errors are handled in the outer loop.\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// This would most likely be the starting point for the logic of\n\t\t\t\t\t\t// prop name expressions.\n\t\t\t\t\t\t// jsx`<p ${name}=${value}>`\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase CLOSING_BRACKET_RE: {\n\t\t\t\t\t// We're in a closing tag and looking for the >.\n\t\t\t\t\tif (match) {\n\t\t\t\t\t\tif (i < match.index) {\n\t\t\t\t\t\t\tthrow new SyntaxError(\n\t\t\t\t\t\t\t\t`Unexpected text \\`${span.slice(i, match.index).trim()}\\``,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmatcher = CHILDREN_RE;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (!expressing) {\n\t\t\t\t\t\t\tthrow new SyntaxError(\n\t\t\t\t\t\t\t\t`Unexpected text \\`${span.slice(i, i + 20).trim()}\\``,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase CLOSING_SINGLE_QUOTE_RE:\n\t\t\t\tcase CLOSING_DOUBLE_QUOTE_RE: {\n\t\t\t\t\tconst string = span.slice(i, end);\n\t\t\t\t\tconst prop = element.props[element.props.length - 1] as ParseProp;\n\t\t\t\t\tconst propString = prop.value as ParsePropString;\n\t\t\t\t\tpropString.parts.push(string);\n\t\t\t\t\tif (match) {\n\t\t\t\t\t\tmatcher = PROPS_RE;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (!expressing) {\n\t\t\t\t\t\t\tthrow new SyntaxError(\n\t\t\t\t\t\t\t\t`Missing \\`${\n\t\t\t\t\t\t\t\t\tmatcher === CLOSING_SINGLE_QUOTE_RE ? \"'\" : '\"'\n\t\t\t\t\t\t\t\t}\\``,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase CLOSING_COMMENT_RE: {\n\t\t\t\t\tif (match) {\n\t\t\t\t\t\tmatcher = CHILDREN_RE;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (!expressing) {\n\t\t\t\t\t\t\tthrow new SyntaxError(\n\t\t\t\t\t\t\t\t\"Expected `-->` but reached end of template\",\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (expressing) {\n\t\t\tif (expressionTarget) {\n\t\t\t\ttargets.push(expressionTarget);\n\t\t\t\tif (expressionTarget.type === \"error\") {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tswitch (matcher) {\n\t\t\t\tcase CHILDREN_RE: {\n\t\t\t\t\tconst target = {type: \"value\" as const, value: null};\n\t\t\t\t\telement.children.push(target);\n\t\t\t\t\ttargets.push(target);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase CLOSING_SINGLE_QUOTE_RE:\n\t\t\t\tcase CLOSING_DOUBLE_QUOTE_RE: {\n\t\t\t\t\tconst prop = element.props[element.props.length - 1] as ParseProp;\n\t\t\t\t\tconst target = {type: \"value\" as const, value: null};\n\t\t\t\t\t(prop.value as ParsePropString).parts.push(target);\n\t\t\t\t\ttargets.push(target);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase CLOSING_COMMENT_RE:\n\t\t\t\t\ttargets.push(null);\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new SyntaxError(\"Unexpected expression\");\n\t\t\t}\n\t\t} else if (expressionTarget) {\n\t\t\tthrow new SyntaxError(\"Expression expected\");\n\t\t}\n\n\t\tlineStart = false;\n\t}\n\n\tif (stack.length) {\n\t\tconst ti = targets.indexOf(element.open);\n\t\tif (ti === -1) {\n\t\t\tthrow new SyntaxError(`Unmatched opening tag \"${element.open.value}\"`);\n\t\t}\n\n\t\ttargets[ti] = {\n\t\t\ttype: \"error\",\n\t\t\tmessage: \"Unmatched opening tag ${}\",\n\t\t\tvalue: null,\n\t\t};\n\t}\n\n\tif (element.children.length === 1 && element.children[0].type === \"element\") {\n\t\telement = element.children[0];\n\t}\n\n\treturn {element, targets};\n}\n\nfunction build(parsed: ParseElement): Element {\n\tif (\n\t\tparsed.close !== null &&\n\t\tparsed.close.slash !== \"//\" &&\n\t\tparsed.open.value !== parsed.close.value\n\t) {\n\t\tthrow new SyntaxError(\n\t\t\t`Unmatched closing tag ${formatTagForError(\n\t\t\t\tparsed.close.value,\n\t\t\t)}, expected ${formatTagForError(parsed.open.value)}`,\n\t\t);\n\t}\n\n\tconst children: Array<unknown> = [];\n\tfor (let i = 0; i < parsed.children.length; i++) {\n\t\tconst child = parsed.children[i];\n\t\tchildren.push(child.type === \"element\" ? build(child) : child.value);\n\t}\n\n\tlet props = parsed.props.length ? ({} as Record<string, unknown>) : null;\n\tfor (let i = 0; i < parsed.props.length; i++) {\n\t\tconst prop = parsed.props[i];\n\t\tif (prop.type === \"prop\") {\n\t\t\tlet value: any;\n\t\t\tif (prop.value.type === \"value\") {\n\t\t\t\tvalue = prop.value.value;\n\t\t\t} else {\n\t\t\t\tlet string = \"\";\n\t\t\t\tfor (let i = 0; i < prop.value.parts.length; i++) {\n\t\t\t\t\tconst part = prop.value.parts[i];\n\t\t\t\t\tif (typeof part === \"string\") {\n\t\t\t\t\t\tstring += part;\n\t\t\t\t\t} else if (typeof part.value !== \"boolean\" && part.value != null) {\n\t\t\t\t\t\tstring +=\n\t\t\t\t\t\t\ttypeof part.value === \"string\" ? part.value : String(part.value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tvalue = string\n\t\t\t\t\t// remove quotes\n\t\t\t\t\t.slice(1, -1)\n\t\t\t\t\t// unescape things\n\t\t\t\t\t// adapted from https://stackoverflow.com/a/57330383/1825413\n\t\t\t\t\t.replace(\n\t\t\t\t\t\t/\\\\x[0-9a-f]{2}|\\\\u[0-9a-f]{4}|\\\\u\\{[0-9a-f]+\\}|\\\\./gi,\n\t\t\t\t\t\t(match) => {\n\t\t\t\t\t\t\tswitch (match[1]) {\n\t\t\t\t\t\t\t\tcase \"b\":\n\t\t\t\t\t\t\t\t\treturn \"\\b\";\n\t\t\t\t\t\t\t\tcase \"f\":\n\t\t\t\t\t\t\t\t\treturn \"\\f\";\n\t\t\t\t\t\t\t\tcase \"n\":\n\t\t\t\t\t\t\t\t\treturn \"\\n\";\n\t\t\t\t\t\t\t\tcase \"r\":\n\t\t\t\t\t\t\t\t\treturn \"\\r\";\n\t\t\t\t\t\t\t\tcase \"t\":\n\t\t\t\t\t\t\t\t\treturn \"\\t\";\n\t\t\t\t\t\t\t\tcase \"v\":\n\t\t\t\t\t\t\t\t\treturn \"\\v\";\n\t\t\t\t\t\t\t\tcase \"x\":\n\t\t\t\t\t\t\t\t\treturn String.fromCharCode(parseInt(match.slice(2), 16));\n\t\t\t\t\t\t\t\tcase \"u\":\n\t\t\t\t\t\t\t\t\tif (match[2] === \"{\") {\n\t\t\t\t\t\t\t\t\t\treturn String.fromCodePoint(\n\t\t\t\t\t\t\t\t\t\t\tparseInt(match.slice(3, -1), 16),\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\treturn String.fromCharCode(parseInt(match.slice(2), 16));\n\t\t\t\t\t\t\t\tcase \"0\":\n\t\t\t\t\t\t\t\t\treturn \"\\0\";\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\treturn match.slice(1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t);\n\t\t\t}\n\n\t\t\tprops![prop.name] = value;\n\t\t} else {\n\t\t\t// spread prop\n\t\t\tprops = {...props, ...(prop.value as any)};\n\t\t}\n\t}\n\n\treturn createElement(parsed.open.value, props, ...children);\n}\n\nfunction formatTagForError(tag: unknown): string {\n\treturn typeof tag === \"function\"\n\t\t? tag.name + \"()\"\n\t\t: typeof tag === \"string\"\n\t\t\t? `\"${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KAAa,EAAC;QAC3C;IACD;AAEA,IAAA,OAAOA,mBAAa,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,QAAQ,CAAC;AAC5D;AAEA,SAAS,iBAAiB,CAAC,GAAY,EAAA;IACtC,OAAO,OAAO,GAAG,KAAK;AACrB,UAAE,GAAG,CAAC,IAAI,GAAG;AACb,UAAE,OAAO,GAAG,KAAK;cACd,CAAA,CAAA,EAAI,GAAG,CAAA,CAAA;AACT,cAAE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC;AACxB;;;;;"}
|
|
1
|
+
{"version":3,"file":"jsx-tag.cjs","sources":["../src/jsx-tag.ts"],"sourcesContent":["import {createElement} from \"./crank.js\";\nimport type {Element} from \"./crank.js\";\n\nconst cache = new Map<string, ParseResult>();\nexport function jsx(\n\tspans: TemplateStringsArray,\n\t...expressions: Array<unknown>\n): Element {\n\tconst key = JSON.stringify(spans.raw);\n\tlet parseResult = cache.get(key);\n\tif (parseResult == null) {\n\t\tparseResult = parse(spans.raw);\n\t\tlet hasError = false;\n\t\tfor (let i = 0; i < parseResult.targets.length; i++) {\n\t\t\tconst t = parseResult.targets[i];\n\t\t\tif (t && t.type === \"error\") {\n\t\t\t\thasError = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (!hasError) {\n\t\t\tcache.set(key, parseResult);\n\t\t}\n\t}\n\n\tconst {element, targets} = parseResult;\n\tfor (let i = 0; i < expressions.length; i++) {\n\t\tconst exp = expressions[i];\n\t\tconst target = targets[i];\n\t\tif (target) {\n\t\t\tif (target.type === \"error\") {\n\t\t\t\tconst msg = target.message.replace(\"${}\", formatTagForError(exp));\n\t\t\t\tthrow new SyntaxError(\n\t\t\t\t\ttarget.spanIndex != null && target.charIndex != null\n\t\t\t\t\t\t? formatSyntaxError(\n\t\t\t\t\t\t\t\tmsg,\n\t\t\t\t\t\t\t\tspans.raw,\n\t\t\t\t\t\t\t\ttarget.spanIndex,\n\t\t\t\t\t\t\t\ttarget.charIndex,\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t: msg,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\ttarget.value = exp;\n\t\t}\n\t}\n\n\treturn build(element, parseResult.spans);\n}\n\n/** Alias for `jsx` template tag. */\nexport const html = jsx;\n\n// Type definitions for a bare-bones AST\nexport interface ParseElement {\n\ttype: \"element\";\n\topen: ParseTag;\n\tclose: ParseTag | null;\n\t// ParseValue is used to represent spread props.\n\tprops: Array<ParseProp | ParseValue>;\n\tchildren: Array<ParseElement | ParseValue>;\n}\n\nexport interface ParseValue {\n\ttype: \"value\";\n\tvalue: any;\n}\n\nexport interface ParseTag {\n\ttype: \"tag\";\n\tslash: string;\n\tvalue: any;\n\tspanIndex?: number;\n\tcharIndex?: number;\n}\n\nexport interface ParseProp {\n\ttype: \"prop\";\n\tname: string;\n\tvalue: ParseValue | ParsePropString;\n}\n\nexport interface ParsePropString {\n\ttype: \"propString\";\n\tparts: Array<string | ParseValue>;\n}\n\nexport interface ParseError {\n\ttype: \"error\";\n\tmessage: string;\n\tvalue: any;\n\tspanIndex?: number;\n\tcharIndex?: number;\n}\n\n// The parse result includes an array of targets, references to objects in the\n// parse tree whose `value` property is overwritten with expressions when the\n// template function is called. By separating the logic of parsing static\n// template spans from the handling of dynamic expressions, we can cache parse\n// results for successive calls.\nexport type ExpressionTarget = ParseValue | ParseTag | ParseProp | ParseError;\n\nexport interface ParseResult {\n\telement: ParseElement;\n\ttargets: Array<ExpressionTarget | null>;\n\tspans: ArrayLike<string>;\n}\n\n/**\n * Matches first significant character in children mode.\n *\n * Group 1: newline\n * Group 2: comment\n * Group 3: tag\n * Group 4: closing slash\n * Group 5: tag name\n *\n * The comment group must appear first because the tag group can potentially\n * match a comment, so that we can handle tag expressions where we've reached\n * the end of a span.\n */\nconst CHILDREN_RE =\n\t/((?:\\r|\\n|\\r\\n)\\s*)|(<!--[\\S\\s]*?(?:-->|$))|(<\\s*(\\/{0,2})\\s*([-_$\\w]*))/g;\n\n/**\n * Matches props after element tags.\n *\n * Group 1: tag end\n * Group 2: spread props\n * Group 3: prop name\n * Group 4: equals\n * Group 5: prop value string\n */\nconst PROPS_RE =\n\t/\\s*(?:(\\/?\\s*>)|(\\.\\.\\.\\s*)|(?:([-_$\\w]+)\\s*(=)?\\s*(?:(\"(\\\\\"|[\\S\\s])*?(?:\"|$)|'(?:\\\\'|[\\S\\s])*?(?:'|$)))?))/g;\n\nconst CLOSING_BRACKET_RE = />/g;\n\nconst CLOSING_SINGLE_QUOTE_RE = /[^\\\\]?'/g;\n\nconst CLOSING_DOUBLE_QUOTE_RE = /[^\\\\]?\"/g;\n\nconst CLOSING_COMMENT_RE = /-->/g;\n\nexport function parse(spans: ArrayLike<string>): ParseResult {\n\tlet matcher = CHILDREN_RE;\n\tconst stack: Array<ParseElement> = [];\n\tlet element: ParseElement = {\n\t\ttype: \"element\",\n\t\topen: {type: \"tag\", slash: \"\", value: \"\"},\n\t\tclose: null,\n\t\tprops: [],\n\t\tchildren: [],\n\t};\n\n\tconst targets: Array<ExpressionTarget | null> = [];\n\tlet lineStart = true;\n\tfor (let s = 0; s < spans.length; s++) {\n\t\tconst span = spans[s];\n\t\t// Whether or not an expression is upcoming. Used to provide better errors.\n\t\tconst expressing = s < spans.length - 1;\n\t\tlet expressionTarget: ExpressionTarget | null = null;\n\t\tfor (let i = 0, end = i; i < span.length; i = end) {\n\t\t\tmatcher.lastIndex = i;\n\t\t\tconst match = matcher.exec(span);\n\t\t\tend = match ? match.index + match[0].length : span.length;\n\t\t\tswitch (matcher) {\n\t\t\t\tcase CHILDREN_RE: {\n\t\t\t\t\tif (match) {\n\t\t\t\t\t\tconst [, newline, comment, tag, closingSlash, tagName] = match;\n\t\t\t\t\t\tif (i < match.index) {\n\t\t\t\t\t\t\tlet before = span.slice(i, match.index);\n\t\t\t\t\t\t\tif (lineStart) {\n\t\t\t\t\t\t\t\tbefore = before.replace(/^\\s*/, \"\");\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (newline) {\n\t\t\t\t\t\t\t\tif (span[Math.max(0, match.index - 1)] === \"\\\\\") {\n\t\t\t\t\t\t\t\t\t// We preserve whitespace before escaped newlines and have to\n\t\t\t\t\t\t\t\t\t// remove the backslash.\n\t\t\t\t\t\t\t\t\t// jsx` \\\n\t\t\t\t\t\t\t\t\t// `\n\t\t\t\t\t\t\t\t\tbefore = before.slice(0, -1);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tbefore = before.replace(/\\s*$/, \"\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (before) {\n\t\t\t\t\t\t\t\telement.children.push({type: \"value\", value: before});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlineStart = !!newline;\n\t\t\t\t\t\tif (comment) {\n\t\t\t\t\t\t\tif (end === span.length) {\n\t\t\t\t\t\t\t\t// Expression in a comment:\n\t\t\t\t\t\t\t\t// jsx`<!-- ${exp} -->`\n\t\t\t\t\t\t\t\tmatcher = CLOSING_COMMENT_RE;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (tag) {\n\t\t\t\t\t\t\tif (closingSlash) {\n\t\t\t\t\t\t\t\telement.close = {\n\t\t\t\t\t\t\t\t\ttype: \"tag\",\n\t\t\t\t\t\t\t\t\tslash: closingSlash,\n\t\t\t\t\t\t\t\t\tvalue: tagName,\n\t\t\t\t\t\t\t\t\tspanIndex: s,\n\t\t\t\t\t\t\t\t\tcharIndex: match.index,\n\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t\tif (!stack.length) {\n\t\t\t\t\t\t\t\t\tif (end !== span.length) {\n\t\t\t\t\t\t\t\t\t\tthrow new SyntaxError(\n\t\t\t\t\t\t\t\t\t\t\tformatSyntaxError(\n\t\t\t\t\t\t\t\t\t\t\t\t`Unmatched closing tag \"${tagName}\"`,\n\t\t\t\t\t\t\t\t\t\t\t\tspans,\n\t\t\t\t\t\t\t\t\t\t\t\ts,\n\t\t\t\t\t\t\t\t\t\t\t\tmatch.index,\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t// ERROR EXPRESSION\n\t\t\t\t\t\t\t\t\texpressionTarget = {\n\t\t\t\t\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\t\t\t\t\tmessage: \"Unmatched closing tag ${}\",\n\t\t\t\t\t\t\t\t\t\tvalue: null,\n\t\t\t\t\t\t\t\t\t\tspanIndex: s,\n\t\t\t\t\t\t\t\t\t\tcharIndex: match.index,\n\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tif (end === span.length) {\n\t\t\t\t\t\t\t\t\t\t// TAG EXPRESSION\n\t\t\t\t\t\t\t\t\t\texpressionTarget = element.close;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\telement = stack.pop()!;\n\t\t\t\t\t\t\t\t\tmatcher = CLOSING_BRACKET_RE;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tconst next: ParseElement = {\n\t\t\t\t\t\t\t\t\ttype: \"element\",\n\t\t\t\t\t\t\t\t\topen: {\n\t\t\t\t\t\t\t\t\t\ttype: \"tag\",\n\t\t\t\t\t\t\t\t\t\tslash: \"\",\n\t\t\t\t\t\t\t\t\t\tvalue: tagName,\n\t\t\t\t\t\t\t\t\t\tspanIndex: s,\n\t\t\t\t\t\t\t\t\t\tcharIndex: match.index,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tclose: null,\n\t\t\t\t\t\t\t\t\tprops: [],\n\t\t\t\t\t\t\t\t\tchildren: [],\n\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t\telement.children.push(next);\n\t\t\t\t\t\t\t\tstack.push(element);\n\t\t\t\t\t\t\t\telement = next;\n\t\t\t\t\t\t\t\tmatcher = PROPS_RE;\n\t\t\t\t\t\t\t\tif (end === span.length) {\n\t\t\t\t\t\t\t\t\t// TAG EXPRESSION\n\t\t\t\t\t\t\t\t\texpressionTarget = element.open;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (i < span.length) {\n\t\t\t\t\t\t\tlet after = span.slice(i);\n\t\t\t\t\t\t\tif (!expressing) {\n\t\t\t\t\t\t\t\t// trim trailing whitespace\n\t\t\t\t\t\t\t\tafter = after.replace(/\\s*$/, \"\");\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (after) {\n\t\t\t\t\t\t\t\telement.children.push({type: \"value\", value: after});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase PROPS_RE: {\n\t\t\t\t\tif (match) {\n\t\t\t\t\t\tconst [, tagEnd, spread, name, equals, string] = match;\n\t\t\t\t\t\tif (i < match.index) {\n\t\t\t\t\t\t\tthrow new SyntaxError(\n\t\t\t\t\t\t\t\tformatSyntaxError(\n\t\t\t\t\t\t\t\t\t`Unexpected text \\`${span.slice(i, match.index).trim()}\\``,\n\t\t\t\t\t\t\t\t\tspans,\n\t\t\t\t\t\t\t\t\ts,\n\t\t\t\t\t\t\t\t\ti,\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (tagEnd) {\n\t\t\t\t\t\t\tif (tagEnd[0] === \"/\") {\n\t\t\t\t\t\t\t\t// This is a self-closing element, so there will always be a\n\t\t\t\t\t\t\t\t// result on the stack.\n\t\t\t\t\t\t\t\telement = stack.pop()!;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tmatcher = CHILDREN_RE;\n\t\t\t\t\t\t} else if (spread) {\n\t\t\t\t\t\t\tconst value = {\n\t\t\t\t\t\t\t\ttype: \"value\" as const,\n\t\t\t\t\t\t\t\tvalue: null,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\telement.props.push(value);\n\t\t\t\t\t\t\t// SPREAD PROP EXPRESSION\n\t\t\t\t\t\t\texpressionTarget = value;\n\t\t\t\t\t\t\tif (!(expressing && end === span.length)) {\n\t\t\t\t\t\t\t\tthrow new SyntaxError(\n\t\t\t\t\t\t\t\t\tformatSyntaxError(\n\t\t\t\t\t\t\t\t\t\t'Expression expected after \"...\"',\n\t\t\t\t\t\t\t\t\t\tspans,\n\t\t\t\t\t\t\t\t\t\ts,\n\t\t\t\t\t\t\t\t\t\tmatch.index,\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (name) {\n\t\t\t\t\t\t\tlet value: ParseValue | ParsePropString;\n\t\t\t\t\t\t\tif (string == null) {\n\t\t\t\t\t\t\t\tif (!equals) {\n\t\t\t\t\t\t\t\t\tvalue = {type: \"value\", value: true};\n\t\t\t\t\t\t\t\t} else if (end < span.length) {\n\t\t\t\t\t\t\t\t\tthrow new SyntaxError(\n\t\t\t\t\t\t\t\t\t\tformatSyntaxError(\n\t\t\t\t\t\t\t\t\t\t\t`Unexpected text \\`${span.slice(end, end + 20)}\\``,\n\t\t\t\t\t\t\t\t\t\t\tspans,\n\t\t\t\t\t\t\t\t\t\t\ts,\n\t\t\t\t\t\t\t\t\t\t\tend,\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tvalue = {type: \"value\" as const, value: null};\n\t\t\t\t\t\t\t\t\t// PROP EXPRESSION\n\t\t\t\t\t\t\t\t\texpressionTarget = value;\n\t\t\t\t\t\t\t\t\tif (!(expressing && end === span.length)) {\n\t\t\t\t\t\t\t\t\t\tthrow new SyntaxError(\n\t\t\t\t\t\t\t\t\t\t\tformatSyntaxError(\n\t\t\t\t\t\t\t\t\t\t\t\t`Expression expected for prop \"${name}\"`,\n\t\t\t\t\t\t\t\t\t\t\t\tspans,\n\t\t\t\t\t\t\t\t\t\t\t\ts,\n\t\t\t\t\t\t\t\t\t\t\t\tmatch.index,\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tconst quote = string[0];\n\t\t\t\t\t\t\t\tvalue = {type: \"propString\", parts: []};\n\t\t\t\t\t\t\t\tvalue.parts.push(string);\n\t\t\t\t\t\t\t\tif (end === span.length) {\n\t\t\t\t\t\t\t\t\tmatcher =\n\t\t\t\t\t\t\t\t\t\tquote === \"'\"\n\t\t\t\t\t\t\t\t\t\t\t? CLOSING_SINGLE_QUOTE_RE\n\t\t\t\t\t\t\t\t\t\t\t: CLOSING_DOUBLE_QUOTE_RE;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tconst prop = {\n\t\t\t\t\t\t\t\ttype: \"prop\" as const,\n\t\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\telement.props.push(prop);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (!expressing) {\n\t\t\t\t\t\t\tif (i === span.length) {\n\t\t\t\t\t\t\t\tthrow new SyntaxError(\n\t\t\t\t\t\t\t\t\tformatSyntaxError(\n\t\t\t\t\t\t\t\t\t\t`Expected props but reached end of document`,\n\t\t\t\t\t\t\t\t\t\tspans,\n\t\t\t\t\t\t\t\t\t\ts,\n\t\t\t\t\t\t\t\t\t\ti,\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthrow new SyntaxError(\n\t\t\t\t\t\t\t\t\tformatSyntaxError(\n\t\t\t\t\t\t\t\t\t\t`Unexpected text \\`${span.slice(i, i + 20).trim()}\\``,\n\t\t\t\t\t\t\t\t\t\tspans,\n\t\t\t\t\t\t\t\t\t\ts,\n\t\t\t\t\t\t\t\t\t\ti,\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Unexpected expression errors are handled in the outer loop.\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// This would most likely be the starting point for the logic of\n\t\t\t\t\t\t// prop name expressions.\n\t\t\t\t\t\t// jsx`<p ${name}=${value}>`\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase CLOSING_BRACKET_RE: {\n\t\t\t\t\t// We're in a closing tag and looking for the >.\n\t\t\t\t\tif (match) {\n\t\t\t\t\t\tif (i < match.index) {\n\t\t\t\t\t\t\tthrow new SyntaxError(\n\t\t\t\t\t\t\t\tformatSyntaxError(\n\t\t\t\t\t\t\t\t\t`Unexpected text \\`${span.slice(i, match.index).trim()}\\``,\n\t\t\t\t\t\t\t\t\tspans,\n\t\t\t\t\t\t\t\t\ts,\n\t\t\t\t\t\t\t\t\ti,\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmatcher = CHILDREN_RE;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (!expressing) {\n\t\t\t\t\t\t\tthrow new SyntaxError(\n\t\t\t\t\t\t\t\tformatSyntaxError(\n\t\t\t\t\t\t\t\t\t`Unexpected text \\`${span.slice(i, i + 20).trim()}\\``,\n\t\t\t\t\t\t\t\t\tspans,\n\t\t\t\t\t\t\t\t\ts,\n\t\t\t\t\t\t\t\t\ti,\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase CLOSING_SINGLE_QUOTE_RE:\n\t\t\t\tcase CLOSING_DOUBLE_QUOTE_RE: {\n\t\t\t\t\tconst string = span.slice(i, end);\n\t\t\t\t\tconst prop = element.props[element.props.length - 1] as ParseProp;\n\t\t\t\t\tconst propString = prop.value as ParsePropString;\n\t\t\t\t\tpropString.parts.push(string);\n\t\t\t\t\tif (match) {\n\t\t\t\t\t\tmatcher = PROPS_RE;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (!expressing) {\n\t\t\t\t\t\t\tthrow new SyntaxError(\n\t\t\t\t\t\t\t\tformatSyntaxError(\n\t\t\t\t\t\t\t\t\t`Missing \\`${\n\t\t\t\t\t\t\t\t\t\tmatcher === CLOSING_SINGLE_QUOTE_RE ? \"'\" : '\"'\n\t\t\t\t\t\t\t\t\t}\\``,\n\t\t\t\t\t\t\t\t\tspans,\n\t\t\t\t\t\t\t\t\ts,\n\t\t\t\t\t\t\t\t\ti,\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase CLOSING_COMMENT_RE: {\n\t\t\t\t\tif (match) {\n\t\t\t\t\t\tmatcher = CHILDREN_RE;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (!expressing) {\n\t\t\t\t\t\t\tthrow new SyntaxError(\n\t\t\t\t\t\t\t\tformatSyntaxError(\n\t\t\t\t\t\t\t\t\t\"Expected `-->` but reached end of template\",\n\t\t\t\t\t\t\t\t\tspans,\n\t\t\t\t\t\t\t\t\ts,\n\t\t\t\t\t\t\t\t\ti,\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (expressing) {\n\t\t\tif (expressionTarget) {\n\t\t\t\ttargets.push(expressionTarget);\n\t\t\t\tif (expressionTarget.type === \"error\") {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tswitch (matcher) {\n\t\t\t\tcase CHILDREN_RE: {\n\t\t\t\t\tconst target = {type: \"value\" as const, value: null};\n\t\t\t\t\telement.children.push(target);\n\t\t\t\t\ttargets.push(target);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase CLOSING_SINGLE_QUOTE_RE:\n\t\t\t\tcase CLOSING_DOUBLE_QUOTE_RE: {\n\t\t\t\t\tconst prop = element.props[element.props.length - 1] as ParseProp;\n\t\t\t\t\tconst target = {type: \"value\" as const, value: null};\n\t\t\t\t\t(prop.value as ParsePropString).parts.push(target);\n\t\t\t\t\ttargets.push(target);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase CLOSING_COMMENT_RE:\n\t\t\t\t\ttargets.push(null);\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new SyntaxError(\n\t\t\t\t\t\tformatSyntaxError(\n\t\t\t\t\t\t\t\"Unexpected expression\",\n\t\t\t\t\t\t\tspans,\n\t\t\t\t\t\t\ts,\n\t\t\t\t\t\t\tspans[s].length,\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\t\t\t}\n\t\t} else if (expressionTarget) {\n\t\t\tthrow new SyntaxError(\n\t\t\t\tformatSyntaxError(\"Expression expected\", spans, s, spans[s].length),\n\t\t\t);\n\t\t}\n\n\t\tlineStart = false;\n\t}\n\n\tif (stack.length) {\n\t\tconst ti = targets.indexOf(element.open);\n\t\tif (ti === -1) {\n\t\t\tthrow new SyntaxError(\n\t\t\t\tformatSyntaxError(\n\t\t\t\t\t`Unmatched opening tag \"${element.open.value}\"`,\n\t\t\t\t\tspans,\n\t\t\t\t\telement.open.spanIndex ?? 0,\n\t\t\t\t\telement.open.charIndex ?? 0,\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\n\t\ttargets[ti] = {\n\t\t\ttype: \"error\",\n\t\t\tmessage: \"Unmatched opening tag ${}\",\n\t\t\tvalue: null,\n\t\t\tspanIndex: element.open.spanIndex,\n\t\t\tcharIndex: element.open.charIndex,\n\t\t};\n\t}\n\n\tif (element.children.length === 1 && element.children[0].type === \"element\") {\n\t\telement = element.children[0];\n\t}\n\n\treturn {element, targets, spans};\n}\n\nfunction build(parsed: ParseElement, spans?: ArrayLike<string>): Element {\n\tif (\n\t\tparsed.close !== null &&\n\t\tparsed.close.slash !== \"//\" &&\n\t\tparsed.open.value !== parsed.close.value\n\t) {\n\t\tconst msg = `Unmatched closing tag ${formatTagForError(\n\t\t\tparsed.close.value,\n\t\t)}, expected ${formatTagForError(parsed.open.value)}`;\n\t\tthrow new SyntaxError(\n\t\t\tspans && parsed.close.spanIndex != null && parsed.close.charIndex != null\n\t\t\t\t? formatSyntaxError(\n\t\t\t\t\t\tmsg,\n\t\t\t\t\t\tspans,\n\t\t\t\t\t\tparsed.close.spanIndex,\n\t\t\t\t\t\tparsed.close.charIndex,\n\t\t\t\t\t)\n\t\t\t\t: msg,\n\t\t);\n\t}\n\n\tconst children: Array<unknown> = [];\n\tfor (let i = 0; i < parsed.children.length; i++) {\n\t\tconst child = parsed.children[i];\n\t\tchildren.push(child.type === \"element\" ? build(child, spans) : child.value);\n\t}\n\n\tlet props = parsed.props.length ? ({} as Record<string, unknown>) : null;\n\tfor (let i = 0; i < parsed.props.length; i++) {\n\t\tconst prop = parsed.props[i];\n\t\tif (prop.type === \"prop\") {\n\t\t\tlet value: any;\n\t\t\tif (prop.value.type === \"value\") {\n\t\t\t\tvalue = prop.value.value;\n\t\t\t} else {\n\t\t\t\tlet string = \"\";\n\t\t\t\tfor (let i = 0; i < prop.value.parts.length; i++) {\n\t\t\t\t\tconst part = prop.value.parts[i];\n\t\t\t\t\tif (typeof part === \"string\") {\n\t\t\t\t\t\tstring += part;\n\t\t\t\t\t} else if (typeof part.value !== \"boolean\" && part.value != null) {\n\t\t\t\t\t\tstring +=\n\t\t\t\t\t\t\ttypeof part.value === \"string\" ? part.value : String(part.value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tvalue = string\n\t\t\t\t\t// remove quotes\n\t\t\t\t\t.slice(1, -1)\n\t\t\t\t\t// unescape things\n\t\t\t\t\t// adapted from https://stackoverflow.com/a/57330383/1825413\n\t\t\t\t\t.replace(\n\t\t\t\t\t\t/\\\\x[0-9a-f]{2}|\\\\u[0-9a-f]{4}|\\\\u\\{[0-9a-f]+\\}|\\\\./gi,\n\t\t\t\t\t\t(match) => {\n\t\t\t\t\t\t\tswitch (match[1]) {\n\t\t\t\t\t\t\t\tcase \"b\":\n\t\t\t\t\t\t\t\t\treturn \"\\b\";\n\t\t\t\t\t\t\t\tcase \"f\":\n\t\t\t\t\t\t\t\t\treturn \"\\f\";\n\t\t\t\t\t\t\t\tcase \"n\":\n\t\t\t\t\t\t\t\t\treturn \"\\n\";\n\t\t\t\t\t\t\t\tcase \"r\":\n\t\t\t\t\t\t\t\t\treturn \"\\r\";\n\t\t\t\t\t\t\t\tcase \"t\":\n\t\t\t\t\t\t\t\t\treturn \"\\t\";\n\t\t\t\t\t\t\t\tcase \"v\":\n\t\t\t\t\t\t\t\t\treturn \"\\v\";\n\t\t\t\t\t\t\t\tcase \"x\":\n\t\t\t\t\t\t\t\t\treturn String.fromCharCode(parseInt(match.slice(2), 16));\n\t\t\t\t\t\t\t\tcase \"u\":\n\t\t\t\t\t\t\t\t\tif (match[2] === \"{\") {\n\t\t\t\t\t\t\t\t\t\treturn String.fromCodePoint(\n\t\t\t\t\t\t\t\t\t\t\tparseInt(match.slice(3, -1), 16),\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\treturn String.fromCharCode(parseInt(match.slice(2), 16));\n\t\t\t\t\t\t\t\tcase \"0\":\n\t\t\t\t\t\t\t\t\treturn \"\\0\";\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\treturn match.slice(1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t);\n\t\t\t}\n\n\t\t\tprops![prop.name] = value;\n\t\t} else {\n\t\t\t// spread prop\n\t\t\tprops = {...props, ...(prop.value as any)};\n\t\t}\n\t}\n\n\treturn createElement(parsed.open.value, props, ...children);\n}\n\nfunction formatTagForError(tag: unknown): string {\n\treturn typeof tag === \"function\"\n\t\t? tag.name + \"()\"\n\t\t: typeof tag === \"string\"\n\t\t\t? `\"${tag}\"`\n\t\t\t: JSON.stringify(tag);\n}\n\nfunction formatSyntaxError(\n\tmessage: string,\n\tspans: ArrayLike<string>,\n\tspanIndex: number,\n\tcharIndex: number,\n): string {\n\t// Reconstruct full template source with ${} placeholders\n\tlet source = spans[0];\n\tfor (let i = 1; i < spans.length; i++) {\n\t\tsource += \"${}\" + spans[i];\n\t}\n\n\t// Compute absolute offset\n\tlet offset = 0;\n\tfor (let i = 0; i < spanIndex; i++) {\n\t\toffset += spans[i].length + 3; // 3 = \"${}\".length\n\t}\n\toffset += charIndex;\n\n\t// Split into lines and find line/column\n\tconst lines = source.split(/\\n/);\n\tlet line = 0;\n\tlet col = offset;\n\tfor (let i = 0; i < lines.length; i++) {\n\t\tif (col <= lines[i].length) {\n\t\t\tline = i;\n\t\t\tbreak;\n\t\t}\n\t\tcol -= lines[i].length + 1; // +1 for the newline\n\t}\n\n\t// Build context lines\n\tlet result = `${message}\\n\\n`;\n\tconst start = Math.max(0, line - 1);\n\tconst end = Math.min(lines.length - 1, line + 1);\n\tconst gutterWidth = String(end + 1).length;\n\tfor (let i = start; i <= end; i++) {\n\t\tconst num = String(i + 1).padStart(gutterWidth);\n\t\tif (i === line) {\n\t\t\tresult += `> ${num} | ${lines[i]}\\n`;\n\t\t\tresult += ` ${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