@monimesl/dot-dml-parser 1.0.0-beta.2 → 1.0.0-beta.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/dist/index.js CHANGED
@@ -70,16 +70,16 @@ function parseDmlToIR(source, options = {}) {
70
70
  },
71
71
  onclosetag(name, isImplied) {
72
72
  flushText();
73
- if (unfinishedTag) throw errorAt(`<${unfinishedTag.name}> isn't finished: add \`>\` or \`/>\``, unfinishedTag.start);
73
+ if (unfinishedTag) throw errorAt(`<${unfinishedTag.name}> isn't finished. Add \`>\` or \`/>\``, unfinishedTag.start);
74
74
  const openTag = openTags.pop();
75
75
  const openTagName = openTag.node.tag;
76
76
  const selfClosing = parser.startIndex === openTag.start;
77
77
  if (isImplied && !selfClosing) {
78
- let found = "end of input";
78
+ let found = "the end of the file";
79
79
  if (parser.startIndex < source.length) found = `\`${source.slice(parser.startIndex, parser.endIndex + 1)}\``;
80
- throw errorAt(`<${openTagName}> isn't closed: expected </${openTagName}>, found ${found}`, openTag.start);
80
+ throw errorAt(`<${openTagName}> isn't closed. Add </${openTagName}> before ${found}`, openTag.start);
81
81
  }
82
- if (name !== openTagName) throw errorAt(`</${name}> doesn't match <${openTagName}>: expected </${openTagName}>`, parser.startIndex);
82
+ if (name !== openTagName) throw errorAt(`</${name}> doesn't match <${openTagName}>. Close it with </${openTagName}>`, parser.startIndex);
83
83
  if (!selfClosing) matchedClosingTagOffsets.add(parser.startIndex);
84
84
  },
85
85
  ontext(data) {
@@ -104,7 +104,7 @@ function parseDmlToIR(source, options = {}) {
104
104
  parser.end();
105
105
  flushText();
106
106
  const markupOnly = source.replace(OPAQUE_REGION, (region) => " ".repeat(region.length));
107
- for (const closingTag of markupOnly.matchAll(CLOSING_TAG)) if (!matchedClosingTagOffsets.has(closingTag.index)) throw errorAt(`</${closingTag[1]}> has no matching opening tag`, closingTag.index);
107
+ for (const closingTag of markupOnly.matchAll(CLOSING_TAG)) if (!matchedClosingTagOffsets.has(closingTag.index)) throw errorAt(`</${closingTag[1]}> has no matching opening tag. Remove it, or add the opening tag`, closingTag.index);
108
108
  return roots;
109
109
  }
110
110
  function splitEvents(rawAttributes) {
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/errors.ts","../src/parse.ts","../src/ast.ts"],"sourcesContent":["import { SourceError } from '@monimesl/dot-core';\n\nexport class DmlParseError extends SourceError {\n override readonly name = 'DmlParseError';\n}\n","import { Parser } from 'htmlparser2';\nimport { createLocator, isEventProp } from '@monimesl/dot-core';\n\nimport { DmlParseError } from './errors';\nimport type { DmlElementNode, DmlNode } from './ast';\n\nexport interface ParseDmlOptions {\n file?: string;\n locations?: boolean;\n whitespace?: 'trim' | 'collapse' | 'inline' | 'preserve';\n}\n\ntype WhitespaceMode = NonNullable<ParseDmlOptions['whitespace']>;\n\nconst CLOSING_TAG = /<\\/([^\\s>]+)\\s*>/g;\nconst OPAQUE_REGION = /<!--[\\s\\S]*?-->|<!\\[CDATA\\[[\\s\\S]*?]]>/g;\n\ninterface OpenTag {\n node: DmlElementNode;\n start: number;\n}\n\n// Parses .dml markup into a tree, leaving `{{ }}` bindings as raw strings.\nfunction parseDmlToIR(source: string, options: ParseDmlOptions = {}): DmlNode[] {\n const { file, locations = false, whitespace = 'trim' } = options;\n const roots: DmlNode[] = [];\n const openTags: OpenTag[] = [];\n let textBuffer = '';\n let textStart = -1;\n const matchedClosingTagOffsets = new Set<number>();\n const locate = createLocator(source);\n const errorAt = (message: string, offset: number) => {\n return new DmlParseError(message, file, locate(offset));\n };\n // Without `locations`, nodes have no `loc` key at all.\n const withLocation = <Node extends DmlNode>(node: Node, offset: number): Node => {\n if (!locations) {\n return node;\n }\n return { ...node, loc: locate(offset) };\n };\n const currentChildren = (): DmlNode[] => {\n return openTags.at(-1)?.node.children ?? roots;\n };\n const flushText = (): void => {\n if (textStart < 0) {\n return;\n }\n const content = normalizeText(textBuffer, whitespace);\n if (content.length > 0) {\n // Point at the first character kept, past any whitespace trimmed off the front.\n let contentStart = textStart;\n if (whitespace !== 'preserve') {\n contentStart += leadingWhitespaceLength(textBuffer);\n }\n currentChildren().push(withLocation({ type: 'Text', content }, contentStart));\n }\n textBuffer = '';\n textStart = -1;\n };\n // A tag whose name has been read but not its closing `>`.\n let unfinishedTag: { name: string; start: number } | undefined;\n const parser = new Parser(\n {\n onopentagname(name) {\n unfinishedTag = { name, start: parser.startIndex };\n },\n onopentag(name, rawAttributes) {\n unfinishedTag = undefined;\n flushText();\n const { attributes, events } = splitEvents(rawAttributes);\n const node = withLocation<DmlElementNode>(\n { type: 'Element', tag: name, attributes, events, children: [] },\n parser.startIndex,\n );\n currentChildren().push(node);\n openTags.push({ node, start: parser.startIndex });\n },\n onclosetag(name, isImplied) {\n flushText();\n if (unfinishedTag) {\n throw errorAt(\n `<${unfinishedTag.name}> isn't finished: add \\`>\\` or \\`/>\\``,\n unfinishedTag.start,\n );\n }\n // htmlparser2 only reports closing tags it has seen open.\n const openTag = openTags.pop()!;\n const openTagName = openTag.node.tag;\n const selfClosing = parser.startIndex === openTag.start;\n if (isImplied && !selfClosing) {\n let found = 'end of input';\n if (parser.startIndex < source.length) {\n found = `\\`${source.slice(parser.startIndex, parser.endIndex + 1)}\\``;\n }\n throw errorAt(\n `<${openTagName}> isn't closed: expected </${openTagName}>, found ${found}`,\n openTag.start,\n );\n }\n if (name !== openTagName) {\n throw errorAt(\n `</${name}> doesn't match <${openTagName}>: expected </${openTagName}>`,\n parser.startIndex,\n );\n }\n if (!selfClosing) {\n matchedClosingTagOffsets.add(parser.startIndex);\n }\n },\n ontext(data) {\n // htmlparser2 splits text around entities; buffer until the next tag.\n if (textStart < 0) {\n textStart = parser.startIndex;\n }\n textBuffer += data;\n },\n oncomment() {\n flushText();\n },\n onprocessinginstruction() {\n flushText();\n },\n onerror(error) {\n throw errorAt(error.message, parser.startIndex);\n },\n },\n {\n xmlMode: true,\n decodeEntities: true,\n recognizeCDATA: true,\n },\n );\n\n parser.write(source);\n parser.end();\n flushText();\n\n // htmlparser2 ignores unmatched closing tags instead of throwing, so we catch them here.\n // Comments and CDATA are blanked with spaces, not removed, so offsets still match the source.\n const markupOnly = source.replace(OPAQUE_REGION, (region) => ' '.repeat(region.length));\n for (const closingTag of markupOnly.matchAll(CLOSING_TAG)) {\n if (!matchedClosingTagOffsets.has(closingTag.index)) {\n throw errorAt(`</${closingTag[1]!}> has no matching opening tag`, closingTag.index);\n }\n }\n return roots;\n}\n\nexport default parseDmlToIR;\n\nfunction splitEvents(rawAttributes: Record<string, string>): {\n attributes: Record<string, string>;\n events: Record<string, string>;\n} {\n const attributes: Record<string, string> = {};\n const events: Record<string, string> = {};\n for (const [name, value] of Object.entries(rawAttributes)) {\n if (isEventProp(name)) {\n events[name] = value;\n } else {\n attributes[name] = value;\n }\n }\n return { attributes, events };\n}\n\nfunction normalizeText(raw: string, mode: WhitespaceMode): string {\n switch (mode) {\n case 'preserve':\n if (raw.trim() === '') {\n return '';\n }\n return raw;\n case 'collapse':\n return raw.replace(/\\s+/g, ' ').trim();\n case 'inline':\n return inlineText(raw);\n case 'trim':\n return raw.trim();\n }\n}\n\n// As text flows around inline elements: whitespace with a line break in it only lays out the markup,\n// so it goes, but a space on the same line as an element stays, as in `paid <Text>SLE 50</Text> today`.\nfunction inlineText(raw: string): string {\n if (raw.trim() === '') {\n if (raw.includes('\\n')) {\n return '';\n }\n return ' ';\n }\n return raw\n .replace(/^\\s*\\n\\s*/, '')\n .replace(/\\s*\\n\\s*$/, '')\n .replace(/\\s+/g, ' ');\n}\n\nfunction leadingWhitespaceLength(text: string): number {\n return text.length - text.trimStart().length;\n}\n","import type { SourceLocation } from '@monimesl/dot-core';\n\nexport interface DmlElementNode {\n readonly type: 'Element';\n readonly tag: string;\n readonly events: Record<string, string>;\n readonly attributes: Record<string, string>;\n readonly children: DmlNode[];\n readonly loc?: SourceLocation;\n}\n\nexport interface DmlTextNode {\n readonly type: 'Text';\n readonly content: string;\n readonly loc?: SourceLocation;\n}\n\nexport type DmlNode = DmlElementNode | DmlTextNode;\n\nexport function isElementNode(node: DmlNode): node is DmlElementNode {\n return node.type === 'Element';\n}\n"],"mappings":";;;AAEA,IAAa,gBAAb,cAAmC,YAAY;CAC7C,OAAyB;AAC3B;;;ACUA,MAAM,cAAc;AACpB,MAAM,gBAAgB;AAQtB,SAAS,aAAa,QAAgB,UAA2B,CAAC,GAAc;CAC9E,MAAM,EAAE,MAAM,YAAY,OAAO,aAAa,WAAW;CACzD,MAAM,QAAmB,CAAC;CAC1B,MAAM,WAAsB,CAAC;CAC7B,IAAI,aAAa;CACjB,IAAI,YAAY;CAChB,MAAM,2CAA2B,IAAI,IAAY;CACjD,MAAM,SAAS,cAAc,MAAM;CACnC,MAAM,WAAW,SAAiB,WAAmB;EACnD,OAAO,IAAI,cAAc,SAAS,MAAM,OAAO,MAAM,CAAC;CACxD;CAEA,MAAM,gBAAsC,MAAY,WAAyB;EAC/E,IAAI,CAAC,WACH,OAAO;EAET,OAAO;GAAE,GAAG;GAAM,KAAK,OAAO,MAAM;EAAE;CACxC;CACA,MAAM,wBAAmC;EACvC,OAAO,SAAS,GAAG,EAAE,CAAC,EAAE,KAAK,YAAY;CAC3C;CACA,MAAM,kBAAwB;EAC5B,IAAI,YAAY,GACd;EAEF,MAAM,UAAU,cAAc,YAAY,UAAU;EACpD,IAAI,QAAQ,SAAS,GAAG;GAEtB,IAAI,eAAe;GACnB,IAAI,eAAe,YACjB,gBAAgB,wBAAwB,UAAU;GAEpD,gBAAgB,CAAC,CAAC,KAAK,aAAa;IAAE,MAAM;IAAQ;GAAQ,GAAG,YAAY,CAAC;EAC9E;EACA,aAAa;EACb,YAAY;CACd;CAEA,IAAI;CACJ,MAAM,SAAS,IAAI,OACjB;EACE,cAAc,MAAM;GAClB,gBAAgB;IAAE;IAAM,OAAO,OAAO;GAAW;EACnD;EACA,UAAU,MAAM,eAAe;GAC7B,gBAAgB,KAAA;GAChB,UAAU;GACV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W,GACtD,IAAI,CAAC,yBAAyB,IAAI,WAAW,KAAK,GAChD,MAAM,QAAQ,KAAK,WAAW,GAAI,gCAAgC,WAAW,KAAK;CAGtF,OAAO;AACT;AAIA,SAAS,YAAY,eAGnB;CACA,MAAM,aAAqC,CAAC;CAC5C,MAAM,SAAiC,CAAC;CACxC,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ,aAAa,GACtD,IAAI,YAAY,IAAI,GAClB,OAAO,QAAQ;MAEf,WAAW,QAAQ;CAGvB,OAAO;EAAE;EAAY;CAAO;AAC9B;AAEA,SAAS,cAAc,KAAa,MAA8B;CAChE,QAAQ,MAAR;EACE,KAAK;GACH,IAAI,IAAI,KAAK,MAAM,IACjB,OAAO;GAET,OAAO;EACT,KAAK,YACH,OAAO,IAAI,QAAQ,QAAQ,GAAG,CAAC,CAAC,KAAK;EACvC,KAAK,UACH,OAAO,WAAW,GAAG;EACvB,KAAK,QACH,OAAO,IAAI,KAAK;CACpB;AACF;AAIA,SAAS,WAAW,KAAqB;CACvC,IAAI,IAAI,KAAK,MAAM,IAAI;EACrB,IAAI,IAAI,SAAS,IAAI,GACnB,OAAO;EAET,OAAO;CACT;CACA,OAAO,IACJ,QAAQ,aAAa,EAAE,CAAC,CACxB,QAAQ,aAAa,EAAE,CAAC,CACxB,QAAQ,QAAQ,GAAG;AACxB;AAEA,SAAS,wBAAwB,MAAsB;CACrD,OAAO,KAAK,SAAS,KAAK,UAAU,CAAC,CAAC;AACxC;;;ACrLA,SAAgB,cAAc,MAAuC;CACnE,OAAO,KAAK,SAAS;AACvB"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/errors.ts","../src/parse.ts","../src/ast.ts"],"sourcesContent":["import { SourceError } from '@monimesl/dot-core';\n\nexport class DmlParseError extends SourceError {\n override readonly name = 'DmlParseError';\n}\n","import { Parser } from 'htmlparser2';\nimport { createLocator, isEventProp } from '@monimesl/dot-core';\n\nimport { DmlParseError } from './errors';\nimport type { DmlElementNode, DmlNode } from './ast';\n\nexport interface ParseDmlOptions {\n file?: string;\n locations?: boolean;\n whitespace?: 'trim' | 'collapse' | 'inline' | 'preserve';\n}\n\ntype WhitespaceMode = NonNullable<ParseDmlOptions['whitespace']>;\n\nconst CLOSING_TAG = /<\\/([^\\s>]+)\\s*>/g;\nconst OPAQUE_REGION = /<!--[\\s\\S]*?-->|<!\\[CDATA\\[[\\s\\S]*?]]>/g;\n\ninterface OpenTag {\n node: DmlElementNode;\n start: number;\n}\n\n// Parses .dml markup into a tree, leaving `{{ }}` bindings as raw strings.\nfunction parseDmlToIR(source: string, options: ParseDmlOptions = {}): DmlNode[] {\n const { file, locations = false, whitespace = 'trim' } = options;\n const roots: DmlNode[] = [];\n const openTags: OpenTag[] = [];\n let textBuffer = '';\n let textStart = -1;\n const matchedClosingTagOffsets = new Set<number>();\n const locate = createLocator(source);\n const errorAt = (message: string, offset: number) => {\n return new DmlParseError(message, file, locate(offset));\n };\n // Without `locations`, nodes have no `loc` key at all.\n const withLocation = <Node extends DmlNode>(node: Node, offset: number): Node => {\n if (!locations) {\n return node;\n }\n return { ...node, loc: locate(offset) };\n };\n const currentChildren = (): DmlNode[] => {\n return openTags.at(-1)?.node.children ?? roots;\n };\n const flushText = (): void => {\n if (textStart < 0) {\n return;\n }\n const content = normalizeText(textBuffer, whitespace);\n if (content.length > 0) {\n // Point at the first character kept, past any whitespace trimmed off the front.\n let contentStart = textStart;\n if (whitespace !== 'preserve') {\n contentStart += leadingWhitespaceLength(textBuffer);\n }\n currentChildren().push(withLocation({ type: 'Text', content }, contentStart));\n }\n textBuffer = '';\n textStart = -1;\n };\n // A tag whose name has been read but not its closing `>`.\n let unfinishedTag: { name: string; start: number } | undefined;\n const parser = new Parser(\n {\n onopentagname(name) {\n unfinishedTag = { name, start: parser.startIndex };\n },\n onopentag(name, rawAttributes) {\n unfinishedTag = undefined;\n flushText();\n const { attributes, events } = splitEvents(rawAttributes);\n const node = withLocation<DmlElementNode>(\n { type: 'Element', tag: name, attributes, events, children: [] },\n parser.startIndex,\n );\n currentChildren().push(node);\n openTags.push({ node, start: parser.startIndex });\n },\n onclosetag(name, isImplied) {\n flushText();\n if (unfinishedTag) {\n throw errorAt(\n `<${unfinishedTag.name}> isn't finished. Add \\`>\\` or \\`/>\\``,\n unfinishedTag.start,\n );\n }\n // htmlparser2 only reports closing tags it has seen open.\n const openTag = openTags.pop()!;\n const openTagName = openTag.node.tag;\n const selfClosing = parser.startIndex === openTag.start;\n if (isImplied && !selfClosing) {\n let found = 'the end of the file';\n if (parser.startIndex < source.length) {\n found = `\\`${source.slice(parser.startIndex, parser.endIndex + 1)}\\``;\n }\n throw errorAt(\n `<${openTagName}> isn't closed. Add </${openTagName}> before ${found}`,\n openTag.start,\n );\n }\n if (name !== openTagName) {\n throw errorAt(\n `</${name}> doesn't match <${openTagName}>. Close it with </${openTagName}>`,\n parser.startIndex,\n );\n }\n if (!selfClosing) {\n matchedClosingTagOffsets.add(parser.startIndex);\n }\n },\n ontext(data) {\n // htmlparser2 splits text around entities, so it's collected until the next tag.\n if (textStart < 0) {\n textStart = parser.startIndex;\n }\n textBuffer += data;\n },\n oncomment() {\n flushText();\n },\n onprocessinginstruction() {\n flushText();\n },\n onerror(error) {\n throw errorAt(error.message, parser.startIndex);\n },\n },\n {\n xmlMode: true,\n decodeEntities: true,\n recognizeCDATA: true,\n },\n );\n\n parser.write(source);\n parser.end();\n flushText();\n\n // htmlparser2 ignores unmatched closing tags instead of throwing, so they're caught here.\n // Comments and CDATA are blanked with spaces, not removed, so offsets still match the source.\n const markupOnly = source.replace(OPAQUE_REGION, (region) => ' '.repeat(region.length));\n for (const closingTag of markupOnly.matchAll(CLOSING_TAG)) {\n if (!matchedClosingTagOffsets.has(closingTag.index)) {\n throw errorAt(\n `</${closingTag[1]!}> has no matching opening tag. Remove it, or add the opening tag`,\n closingTag.index,\n );\n }\n }\n return roots;\n}\n\nexport default parseDmlToIR;\n\nfunction splitEvents(rawAttributes: Record<string, string>): {\n attributes: Record<string, string>;\n events: Record<string, string>;\n} {\n const attributes: Record<string, string> = {};\n const events: Record<string, string> = {};\n for (const [name, value] of Object.entries(rawAttributes)) {\n if (isEventProp(name)) {\n events[name] = value;\n } else {\n attributes[name] = value;\n }\n }\n return { attributes, events };\n}\n\nfunction normalizeText(raw: string, mode: WhitespaceMode): string {\n switch (mode) {\n case 'preserve':\n if (raw.trim() === '') {\n return '';\n }\n return raw;\n case 'collapse':\n return raw.replace(/\\s+/g, ' ').trim();\n case 'inline':\n return inlineText(raw);\n case 'trim':\n return raw.trim();\n }\n}\n\n// As text flows around inline elements: whitespace with a line break in it only lays out the markup,\n// so it goes, but a space on the same line as an element stays, as in `paid <Text>SLE 50</Text> today`.\nfunction inlineText(raw: string): string {\n if (raw.trim() === '') {\n if (raw.includes('\\n')) {\n return '';\n }\n return ' ';\n }\n return raw\n .replace(/^\\s*\\n\\s*/, '')\n .replace(/\\s*\\n\\s*$/, '')\n .replace(/\\s+/g, ' ');\n}\n\nfunction leadingWhitespaceLength(text: string): number {\n return text.length - text.trimStart().length;\n}\n","import type { SourceLocation } from '@monimesl/dot-core';\n\nexport interface DmlElementNode {\n readonly type: 'Element';\n readonly tag: string;\n readonly events: Record<string, string>;\n readonly attributes: Record<string, string>;\n readonly children: DmlNode[];\n readonly loc?: SourceLocation;\n}\n\nexport interface DmlTextNode {\n readonly type: 'Text';\n readonly content: string;\n readonly loc?: SourceLocation;\n}\n\nexport type DmlNode = DmlElementNode | DmlTextNode;\n\nexport function isElementNode(node: DmlNode): node is DmlElementNode {\n return node.type === 'Element';\n}\n"],"mappings":";;;AAEA,IAAa,gBAAb,cAAmC,YAAY;CAC7C,OAAyB;AAC3B;;;ACUA,MAAM,cAAc;AACpB,MAAM,gBAAgB;AAQtB,SAAS,aAAa,QAAgB,UAA2B,CAAC,GAAc;CAC9E,MAAM,EAAE,MAAM,YAAY,OAAO,aAAa,WAAW;CACzD,MAAM,QAAmB,CAAC;CAC1B,MAAM,WAAsB,CAAC;CA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Aa,MAA8B;CAChE,QAAQ,MAAR;EACE,KAAK;GACH,IAAI,IAAI,KAAK,MAAM,IACjB,OAAO;GAET,OAAO;EACT,KAAK,YACH,OAAO,IAAI,QAAQ,QAAQ,GAAG,CAAC,CAAC,KAAK;EACvC,KAAK,UACH,OAAO,WAAW,GAAG;EACvB,KAAK,QACH,OAAO,IAAI,KAAK;CACpB;AACF;AAIA,SAAS,WAAW,KAAqB;CACvC,IAAI,IAAI,KAAK,MAAM,IAAI;EACrB,IAAI,IAAI,SAAS,IAAI,GACnB,OAAO;EAET,OAAO;CACT;CACA,OAAO,IACJ,QAAQ,aAAa,EAAE,CAAC,CACxB,QAAQ,aAAa,EAAE,CAAC,CACxB,QAAQ,QAAQ,GAAG;AACxB;AAEA,SAAS,wBAAwB,MAAsB;CACrD,OAAO,KAAK,SAAS,KAAK,UAAU,CAAC,CAAC;AACxC;;;ACxLA,SAAgB,cAAc,MAAuC;CACnE,OAAO,KAAK,SAAS;AACvB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monimesl/dot-dml-parser",
3
- "version": "1.0.0-beta.2",
3
+ "version": "1.0.0-beta.3",
4
4
  "description": "Dot .dml template parser: markup -> intermediary representation",
5
5
  "type": "module",
6
6
  "repository": {
@@ -32,7 +32,7 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "htmlparser2": "^12.0.0",
35
- "@monimesl/dot-core": "1.0.0-beta.2"
35
+ "@monimesl/dot-core": "1.0.0-beta.3"
36
36
  },
37
37
  "publishConfig": {
38
38
  "access": "public"