From 01595dcabfdbecb2879720d87b1f51c3b6c4203b Mon Sep 17 00:00:00 2001 From: Dylan Piercey Date: Mon, 4 Apr 2022 13:05:43 -0700 Subject: [PATCH] feat: merge body type and tag tag, allow override tag types --- .../argument-and-params.expected.txt | 70 +++++----- ...rgument-attr-extra-whitespace.expected.txt | 2 +- .../__snapshots__/argument-attr.expected.txt | 2 +- .../argument-tag-attr.expected.txt | 2 +- .../argument-tag-complex.expected.txt | 2 +- ...argument-tag-extra-whitespace.expected.txt | 2 +- .../argument-tag-nested-parens.expected.txt | 2 +- .../__snapshots__/argument-tag.expected.txt | 16 +-- .../__snapshots__/attr-bound.expected.txt | 12 +- .../attr-comma-multiline.expected.txt | 2 +- .../attr-complex-functions.expected.txt | 10 +- .../attr-complex-instanceof.expected.txt | 17 ++- .../__snapshots__/attr-complex.expected.txt | 2 +- .../attr-escape-characters.expected.txt | 2 +- .../attr-escaped-dollar.expected.txt | 2 +- .../__snapshots__/attr-grouped-2.expected.txt | 2 +- .../__snapshots__/attr-grouped-3.expected.txt | 2 +- .../__snapshots__/attr-grouped-4.expected.txt | 2 +- .../attr-grouped-multiple.expected.txt | 2 +- .../__snapshots__/attr-grouped.expected.txt | 2 +- .../attr-inc-and-dec.expected.txt | 4 +- .../attr-inconsistent-commas.expected.txt | 2 +- .../attr-int-and-id.expected.txt | 2 +- .../attr-literal-false.expected.txt | 2 +- .../attr-literal-null.expected.txt | 2 +- .../attr-literal-numbers.expected.txt | 2 +- .../attr-literal-regex.expected.txt | 21 ++- ...-literal-string-double-quotes.expected.txt | 2 +- ...-literal-string-single-quotes.expected.txt | 2 +- .../attr-literal-true.expected.txt | 2 +- .../attr-literal-undefined.expected.txt | 2 +- .../attr-method-shorthand.expected.txt | 28 ++-- .../attr-multi-line-comment.expected.txt | 2 +- .../attr-multi-line-string.expected.txt | 2 +- .../attr-nested-literal-regex.expected.txt | 3 +- .../attr-no-value-self-closed.expected.txt | 3 +- .../__snapshots__/attr-no-value.expected.txt | 2 +- .../attr-non-literal.expected.txt | 4 +- .../attr-object-expressions.expected.txt | 2 +- .../attr-operators-newline-after.expected.txt | 91 ++++++------ ...attr-operators-newline-before.expected.txt | 95 ++++++------- .../attr-operators-space-after.expected.txt | 91 ++++++------ .../attr-operators-space-before.expected.txt | 101 +++++++------- .../attr-operators-space-between.expected.txt | 131 +++++++++--------- .../attr-simple-expression.expected.txt | 2 +- .../__snapshots__/attr-spread.expected.txt | 67 +++++---- ...r-unenclosed-whitespace-minus.expected.txt | 2 +- ...sed-whitespace-multiple-attrs.expected.txt | 4 +- ...ttr-unenclosed-whitespace-odd.expected.txt | 2 +- .../attr-unenclosed-whitespace.expected.txt | 2 +- .../attr-value-self-closed.expected.txt | 3 +- ...tr-value-single-quote-escaped.expected.txt | 2 +- .../attr-value-string-concat.expected.txt | 2 +- .../attr-value-typeof-comma.expected.txt | 2 +- ...-value-typeof-no-space-prefix.expected.txt | 2 +- .../attr-value-typeof.expected.txt | 2 +- .../attr-value-void.expected.txt | 2 +- ...ens-and-double-quoted-strings.expected.txt | 2 +- ...ens-and-single-quoted-strings.expected.txt | 2 +- ...th-right-angle-bracket-parens.expected.txt | 2 +- ...attr-with-right-angle-bracket.expected.txt | 2 +- .../attr-without-delimiters.expected.txt | 2 +- ...tick-string-nested-with-space.expected.txt | 2 +- ...ck-string-placeholder-newline.expected.txt | 2 +- .../backtick-string.expected.txt | 2 +- .../__snapshots__/cdata-2.expected.txt | 2 +- .../__snapshots__/cdata-pos.expected.txt | 4 +- .../cdata/__snapshots__/cdata.expected.txt | 2 +- .../comma-ends-attr-operators.expected.txt | 2 +- .../__snapshots__/commas-relax.expected.txt | 6 +- ...ommas-require-all-attrs-first.expected.txt | 3 +- ...commas-require-all-attrs-last.expected.txt | 3 +- ...ent-concise-js-block-trailing.expected.txt | 2 +- .../comment-concise-js-block.expected.txt | 2 +- .../comment-concise-js-line.expected.txt | 2 +- .../comments-within-open-tag.expected.txt | 2 +- .../complex-attr-name.expected.txt | 3 +- .../__snapshots__/complex.expected.txt | 14 +- ...contentplaceholder-html-start.expected.txt | 2 +- .../__snapshots__/css-calc.expected.txt | 2 +- .../default-attr-comma.expected.txt | 3 +- .../default-attr-no-space.expected.txt | 13 +- .../__snapshots__/default-attr.expected.txt | 3 +- .../double-hyphen-block.expected.txt | 8 +- .../double-hyphen-line-start.expected.txt | 8 +- .../double-hyphen-line.expected.txt | 8 +- .../empty-closing-tag.expected.txt | 4 +- .../empty-closing-tag2.expected.txt | 4 +- .../__snapshots__/eof-attr-name.expected.txt | 2 +- ...attr-value-js-comment-comment.expected.txt | 2 +- .../__snapshots__/eof-attr-value.expected.txt | 2 +- .../eof-placeholder-body-escaped.expected.txt | 2 +- ...-placeholder-body-non-escaped.expected.txt | 2 +- .../eof-placeholder-concise.expected.txt | 2 +- ...aceholder-script-body-escaped.expected.txt | 2 +- ...older-script-body-non-escaped.expected.txt | 2 +- .../eof-placeholder-string.expected.txt | 2 +- .../eof-script-body.expected.txt | 2 +- .../__snapshots__/eof-style.expected.txt | 2 +- .../__snapshots__/eof-tag-start.expected.txt | 2 +- .../html-block-after-tag.expected.txt | 4 +- .../html-comment-tag.expected.txt | 6 +- .../__snapshots__/html-comments.expected.txt | 2 +- ...NonstandardStringPlaceholders.expected.txt | 2 +- ...le-escaped-dollar-placeholder.expected.txt | 2 +- ...tr-escaped-dollar-placeholder.expected.txt | 2 +- ...Placeholders-attr-placeholder.expected.txt | 2 +- .../invalid-closing-tag.expected.txt | 2 +- .../mixed-bad-indentation.expected.txt | 4 +- .../__snapshots__/mixed-cdata.expected.txt | 4 +- .../__snapshots__/mixed-comment.expected.txt | 4 +- .../__snapshots__/mixed-invalid.expected.txt | 12 +- .../mixed-open-tag-only.expected.txt | 10 +- .../mixed/__snapshots__/mixed.expected.txt | 12 +- .../multi-line-attrs.expected.txt | 5 +- ...tiline-html-block-missing-end.expected.txt | 4 +- ...iline-html-block-nested-empty.expected.txt | 2 +- .../multiline-html-block-nested.expected.txt | 4 +- ...ultiline-html-block-same-line.expected.txt | 4 +- .../multiline-html-block.expected.txt | 2 +- ...tiple-tags-on-line-close-next.expected.txt | 4 +- .../__snapshots__/nested-pyramid.expected.txt | 12 +- .../nested-siblings.expected.txt | 6 +- .../__snapshots__/nested-tags.expected.txt | 4 +- .../__snapshots__/nested-text.expected.txt | 4 +- ...en-tag-only-with-body-concise.expected.txt | 4 +- .../open-tag-only-with-body.expected.txt | 5 +- .../__snapshots__/open-tag-only.expected.txt | 17 +-- .../__snapshots__/param-tag.expected.txt | 2 +- ...er-in-template-literal-string.expected.txt | 2 +- .../parsed-text-style-tag.expected.txt | 2 +- .../placeholder-attr-invalid.expected.txt | 2 +- ...ttr-string-value-mixed-quotes.expected.txt | 2 +- ...lder-attr-string-value-parens.expected.txt | 2 +- ...placeholder-attr-string-value.expected.txt | 2 +- ...older-attr-within-placeholder.expected.txt | 2 +- ...er-attr-within-string-complex.expected.txt | 2 +- ...der-attr-within-string-simple.expected.txt | 2 +- .../placeholder-attr-wrapped.expected.txt | 2 +- .../placeholder-backslash.expected.txt | 10 +- ...er-body-multi-line-js-comment.expected.txt | 2 +- ...r-body-single-line-js-comment.expected.txt | 2 +- .../placeholder-body-text.expected.txt | 2 +- .../placeholder-escape.expected.txt | 2 +- .../placeholder-no-escape.expected.txt | 2 +- .../placeholder-tag-name-concise.expected.txt | 2 +- .../placeholder-tag-name-html.expected.txt | 3 +- ...-unnamed-attr-escaped-escaped.expected.txt | 2 +- ...ceholder-unnamed-attr-escaped.expected.txt | 2 +- ...der-unnamed-attr-last-concise.expected.txt | 4 +- ...unnamed-attr-last-self-closed.expected.txt | 3 +- ...placeholder-unnamed-attr-last.expected.txt | 2 +- .../placeholder-unnamed-attr.expected.txt | 2 +- ...placeholder-within-script-tag.expected.txt | 2 +- ...r-within-script-within-string.expected.txt | 2 +- ...holder-within-string-newlines.expected.txt | 2 +- .../__snapshots__/root-el.expected.txt | 2 +- .../__snapshots__/root-els.expected.txt | 4 +- ...pt-concise-invalid-nested-tag.expected.txt | 2 +- .../__snapshots__/script-concise.expected.txt | 4 +- .../script-empty-concise.expected.txt | 6 +- .../script-escaped-placeholder.expected.txt | 2 +- .../script-self-closed.expected.txt | 10 +- .../script-single-line-comment.expected.txt | 2 +- .../script-tag-entities.expected.txt | 2 +- .../script/__snapshots__/script.expected.txt | 2 +- ...ptlet-line-multiline-comments.expected.txt | 2 +- .../scriptlet-line-no-middle.expected.txt | 2 +- ...et-line-trailing-line-comment.expected.txt | 2 +- .../self-closed-tag-attrs.expected.txt | 3 +- .../self-closed-tag.expected.txt | 3 +- .../self-closing-open-tag-only.expected.txt | 5 +- .../semicolon-concise.expected.txt | 4 +- ...-class-dynamic-literal-prefix.expected.txt | 2 +- ...-class-dynamic-literal-suffix.expected.txt | 2 +- .../shorthand-class-dynamic.expected.txt | 2 +- .../shorthand-class-self-closed.expected.txt | 5 +- .../shorthand-closing-html.expected.txt | 4 +- .../shorthand-closing-html2.expected.txt | 2 +- .../shorthand-closing-html3.expected.txt | 2 +- ...orthand-div-id-class-multiple.expected.txt | 2 +- .../shorthand-div-id-class.expected.txt | 2 +- .../shorthand-div-id.expected.txt | 2 +- .../shorthand-id-class-html.expected.txt | 2 +- .../shorthand-id-class.expected.txt | 2 +- ...and-id-dynamic-literal-prefix.expected.txt | 2 +- ...and-id-dynamic-literal-suffix.expected.txt | 2 +- .../shorthand-id-dynamic.expected.txt | 2 +- .../shorthand-id-self-closed.expected.txt | 5 +- .../__snapshots__/shorthand-id.expected.txt | 2 +- .../shorthand-mixed-concise.expected.txt | 10 +- .../shorthand-mixed.expected.txt | 10 +- ...single-line-text-block-nested.expected.txt | 2 +- ...ingle-line-text-block-sibling.expected.txt | 2 +- .../statement-concise-only.expected.txt | 3 +- .../statement-root-only.expected.txt | 5 +- .../stray-special-chars.expected.txt | 2 +- .../__snapshots__/strip-bom.expected.txt | 5 +- ...pression-literal-prefix-attrs.expected.txt | 2 +- ...ression-literal-prefix-suffix.expected.txt | 2 +- ...ame-expression-literal-prefix.expected.txt | 2 +- ...ame-expression-literal-suffix.expected.txt | 2 +- ...-name-expression-shorthand-id.expected.txt | 2 +- ...expression-simple-empty-close.expected.txt | 2 +- .../tag-name-expression-simple.expected.txt | 2 +- .../tag-var-declaration.expected.txt | 82 +++++------ .../tag-var-with-params.expected.txt | 2 +- .../text-after-semicolon.expected.txt | 8 +- .../__snapshots__/text-after-tag.expected.txt | 2 +- .../text-parse-mode-concise.expected.txt | 4 +- ...xt-parse-mode-delimited-block.expected.txt | 6 +- .../text-parse-mode-html.expected.txt | 4 +- .../__snapshots__/textarea.expected.txt | 4 +- .../unclosed-tag-eof.expected.txt | 5 +- .../__snapshots__/var-new-Date.expected.txt | 2 +- .../var/__snapshots__/var.expected.txt | 6 +- .../whitespace-around-equals.expected.txt | 2 +- ...whitespace-empty-lines-indent.expected.txt | 6 +- .../whitespace-empty-lines.expected.txt | 6 +- .../whitespace-newline-indent.expected.txt | 4 +- .../whitespace-newline.expected.txt | 4 +- .../whitespace-only-reset-indent.expected.txt | 4 +- .../whitespace-preservation.expected.txt | 26 ++-- .../xml-declaration-ill-formed.expected.txt | 2 +- .../xml-declaration.expected.txt | 2 +- src/__tests__/main.test.ts | 40 +++++- src/core/Parser.ts | 16 +-- src/index.ts | 8 +- src/states/ATTRIBUTE.ts | 12 +- src/states/CDATA.ts | 2 +- src/states/CONCISE_HTML_CONTENT.ts | 20 +-- src/states/DECLARATION.ts | 2 +- src/states/DTD.ts | 2 +- src/states/HTML_COMMENT.ts | 2 +- src/states/INLINE_SCRIPT.ts | 2 +- src/states/JS_COMMENT_LINE.ts | 4 +- src/states/OPEN_TAG.ts | 54 ++++---- src/states/PLACEHOLDER.ts | 2 +- src/states/TAG_NAME.ts | 49 ++----- src/util/constants.ts | 21 ++- 240 files changed, 850 insertions(+), 921 deletions(-) diff --git a/src/__tests__/fixtures/argument-and-params/__snapshots__/argument-and-params.expected.txt b/src/__tests__/fixtures/argument-and-params/__snapshots__/argument-and-params.expected.txt index 3321cf84..d89d9d6a 100644 --- a/src/__tests__/fixtures/argument-and-params/__snapshots__/argument-and-params.expected.txt +++ b/src/__tests__/fixtures/argument-and-params/__snapshots__/argument-and-params.expected.txt @@ -1,5 +1,5 @@ 1╭─ <${x}(y)/> - │ │ ││ ╰─ openTagEnd(${x}) "/>" + │ │ ││ ╰─ openTagEnd:selfClosed "/>" │ │ │├─ tagArgs.value │ │ │╰─ tagName.quasis[1] │ │ ╰─ tagArgs "(y)" @@ -7,44 +7,38 @@ │ ├─ tagName.quasis[0] ╰─ ╰─ tagName "${x}" 2╭─ <${x}|y|/> - │ ││ ││ ╰─ openTagEnd(${x}) "/>" - │ ││ │├─ tagParams.value - │ ││ │╰─ tagName.quasis[1] - │ ││ ╰─ tagParams "|y|" - │ │├─ tagName.expressions[0] "${x}" - │ │├─ tagName.quasis[0] - │ │╰─ tagName "${x}" - ╰─ ╰─ closeTag(${x}) + │ │ ││ ╰─ openTagEnd:selfClosed "/>" + │ │ │├─ tagParams.value + │ │ │╰─ tagName.quasis[1] + │ │ ╰─ tagParams "|y|" + │ ├─ tagName.expressions[0] "${x}" + │ ├─ tagName.quasis[0] + ╰─ ╰─ tagName "${x}" 3╭─ - │ ││ ││││ ╰─ openTagEnd(tag) "/>" - │ ││ │││╰─ tagArgs.value - │ ││ ││╰─ tagArgs "(y)" - │ ││ │╰─ tagShorthandClass.quasis[0] - │ ││ ╰─ tagShorthandClass ".x" - │ │╰─ tagName "tag" - ╰─ ╰─ closeTag(${x}) + │ │ ││││ ╰─ openTagEnd:selfClosed "/>" + │ │ │││╰─ tagArgs.value + │ │ ││╰─ tagArgs "(y)" + │ │ │╰─ tagShorthandClass.quasis[0] + │ │ ╰─ tagShorthandClass ".x" + ╰─ ╰─ tagName "tag" 4╭─ - │ ││ ││││ ╰─ openTagEnd(tag) "/>" - │ ││ │││╰─ tagParams.value - │ ││ ││╰─ tagParams "|y|" - │ ││ │╰─ tagShorthandClass.quasis[0] - │ ││ ╰─ tagShorthandClass ".x" - │ │╰─ tagName "tag" - ╰─ ╰─ closeTag(tag) + │ │ ││││ ╰─ openTagEnd:selfClosed "/>" + │ │ │││╰─ tagParams.value + │ │ ││╰─ tagParams "|y|" + │ │ │╰─ tagShorthandClass.quasis[0] + │ │ ╰─ tagShorthandClass ".x" + ╰─ ╰─ tagName "tag" 5╭─ - │ ││ ││││ ╰─ openTagEnd(tag) "/>" - │ ││ │││╰─ tagArgs.value - │ ││ ││╰─ tagArgs "(y)" - │ ││ │╰─ tagShorthandId.quasis[0] - │ ││ ╰─ tagShorthandId "#x" - │ │╰─ tagName "tag" - ╰─ ╰─ closeTag(tag) + │ │ ││││ ╰─ openTagEnd:selfClosed "/>" + │ │ │││╰─ tagArgs.value + │ │ ││╰─ tagArgs "(y)" + │ │ │╰─ tagShorthandId.quasis[0] + │ │ ╰─ tagShorthandId "#x" + ╰─ ╰─ tagName "tag" 6╭─ - │ ││ ││││ │ ╰─ closeTag(tag) - │ ││ ││││ ╰─ openTagEnd(tag) "/>" - │ ││ │││╰─ tagParams.value - │ ││ ││╰─ tagParams "|y|" - │ ││ │╰─ tagShorthandId.quasis[0] - │ ││ ╰─ tagShorthandId "#x" - │ │╰─ tagName "tag" - ╰─ ╰─ closeTag(tag) \ No newline at end of file + │ │ ││││ ╰─ openTagEnd:selfClosed "/>" + │ │ │││╰─ tagParams.value + │ │ ││╰─ tagParams "|y|" + │ │ │╰─ tagShorthandId.quasis[0] + │ │ ╰─ tagShorthandId "#x" + ╰─ ╰─ tagName "tag" \ No newline at end of file diff --git a/src/__tests__/fixtures/argument-attr-extra-whitespace/__snapshots__/argument-attr-extra-whitespace.expected.txt b/src/__tests__/fixtures/argument-attr-extra-whitespace/__snapshots__/argument-attr-extra-whitespace.expected.txt index 5ce56096..9e5ff1ee 100644 --- a/src/__tests__/fixtures/argument-attr-extra-whitespace/__snapshots__/argument-attr-extra-whitespace.expected.txt +++ b/src/__tests__/fixtures/argument-attr-extra-whitespace/__snapshots__/argument-attr-extra-whitespace.expected.txt @@ -1,5 +1,5 @@ 1╭─
y)> - │ │ │ ││ ╰─ openTagEnd(div) + │ │ │ ││ ╰─ openTagEnd │ │ │ │╰─ attrArgs.value "x > y" │ │ │ ╰─ attrArgs "(x > y)" │ │ ╰─ attrName "if" diff --git a/src/__tests__/fixtures/argument-attr/__snapshots__/argument-attr.expected.txt b/src/__tests__/fixtures/argument-attr/__snapshots__/argument-attr.expected.txt index 3f8c77c6..0ad520d1 100644 --- a/src/__tests__/fixtures/argument-attr/__snapshots__/argument-attr.expected.txt +++ b/src/__tests__/fixtures/argument-attr/__snapshots__/argument-attr.expected.txt @@ -1,7 +1,7 @@ 1╭─
y)>
│ │ │ ││ ││ ╰─ closeTag(div).value "div" │ │ │ ││ │╰─ closeTag(div) "
" - │ │ │ ││ ╰─ openTagEnd(div) + │ │ │ ││ ╰─ openTagEnd │ │ │ │╰─ attrArgs.value "x > y" │ │ │ ╰─ attrArgs "(x > y)" │ │ ╰─ attrName "if" diff --git a/src/__tests__/fixtures/argument-tag-attr/__snapshots__/argument-tag-attr.expected.txt b/src/__tests__/fixtures/argument-tag-attr/__snapshots__/argument-tag-attr.expected.txt index 00d53f70..039e2126 100644 --- a/src/__tests__/fixtures/argument-tag-attr/__snapshots__/argument-tag-attr.expected.txt +++ b/src/__tests__/fixtures/argument-tag-attr/__snapshots__/argument-tag-attr.expected.txt @@ -1,7 +1,7 @@ 1╭─ y)> │ │ ││ │ ││ ││ ╰─ closeTag(for).value "for" │ │ ││ │ ││ │╰─ closeTag(for) "" - │ │ ││ │ ││ ╰─ openTagEnd(for) + │ │ ││ │ ││ ╰─ openTagEnd │ │ ││ │ │╰─ attrArgs.value "x > y" │ │ ││ │ ╰─ attrArgs "(x > y)" │ │ ││ ╰─ attrName "if" diff --git a/src/__tests__/fixtures/argument-tag-complex/__snapshots__/argument-tag-complex.expected.txt b/src/__tests__/fixtures/argument-tag-complex/__snapshots__/argument-tag-complex.expected.txt index 2eb69855..31fac2fd 100644 --- a/src/__tests__/fixtures/argument-tag-complex/__snapshots__/argument-tag-complex.expected.txt +++ b/src/__tests__/fixtures/argument-tag-complex/__snapshots__/argument-tag-complex.expected.txt @@ -1,7 +1,7 @@ 1╭─ │ │ ││ ││ ╰─ closeTag(for).value "for" │ │ ││ │╰─ closeTag(for) "" - │ │ ││ ╰─ openTagEnd(for) + │ │ ││ ╰─ openTagEnd │ │ │╰─ tagArgs.value "x in [\"Hello ${name}!\", \"(World)\"]" │ │ ╰─ tagArgs "(x in [\"Hello ${name}!\", \"(World)\"])" ╰─ ╰─ tagName "for" \ No newline at end of file diff --git a/src/__tests__/fixtures/argument-tag-extra-whitespace/__snapshots__/argument-tag-extra-whitespace.expected.txt b/src/__tests__/fixtures/argument-tag-extra-whitespace/__snapshots__/argument-tag-extra-whitespace.expected.txt index 3642fb51..9ee48d4d 100644 --- a/src/__tests__/fixtures/argument-tag-extra-whitespace/__snapshots__/argument-tag-extra-whitespace.expected.txt +++ b/src/__tests__/fixtures/argument-tag-extra-whitespace/__snapshots__/argument-tag-extra-whitespace.expected.txt @@ -1,7 +1,7 @@ 1╭─ │ │ ││ ││ ╰─ closeTag(for).value "for" │ │ ││ │╰─ closeTag(for) "" - │ │ ││ ╰─ openTagEnd(for) + │ │ ││ ╰─ openTagEnd │ │ │╰─ tagArgs.value "x in y" │ │ ╰─ tagArgs "(x in y)" ╰─ ╰─ tagName "for" \ No newline at end of file diff --git a/src/__tests__/fixtures/argument-tag-nested-parens/__snapshots__/argument-tag-nested-parens.expected.txt b/src/__tests__/fixtures/argument-tag-nested-parens/__snapshots__/argument-tag-nested-parens.expected.txt index 35517dfb..6b9c39a8 100644 --- a/src/__tests__/fixtures/argument-tag-nested-parens/__snapshots__/argument-tag-nested-parens.expected.txt +++ b/src/__tests__/fixtures/argument-tag-nested-parens/__snapshots__/argument-tag-nested-parens.expected.txt @@ -1,6 +1,6 @@ 1╭─ --- 2╭─ - │ ││ ││ ╰─ openTagEnd(if) + │ ││ ││ ╰─ openTagEnd │ ││ │╰─ tagArgs.value "notEmpty(data.colors)" │ ││ ╰─ tagArgs "(notEmpty(data.colors))" │ │╰─ tagName "if" diff --git a/src/__tests__/fixtures/argument-tag/__snapshots__/argument-tag.expected.txt b/src/__tests__/fixtures/argument-tag/__snapshots__/argument-tag.expected.txt index 27bb05b4..eb396fdd 100644 --- a/src/__tests__/fixtures/argument-tag/__snapshots__/argument-tag.expected.txt +++ b/src/__tests__/fixtures/argument-tag/__snapshots__/argument-tag.expected.txt @@ -1,20 +1,18 @@ 1╭─ │ │ ││ ││ ╰─ closeTag(for).value "for" │ │ ││ │╰─ closeTag(for) "" - │ │ ││ ╰─ openTagEnd(for) + │ │ ││ ╰─ openTagEnd │ │ │╰─ tagArgs.value "x in y" │ │ ╰─ tagArgs "(x in y)" ╰─ ╰─ tagName "for" 2╭─ - │ │ ││ ╰─ openTagEnd(ab) "/>" + │ │ ││ ╰─ openTagEnd:selfClosed "/>" │ │ │╰─ tagArgs.value "'c'" │ │ ╰─ tagArgs "('c')" ╰─ ╰─ tagName "ab" 3╭─ - │ ││││ ╰─ openTagEnd(a) "/>" - │ │││╰─ tagArgs.value "'b'" - │ ││╰─ tagArgs "('b')" - │ │╰─ tagName - ╰─ ╰─ closeTag(ab) -4╭─ - ╰─ ╰─ closeTag(a) \ No newline at end of file + │ │││ ╰─ openTagEnd:selfClosed "/>" + │ ││╰─ tagArgs.value "'b'" + │ │╰─ tagArgs "('b')" + ╰─ ╰─ tagName +4╰─ \ No newline at end of file diff --git a/src/__tests__/fixtures/attr-bound/__snapshots__/attr-bound.expected.txt b/src/__tests__/fixtures/attr-bound/__snapshots__/attr-bound.expected.txt index 9d66c7a9..dd61685d 100644 --- a/src/__tests__/fixtures/attr-bound/__snapshots__/attr-bound.expected.txt +++ b/src/__tests__/fixtures/attr-bound/__snapshots__/attr-bound.expected.txt @@ -2,7 +2,7 @@ │ │ ││ │ ││ │ ╰─ closeTag(a).value │ │ ││ │ ││ ╰─ closeTag(a) "" │ │ ││ │ │╰─ text "test" - │ │ ││ │ ╰─ openTagEnd(a) + │ │ ││ │ ╰─ openTagEnd │ │ ││ ╰─ attrValue:bound.value "foo" │ │ │╰─ attrValue:bound ":=foo" │ │ ╰─ attrName @@ -11,7 +11,7 @@ │ │ │ │ │ ││ │ ╰─ closeTag(a).value │ │ │ │ │ ││ ╰─ closeTag(a) "" │ │ │ │ │ │╰─ text "test" - │ │ │ │ │ ╰─ openTagEnd(a) + │ │ │ │ │ ╰─ openTagEnd │ │ │ │ ╰─ attrValue:bound.value "foo" │ │ │ ╰─ attrValue:bound ":= foo" │ │ ╰─ attrName @@ -20,7 +20,7 @@ │ ││ │ ││ │ ╰─ closeTag(a).value │ ││ │ ││ ╰─ closeTag(a) "" │ ││ │ │╰─ text "test" - │ ││ │ ╰─ openTagEnd(a) + │ ││ │ ╰─ openTagEnd │ ││ ╰─ attrValue:bound.value "foo" │ │├─ attrValue:bound ":=foo" │ │╰─ attrName @@ -29,7 +29,7 @@ │ │ │ │ ││ │ ╰─ closeTag(a).value │ │ │ │ ││ ╰─ closeTag(a) "" │ │ │ │ │╰─ text "test" - │ │ │ │ ╰─ openTagEnd(a) + │ │ │ │ ╰─ openTagEnd │ │ │ ╰─ attrValue:bound.value "foo" │ │ ├─ attrValue:bound ":= foo" │ │ ╰─ attrName @@ -38,7 +38,7 @@ │ │││ │ │ ││ │ ╰─ closeTag(a).value │ │││ │ │ ││ ╰─ closeTag(a) "" │ │││ │ │ │╰─ text "test" - │ │││ │ │ ╰─ openTagEnd(a) + │ │││ │ │ ╰─ openTagEnd │ │││ │ ╰─ attrValue:bound.value "foo" │ │││ ├─ attrValue:bound ":=foo" │ │││ ╰─ attrName @@ -49,7 +49,7 @@ │ │││ │ │ ││ │ ╰─ closeTag(a).value │ │││ │ │ ││ ╰─ closeTag(a) "" │ │││ │ │ │╰─ text "test" - │ │││ │ │ ╰─ openTagEnd(a) + │ │││ │ │ ╰─ openTagEnd │ │││ │ ╰─ attrValue:bound.value "foo" │ │││ ├─ attrValue:bound ":= foo" │ │││ ╰─ attrName diff --git a/src/__tests__/fixtures/attr-comma-multiline/__snapshots__/attr-comma-multiline.expected.txt b/src/__tests__/fixtures/attr-comma-multiline/__snapshots__/attr-comma-multiline.expected.txt index ed112468..2d5c89a3 100644 --- a/src/__tests__/fixtures/attr-comma-multiline/__snapshots__/attr-comma-multiline.expected.txt +++ b/src/__tests__/fixtures/attr-comma-multiline/__snapshots__/attr-comma-multiline.expected.txt @@ -20,4 +20,4 @@ 6╭─ -- This is the body of the a tag │ │ │ ╰─ closeTag(a) │ │ ╰─ text "This is the body of the a tag" - ╰─ ╰─ openTagEnd(a) \ No newline at end of file + ╰─ ╰─ openTagEnd \ No newline at end of file diff --git a/src/__tests__/fixtures/attr-complex-functions/__snapshots__/attr-complex-functions.expected.txt b/src/__tests__/fixtures/attr-complex-functions/__snapshots__/attr-complex-functions.expected.txt index 825908d8..305109d2 100644 --- a/src/__tests__/fixtures/attr-complex-functions/__snapshots__/attr-complex-functions.expected.txt +++ b/src/__tests__/fixtures/attr-complex-functions/__snapshots__/attr-complex-functions.expected.txt @@ -10,7 +10,7 @@ │ │ │ ╰─ attrValue "= (x) => { console.log(\"y\") }" │ │ ╰─ attrName │ ├─ closeTag(tag) - │ ├─ openTagEnd(tag) + │ ├─ openTagEnd ╰─ ╰─ tagName "tag" 3╭─ tag a = x => { console.log("y") } b │ │ │ │ │ ╰─ attrName @@ -18,7 +18,7 @@ │ │ │ ╰─ attrValue "= x => { console.log(\"y\") }" │ │ ╰─ attrName │ ├─ closeTag(tag) - │ ├─ openTagEnd(tag) + │ ├─ openTagEnd ╰─ ╰─ tagName "tag" 4╭─ tag a = async x => { console.log("y") } b │ │ │ │ │ ╰─ attrName @@ -26,15 +26,15 @@ │ │ │ ╰─ attrValue "= async x => { console.log(\"y\") }" │ │ ╰─ attrName │ ├─ closeTag(tag) - │ ├─ openTagEnd(tag) + │ ├─ openTagEnd ╰─ ╰─ tagName "tag" 5╭─ tag a = async function (x) { console.log("y") } b │ │ │ │ │ │├─ closeTag(tag) - │ │ │ │ │ │╰─ openTagEnd(tag) + │ │ │ │ │ │╰─ openTagEnd │ │ │ │ │ ╰─ attrName │ │ │ │ ╰─ attrValue.value "async function (x) { console.log(\"y\") }" │ │ │ ╰─ attrValue "= async function (x) { console.log(\"y\") }" │ │ ╰─ attrName │ ├─ closeTag(tag) - │ ├─ openTagEnd(tag) + │ ├─ openTagEnd ╰─ ╰─ tagName "tag" \ No newline at end of file diff --git a/src/__tests__/fixtures/attr-complex-instanceof/__snapshots__/attr-complex-instanceof.expected.txt b/src/__tests__/fixtures/attr-complex-instanceof/__snapshots__/attr-complex-instanceof.expected.txt index a223340a..905c89bd 100644 --- a/src/__tests__/fixtures/attr-complex-instanceof/__snapshots__/attr-complex-instanceof.expected.txt +++ b/src/__tests__/fixtures/attr-complex-instanceof/__snapshots__/attr-complex-instanceof.expected.txt @@ -4,7 +4,7 @@ │ │ ╰─ attrName ╰─ ╰─ tagName "var" 2╭─ - ╰─ ╰─ openTagEnd(var) + ╰─ ╰─ openTagEnd 3╭─ tag a = 'foo' instanceof = String │ │ │ │ │ │ │ ╰─ attrValue.value "String" │ │ │ │ │ │ ╰─ attrValue "= String" @@ -22,7 +22,7 @@ │ │ │ ╰─ attrValue "= 'foo'" │ │ ╰─ attrName │ ├─ closeTag(tag) - │ ├─ openTagEnd(tag) + │ ├─ openTagEnd ╰─ ╰─ tagName "tag" 5╭─ tag a = 'foo' instanceof= String │ │ │ │ │ │ │ ╰─ attrValue.value "String" @@ -32,7 +32,7 @@ │ │ │ ╰─ attrValue "= 'foo'" │ │ ╰─ attrName │ ├─ closeTag(tag) - │ ├─ openTagEnd(tag) + │ ├─ openTagEnd ╰─ ╰─ tagName "tag" 6╭─ tag a = 'foo' instanceof; │ │ │ │ │ ╰─ attrName "instanceof" @@ -40,10 +40,10 @@ │ │ │ ╰─ attrValue "= 'foo'" │ │ ╰─ attrName │ ├─ closeTag(tag) - │ ├─ openTagEnd(tag) + │ ├─ openTagEnd ╰─ ╰─ tagName "tag" 7╭─ - ╰─ ╰─ openTagEnd(tag) + ╰─ ╰─ openTagEnd 8╭─ tag a = 'foo' instanceof, b │ │ │ │ │ │ ╰─ attrName │ │ │ │ │ ╰─ attrName "instanceof" @@ -53,11 +53,11 @@ │ ├─ closeTag(tag) ╰─ ╰─ tagName "tag" 9╭─ - ╰─ ╰─ openTagEnd(tag) + ╰─ ╰─ openTagEnd 10╭─ │ ││ │ │ │ │ ││ ╰─ closeTag(tag).value "tag" │ ││ │ │ │ │ │╰─ closeTag(tag) "" - │ ││ │ │ │ │ ╰─ openTagEnd(tag) + │ ││ │ │ │ │ ╰─ openTagEnd │ ││ │ │ │ ╰─ attrName "instanceof" │ ││ │ │ ╰─ attrValue.value "'foo'" │ ││ │ ╰─ attrValue "= 'foo'" @@ -65,8 +65,7 @@ │ │╰─ tagName "tag" ╰─ ╰─ closeTag(tag) 11╭─ - │ │ │ │ │ │ │ ╰─ closeTag(tag) - │ │ │ │ │ │ ╰─ openTagEnd(tag) "/>" + │ │ │ │ │ │ ╰─ openTagEnd:selfClosed "/>" │ │ │ │ │ ╰─ attrName "instanceof" │ │ │ │ ╰─ attrValue.value "'foo'" │ │ │ ╰─ attrValue "= 'foo'" diff --git a/src/__tests__/fixtures/attr-complex/__snapshots__/attr-complex.expected.txt b/src/__tests__/fixtures/attr-complex/__snapshots__/attr-complex.expected.txt index a8dddef8..5af966e5 100644 --- a/src/__tests__/fixtures/attr-complex/__snapshots__/attr-complex.expected.txt +++ b/src/__tests__/fixtures/attr-complex/__snapshots__/attr-complex.expected.txt @@ -2,7 +2,7 @@ │ │ │││ │ ││ │ ││ │ ╰─ closeTag(a).value │ │ │││ │ ││ │ ││ ╰─ closeTag(a) "" │ │ │││ │ ││ │ │╰─ text "test" - │ │ │││ │ ││ │ ╰─ openTagEnd(a) + │ │ │││ │ ││ │ ╰─ openTagEnd │ │ │││ │ ││ ╰─ attrValue.value "d=(a + (1/2) /* comment */)" │ │ │││ │ │╰─ attrValue "= d=(a + (1/2) /* comment */)" │ │ │││ │ ╰─ attrName diff --git a/src/__tests__/fixtures/attr-escape-characters/__snapshots__/attr-escape-characters.expected.txt b/src/__tests__/fixtures/attr-escape-characters/__snapshots__/attr-escape-characters.expected.txt index 4d876359..8f119349 100644 --- a/src/__tests__/fixtures/attr-escape-characters/__snapshots__/attr-escape-characters.expected.txt +++ b/src/__tests__/fixtures/attr-escape-characters/__snapshots__/attr-escape-characters.expected.txt @@ -1,5 +1,5 @@ 1╭─
- │ │ │ ││ ╰─ openTagEnd(div) + │ │ │ ││ ╰─ openTagEnd │ │ │ │╰─ attrValue.value "'\\\"hello\\\"'" │ │ │ ╰─ attrValue "='\\\"hello\\\"'" │ │ ╰─ attrName "foo" diff --git a/src/__tests__/fixtures/attr-escaped-dollar/__snapshots__/attr-escaped-dollar.expected.txt b/src/__tests__/fixtures/attr-escaped-dollar/__snapshots__/attr-escaped-dollar.expected.txt index f851b207..dbb8fdee 100644 --- a/src/__tests__/fixtures/attr-escaped-dollar/__snapshots__/attr-escaped-dollar.expected.txt +++ b/src/__tests__/fixtures/attr-escaped-dollar/__snapshots__/attr-escaped-dollar.expected.txt @@ -1,7 +1,7 @@ 1╭─ │ │ │ ││ ││ ╰─ closeTag(span).value "span" │ │ │ ││ │╰─ closeTag(span) "" - │ │ │ ││ ╰─ openTagEnd(span) + │ │ │ ││ ╰─ openTagEnd │ │ │ │╰─ attrValue.value "\"\\$name\"" │ │ │ ╰─ attrValue "=\"\\$name\"" │ │ ╰─ attrName "data-foo" diff --git a/src/__tests__/fixtures/attr-grouped-2/__snapshots__/attr-grouped-2.expected.txt b/src/__tests__/fixtures/attr-grouped-2/__snapshots__/attr-grouped-2.expected.txt index 6d80bd14..6fe95756 100644 --- a/src/__tests__/fixtures/attr-grouped-2/__snapshots__/attr-grouped-2.expected.txt +++ b/src/__tests__/fixtures/attr-grouped-2/__snapshots__/attr-grouped-2.expected.txt @@ -18,4 +18,4 @@ 5╭─ -- This is the body of the a tag │ │ │ ╰─ closeTag(a) │ │ ╰─ text "This is the body of the a tag" - ╰─ ╰─ openTagEnd(a) \ No newline at end of file + ╰─ ╰─ openTagEnd \ No newline at end of file diff --git a/src/__tests__/fixtures/attr-grouped-3/__snapshots__/attr-grouped-3.expected.txt b/src/__tests__/fixtures/attr-grouped-3/__snapshots__/attr-grouped-3.expected.txt index b7e8f246..a20a2b8a 100644 --- a/src/__tests__/fixtures/attr-grouped-3/__snapshots__/attr-grouped-3.expected.txt +++ b/src/__tests__/fixtures/attr-grouped-3/__snapshots__/attr-grouped-3.expected.txt @@ -16,4 +16,4 @@ 5╭─ -- This is the body of the a tag │ │ │ ╰─ closeTag(a) │ │ ╰─ text "This is the body of the a tag" - ╰─ ╰─ openTagEnd(a) \ No newline at end of file + ╰─ ╰─ openTagEnd \ No newline at end of file diff --git a/src/__tests__/fixtures/attr-grouped-4/__snapshots__/attr-grouped-4.expected.txt b/src/__tests__/fixtures/attr-grouped-4/__snapshots__/attr-grouped-4.expected.txt index 982489a2..739b33d0 100644 --- a/src/__tests__/fixtures/attr-grouped-4/__snapshots__/attr-grouped-4.expected.txt +++ b/src/__tests__/fixtures/attr-grouped-4/__snapshots__/attr-grouped-4.expected.txt @@ -16,4 +16,4 @@ 5╭─ -- This is the body of the a tag │ │ │ ╰─ closeTag(a) │ │ ╰─ text "This is the body of the a tag" - ╰─ ╰─ openTagEnd(a) \ No newline at end of file + ╰─ ╰─ openTagEnd \ No newline at end of file diff --git a/src/__tests__/fixtures/attr-grouped-multiple/__snapshots__/attr-grouped-multiple.expected.txt b/src/__tests__/fixtures/attr-grouped-multiple/__snapshots__/attr-grouped-multiple.expected.txt index 105ff796..ee3a9459 100644 --- a/src/__tests__/fixtures/attr-grouped-multiple/__snapshots__/attr-grouped-multiple.expected.txt +++ b/src/__tests__/fixtures/attr-grouped-multiple/__snapshots__/attr-grouped-multiple.expected.txt @@ -15,4 +15,4 @@ 4╭─ -- This is the body of the a tag │ │ │ ╰─ closeTag(a) │ │ ╰─ text "This is the body of the a tag" - ╰─ ╰─ openTagEnd(a) \ No newline at end of file + ╰─ ╰─ openTagEnd \ No newline at end of file diff --git a/src/__tests__/fixtures/attr-grouped/__snapshots__/attr-grouped.expected.txt b/src/__tests__/fixtures/attr-grouped/__snapshots__/attr-grouped.expected.txt index 713b849c..6f3c14c3 100644 --- a/src/__tests__/fixtures/attr-grouped/__snapshots__/attr-grouped.expected.txt +++ b/src/__tests__/fixtures/attr-grouped/__snapshots__/attr-grouped.expected.txt @@ -18,4 +18,4 @@ 5╭─ -- This is the body of the a tag │ │ │ ╰─ closeTag(a) │ │ ╰─ text "This is the body of the a tag" - ╰─ ╰─ openTagEnd(a) \ No newline at end of file + ╰─ ╰─ openTagEnd \ No newline at end of file diff --git a/src/__tests__/fixtures/attr-inc-and-dec/__snapshots__/attr-inc-and-dec.expected.txt b/src/__tests__/fixtures/attr-inc-and-dec/__snapshots__/attr-inc-and-dec.expected.txt index bd3d14d6..0e1a4f1b 100644 --- a/src/__tests__/fixtures/attr-inc-and-dec/__snapshots__/attr-inc-and-dec.expected.txt +++ b/src/__tests__/fixtures/attr-inc-and-dec/__snapshots__/attr-inc-and-dec.expected.txt @@ -8,7 +8,7 @@ ╰─ ╰─ tagName 2╭─ a foo=++a bar=--b │ │ │ ││ │ ││ ├─ closeTag(a) - │ │ │ ││ │ ││ ╰─ openTagEnd(a) + │ │ │ ││ │ ││ ╰─ openTagEnd │ │ │ ││ │ │╰─ attrValue.value "--b" │ │ │ ││ │ ╰─ attrValue "=--b" │ │ │ ││ ╰─ attrName "bar" @@ -16,5 +16,5 @@ │ │ │ ╰─ attrValue "=++a" │ │ ╰─ attrName "foo" │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName \ No newline at end of file diff --git a/src/__tests__/fixtures/attr-inconsistent-commas/__snapshots__/attr-inconsistent-commas.expected.txt b/src/__tests__/fixtures/attr-inconsistent-commas/__snapshots__/attr-inconsistent-commas.expected.txt index c5c0b931..333c3b3b 100644 --- a/src/__tests__/fixtures/attr-inconsistent-commas/__snapshots__/attr-inconsistent-commas.expected.txt +++ b/src/__tests__/fixtures/attr-inconsistent-commas/__snapshots__/attr-inconsistent-commas.expected.txt @@ -1,7 +1,7 @@ 1╭─ │ │ │││ │││ │││ ││ ╰─ closeTag(test).value "test" │ │ │││ │││ │││ │╰─ closeTag(test) "" - │ │ │││ │││ │││ ╰─ openTagEnd(test) + │ │ │││ │││ │││ ╰─ openTagEnd │ │ │││ │││ ││╰─ attrValue.value "789" │ │ │││ │││ │╰─ attrValue "=789" │ │ │││ │││ ╰─ attrName diff --git a/src/__tests__/fixtures/attr-int-and-id/__snapshots__/attr-int-and-id.expected.txt b/src/__tests__/fixtures/attr-int-and-id/__snapshots__/attr-int-and-id.expected.txt index b352780c..f3d241d1 100644 --- a/src/__tests__/fixtures/attr-int-and-id/__snapshots__/attr-int-and-id.expected.txt +++ b/src/__tests__/fixtures/attr-int-and-id/__snapshots__/attr-int-and-id.expected.txt @@ -1,7 +1,7 @@ 1╭─ │ │ │ ││ │ ││ ││ ╰─ closeTag(a).value │ │ │ ││ │ ││ │╰─ closeTag(a) "" - │ │ │ ││ │ ││ ╰─ openTagEnd(a) + │ │ │ ││ │ ││ ╰─ openTagEnd │ │ │ ││ │ │╰─ attrValue.value "abc" │ │ │ ││ │ ╰─ attrValue "=abc" │ │ │ ││ ╰─ attrName "data" diff --git a/src/__tests__/fixtures/attr-literal-false/__snapshots__/attr-literal-false.expected.txt b/src/__tests__/fixtures/attr-literal-false/__snapshots__/attr-literal-false.expected.txt index c4f55512..6a423b4d 100644 --- a/src/__tests__/fixtures/attr-literal-false/__snapshots__/attr-literal-false.expected.txt +++ b/src/__tests__/fixtures/attr-literal-false/__snapshots__/attr-literal-false.expected.txt @@ -1,7 +1,7 @@ 1╭─
│ │ │ ││ ││ ╰─ closeTag(div).value "div" │ │ │ ││ │╰─ closeTag(div) "
" - │ │ │ ││ ╰─ openTagEnd(div) + │ │ │ ││ ╰─ openTagEnd │ │ │ │╰─ attrValue.value "false" │ │ │ ╰─ attrValue "=false" │ │ ╰─ attrName "data" diff --git a/src/__tests__/fixtures/attr-literal-null/__snapshots__/attr-literal-null.expected.txt b/src/__tests__/fixtures/attr-literal-null/__snapshots__/attr-literal-null.expected.txt index 10ed32e0..604c9b33 100644 --- a/src/__tests__/fixtures/attr-literal-null/__snapshots__/attr-literal-null.expected.txt +++ b/src/__tests__/fixtures/attr-literal-null/__snapshots__/attr-literal-null.expected.txt @@ -1,7 +1,7 @@ 1╭─
│ │ │ ││ ││ ╰─ closeTag(div).value "div" │ │ │ ││ │╰─ closeTag(div) "" - │ │ │ ││ ╰─ openTagEnd(div) + │ │ │ ││ ╰─ openTagEnd │ │ │ │╰─ attrValue.value "null" │ │ │ ╰─ attrValue "=null" │ │ ╰─ attrName "data" diff --git a/src/__tests__/fixtures/attr-literal-numbers/__snapshots__/attr-literal-numbers.expected.txt b/src/__tests__/fixtures/attr-literal-numbers/__snapshots__/attr-literal-numbers.expected.txt index c66cb537..ca2c1820 100644 --- a/src/__tests__/fixtures/attr-literal-numbers/__snapshots__/attr-literal-numbers.expected.txt +++ b/src/__tests__/fixtures/attr-literal-numbers/__snapshots__/attr-literal-numbers.expected.txt @@ -1,7 +1,7 @@ 1╭─
│ │ │ ││ │ ││ │ ││ │ ││ │ ││ │ ││ │ ││ │ ││ │ ││ │ ││ │ ││ │ ││ ││ ╰─ closeTag(div).value "div" │ │ │ ││ │ ││ │ ││ │ ││ │ ││ │ ││ │ ││ │ ││ │ ││ │ ││ │ ││ │ ││ │╰─ closeTag(div) "" - │ │ │ ││ │ ││ │ ││ │ ││ │ ││ │ ││ │ ││ │ ││ │ ││ │ ││ │ ││ │ ││ ╰─ openTagEnd(div) + │ │ │ ││ │ ││ │ ││ │ ││ │ ││ │ ││ │ ││ │ ││ │ ││ │ ││ │ ││ │ ││ ╰─ openTagEnd │ │ │ ││ │ ││ │ ││ │ ││ │ ││ │ ││ │ ││ │ ││ │ ││ │ ││ │ ││ │ │╰─ attrValue.value "-1.5e-10" │ │ │ ││ │ ││ │ ││ │ ││ │ ││ │ ││ │ ││ │ ││ │ ││ │ ││ │ ││ │ ╰─ attrValue "=-1.5e-10" │ │ │ ││ │ ││ │ ││ │ ││ │ ││ │ ││ │ ││ │ ││ │ ││ │ ││ │ ││ ╰─ attrName "data" diff --git a/src/__tests__/fixtures/attr-literal-regex/__snapshots__/attr-literal-regex.expected.txt b/src/__tests__/fixtures/attr-literal-regex/__snapshots__/attr-literal-regex.expected.txt index c4a427b0..f7236709 100644 --- a/src/__tests__/fixtures/attr-literal-regex/__snapshots__/attr-literal-regex.expected.txt +++ b/src/__tests__/fixtures/attr-literal-regex/__snapshots__/attr-literal-regex.expected.txt @@ -1,22 +1,21 @@ 1╭─
- │ │ │ ││ ╰─ openTagEnd(div) "/>" + │ │ │ ││ ╰─ openTagEnd:selfClosed "/>" │ │ │ │╰─ attrValue.value "/foo/" │ │ │ ╰─ attrValue "=/foo/" │ │ ╰─ attrName "data" ╰─ ╰─ tagName "div" 2╭─
- │ ││ │ ││ ││ ╰─ closeTag(div).value "div" - │ ││ │ ││ │╰─ closeTag(div) "
" - │ ││ │ ││ ╰─ openTagEnd(div) - │ ││ │ │╰─ attrValue.value "/foo/" - │ ││ │ ╰─ attrValue "=/foo/" - │ ││ ╰─ attrName "data" - │ │╰─ tagName "div" - ╰─ ╰─ closeTag(div) + │ │ │ ││ ││ ╰─ closeTag(div).value "div" + │ │ │ ││ │╰─ closeTag(div) "" + │ │ │ ││ ╰─ openTagEnd + │ │ │ │╰─ attrValue.value "/foo/" + │ │ │ ╰─ attrValue "=/foo/" + │ │ ╰─ attrName "data" + ╰─ ╰─ tagName "div" 3╭─
│ │ │ ││ ││ ╰─ closeTag(div).value "div" │ │ │ ││ │╰─ closeTag(div) "" - │ │ │ ││ ╰─ openTagEnd(div) + │ │ │ ││ ╰─ openTagEnd │ │ │ │╰─ attrValue.value "/flag/i" │ │ │ ╰─ attrValue "=/flag/i" │ │ ╰─ attrName "data" @@ -24,7 +23,7 @@ 4╭─
│ │ │ ││ ││ ╰─ closeTag(div).value "div" │ │ │ ││ │╰─ closeTag(div) "" - │ │ │ ││ ╰─ openTagEnd(div) + │ │ │ ││ ╰─ openTagEnd │ │ │ │╰─ attrValue.value "/with space/" │ │ │ ╰─ attrValue "=/with space/" │ │ ╰─ attrName "data" diff --git a/src/__tests__/fixtures/attr-literal-string-double-quotes/__snapshots__/attr-literal-string-double-quotes.expected.txt b/src/__tests__/fixtures/attr-literal-string-double-quotes/__snapshots__/attr-literal-string-double-quotes.expected.txt index 3422c95f..dfea5f01 100644 --- a/src/__tests__/fixtures/attr-literal-string-double-quotes/__snapshots__/attr-literal-string-double-quotes.expected.txt +++ b/src/__tests__/fixtures/attr-literal-string-double-quotes/__snapshots__/attr-literal-string-double-quotes.expected.txt @@ -1,7 +1,7 @@ 1╭─
│ │ │ ││ ││ ╰─ closeTag(div).value "div" │ │ │ ││ │╰─ closeTag(div) "" - │ │ │ ││ ╰─ openTagEnd(div) + │ │ │ ││ ╰─ openTagEnd │ │ │ │╰─ attrValue.value "\"simple\"" │ │ │ ╰─ attrValue "=\"simple\"" │ │ ╰─ attrName "class" diff --git a/src/__tests__/fixtures/attr-literal-string-single-quotes/__snapshots__/attr-literal-string-single-quotes.expected.txt b/src/__tests__/fixtures/attr-literal-string-single-quotes/__snapshots__/attr-literal-string-single-quotes.expected.txt index 10723b03..a47e9c02 100644 --- a/src/__tests__/fixtures/attr-literal-string-single-quotes/__snapshots__/attr-literal-string-single-quotes.expected.txt +++ b/src/__tests__/fixtures/attr-literal-string-single-quotes/__snapshots__/attr-literal-string-single-quotes.expected.txt @@ -1,7 +1,7 @@ 1╭─
│ │ │ ││ ││ ╰─ closeTag(div).value "div" │ │ │ ││ │╰─ closeTag(div) "" - │ │ │ ││ ╰─ openTagEnd(div) + │ │ │ ││ ╰─ openTagEnd │ │ │ │╰─ attrValue.value "'simple'" │ │ │ ╰─ attrValue "='simple'" │ │ ╰─ attrName "class" diff --git a/src/__tests__/fixtures/attr-literal-true/__snapshots__/attr-literal-true.expected.txt b/src/__tests__/fixtures/attr-literal-true/__snapshots__/attr-literal-true.expected.txt index a2b43cb7..ce8954c8 100644 --- a/src/__tests__/fixtures/attr-literal-true/__snapshots__/attr-literal-true.expected.txt +++ b/src/__tests__/fixtures/attr-literal-true/__snapshots__/attr-literal-true.expected.txt @@ -1,7 +1,7 @@ 1╭─
│ │ │ ││ ││ ╰─ closeTag(div).value "div" │ │ │ ││ │╰─ closeTag(div) "" - │ │ │ ││ ╰─ openTagEnd(div) + │ │ │ ││ ╰─ openTagEnd │ │ │ │╰─ attrValue.value "true" │ │ │ ╰─ attrValue "=true" │ │ ╰─ attrName "data" diff --git a/src/__tests__/fixtures/attr-literal-undefined/__snapshots__/attr-literal-undefined.expected.txt b/src/__tests__/fixtures/attr-literal-undefined/__snapshots__/attr-literal-undefined.expected.txt index becb65e3..22ac7444 100644 --- a/src/__tests__/fixtures/attr-literal-undefined/__snapshots__/attr-literal-undefined.expected.txt +++ b/src/__tests__/fixtures/attr-literal-undefined/__snapshots__/attr-literal-undefined.expected.txt @@ -1,7 +1,7 @@ 1╭─
│ │ │ ││ ││ ╰─ closeTag(div).value "div" │ │ │ ││ │╰─ closeTag(div) "" - │ │ │ ││ ╰─ openTagEnd(div) + │ │ │ ││ ╰─ openTagEnd │ │ │ │╰─ attrValue.value "undefined" │ │ │ ╰─ attrValue "=undefined" │ │ ╰─ attrName "data" diff --git a/src/__tests__/fixtures/attr-method-shorthand/__snapshots__/attr-method-shorthand.expected.txt b/src/__tests__/fixtures/attr-method-shorthand/__snapshots__/attr-method-shorthand.expected.txt index e49719c0..d17cc6e9 100644 --- a/src/__tests__/fixtures/attr-method-shorthand/__snapshots__/attr-method-shorthand.expected.txt +++ b/src/__tests__/fixtures/attr-method-shorthand/__snapshots__/attr-method-shorthand.expected.txt @@ -9,9 +9,8 @@ 2├─ console.log("hello"); 3├─ event.preventDefault(); 4╭─ }/> - ╰─ ╰─ openTagEnd(foo) "/>" -5╭─ - ╰─ ╰─ closeTag(foo) + ╰─ ╰─ openTagEnd:selfClosed "/>" +5├─ 6╭─ - ╰─ ╰─ openTagEnd(foo) "/>" -10╭─ - ╰─ ╰─ closeTag(foo) + ╰─ ╰─ openTagEnd:selfClosed "/>" +10├─ 11╭─ - ╰─ ╰─ openTagEnd(foo) "/>" -15╭─ - ╰─ ╰─ closeTag(foo) + ╰─ ╰─ openTagEnd:selfClosed "/>" +15├─ 16╭─ - ╰─ ╰─ openTagEnd(foo) "/>" -20╭─ - ╰─ ╰─ closeTag(foo) + ╰─ ╰─ openTagEnd:selfClosed "/>" +20├─ 21╭─ foo onclick(event) { │ │ │ ││ │╰─ attrMethod.body.value " \n console.log(\"hello\"); \n event.preventDefault();\n" │ │ │ ││ ╰─ attrMethod.body "{ \n console.log(\"hello\"); \n event.preventDefault();\n}" @@ -66,7 +62,7 @@ 23├─ event.preventDefault(); 24├─ } 25╭─ - ╰─ ╰─ openTagEnd(foo) + ╰─ ╰─ openTagEnd 26╭─ foo onclick (event) { │ │ │ ││ │╰─ attrMethod.body.value " \n console.log(\"hello\"); \n event.preventDefault();\n" │ │ │ ││ ╰─ attrMethod.body "{ \n console.log(\"hello\"); \n event.preventDefault();\n}" @@ -80,7 +76,7 @@ 28├─ event.preventDefault(); 29├─ } 30╭─ - ╰─ ╰─ openTagEnd(foo) + ╰─ ╰─ openTagEnd 31╭─ foo(event) { │ │ ││ │╰─ attrMethod.body.value " \n console.log(\"hello\"); \n event.preventDefault();\n" │ │ ││ ╰─ attrMethod.body "{ \n console.log(\"hello\"); \n event.preventDefault();\n}" @@ -94,7 +90,7 @@ 33├─ event.preventDefault(); 34├─ } 35╭─ - ╰─ ╰─ openTagEnd(foo) + ╰─ ╰─ openTagEnd 36╭─ foo (event) { │ │ ││ │╰─ attrMethod.body.value " \n console.log(\"hello\"); \n event.preventDefault();\n" │ │ ││ ╰─ attrMethod.body "{ \n console.log(\"hello\"); \n event.preventDefault();\n}" @@ -108,4 +104,4 @@ 38├─ event.preventDefault(); 39╭─ } │ ├─ closeTag(foo) - ╰─ ╰─ openTagEnd(foo) \ No newline at end of file + ╰─ ╰─ openTagEnd \ No newline at end of file diff --git a/src/__tests__/fixtures/attr-multi-line-comment/__snapshots__/attr-multi-line-comment.expected.txt b/src/__tests__/fixtures/attr-multi-line-comment/__snapshots__/attr-multi-line-comment.expected.txt index 0f69783f..5ef1f59a 100644 --- a/src/__tests__/fixtures/attr-multi-line-comment/__snapshots__/attr-multi-line-comment.expected.txt +++ b/src/__tests__/fixtures/attr-multi-line-comment/__snapshots__/attr-multi-line-comment.expected.txt @@ -2,7 +2,7 @@ │ │ │││ │││ ││ │ ╰─ closeTag(a).value │ │ │││ │││ ││ ╰─ closeTag(a) "" │ │ │││ │││ │╰─ text "test" - │ │ │││ │││ ╰─ openTagEnd(a) + │ │ │││ │││ ╰─ openTagEnd │ │ │││ ││╰─ attrValue.value "a+'123'" │ │ │││ │╰─ attrValue "=a+'123'" │ │ │││ ╰─ attrName diff --git a/src/__tests__/fixtures/attr-multi-line-string/__snapshots__/attr-multi-line-string.expected.txt b/src/__tests__/fixtures/attr-multi-line-string/__snapshots__/attr-multi-line-string.expected.txt index 70b5a67f..30ec1361 100644 --- a/src/__tests__/fixtures/attr-multi-line-string/__snapshots__/attr-multi-line-string.expected.txt +++ b/src/__tests__/fixtures/attr-multi-line-string/__snapshots__/attr-multi-line-string.expected.txt @@ -7,4 +7,4 @@ 3╭─ 124"> │ ││ ╰─ closeTag(div).value "div" │ │╰─ closeTag(div) "" - ╰─ ╰─ openTagEnd(div) \ No newline at end of file + ╰─ ╰─ openTagEnd \ No newline at end of file diff --git a/src/__tests__/fixtures/attr-nested-literal-regex/__snapshots__/attr-nested-literal-regex.expected.txt b/src/__tests__/fixtures/attr-nested-literal-regex/__snapshots__/attr-nested-literal-regex.expected.txt index f897bcbe..63ede155 100644 --- a/src/__tests__/fixtures/attr-nested-literal-regex/__snapshots__/attr-nested-literal-regex.expected.txt +++ b/src/__tests__/fixtures/attr-nested-literal-regex/__snapshots__/attr-nested-literal-regex.expected.txt @@ -1,6 +1,5 @@ 1╭─
- │ │ │ ││ │ ╰─ closeTag(div) - │ │ │ ││ ╰─ openTagEnd(div) "/>" + │ │ │ ││ ╰─ openTagEnd:selfClosed "/>" │ │ │ │╰─ attrValue.value "({ a: /[}]/ })" │ │ │ ╰─ attrValue "=({ a: /[}]/ })" │ │ ╰─ attrName "hello" diff --git a/src/__tests__/fixtures/attr-no-value-self-closed/__snapshots__/attr-no-value-self-closed.expected.txt b/src/__tests__/fixtures/attr-no-value-self-closed/__snapshots__/attr-no-value-self-closed.expected.txt index 789afb0e..3eddbc24 100644 --- a/src/__tests__/fixtures/attr-no-value-self-closed/__snapshots__/attr-no-value-self-closed.expected.txt +++ b/src/__tests__/fixtures/attr-no-value-self-closed/__snapshots__/attr-no-value-self-closed.expected.txt @@ -1,5 +1,4 @@ 1╭─ - │ │ │ │ ╰─ closeTag(var) - │ │ │ ╰─ openTagEnd(var) "/>" + │ │ │ ╰─ openTagEnd:selfClosed "/>" │ │ ╰─ attrName "foo" ╰─ ╰─ tagName "var" \ No newline at end of file diff --git a/src/__tests__/fixtures/attr-no-value/__snapshots__/attr-no-value.expected.txt b/src/__tests__/fixtures/attr-no-value/__snapshots__/attr-no-value.expected.txt index 1e8eccd0..ba770cd6 100644 --- a/src/__tests__/fixtures/attr-no-value/__snapshots__/attr-no-value.expected.txt +++ b/src/__tests__/fixtures/attr-no-value/__snapshots__/attr-no-value.expected.txt @@ -2,6 +2,6 @@ │ │ │││ │ ╰─ closeTag(a).value │ │ │││ ╰─ closeTag(a) "" │ │ ││╰─ text "test" - │ │ │╰─ openTagEnd(a) + │ │ │╰─ openTagEnd │ │ ╰─ attrName ╰─ ╰─ tagName \ No newline at end of file diff --git a/src/__tests__/fixtures/attr-non-literal/__snapshots__/attr-non-literal.expected.txt b/src/__tests__/fixtures/attr-non-literal/__snapshots__/attr-non-literal.expected.txt index ae45c5fd..a7c1830e 100644 --- a/src/__tests__/fixtures/attr-non-literal/__snapshots__/attr-non-literal.expected.txt +++ b/src/__tests__/fixtures/attr-non-literal/__snapshots__/attr-non-literal.expected.txt @@ -1,7 +1,7 @@ 1╭─
│ │ │ ││ │││ │││ │ ││ ││ ╰─ closeTag(div).value "div" │ │ │ ││ │││ │││ │ ││ │╰─ closeTag(div) "
" - │ │ │ ││ │││ │││ │ ││ ╰─ openTagEnd(div) + │ │ │ ││ │││ │││ │ ││ ╰─ openTagEnd │ │ │ ││ │││ │││ │ │╰─ attrValue.value "`foo`" │ │ │ ││ │││ │││ │ ╰─ attrValue "=`foo`" │ │ │ ││ │││ │││ ╰─ attrName "template-string" @@ -17,7 +17,7 @@ ╰─ ╰─ tagName "div" 2╭─ span test='123'"abc" │ │ │ ││ ├─ closeTag(span) - │ │ │ ││ ╰─ openTagEnd(span) + │ │ │ ││ ╰─ openTagEnd │ │ │ │╰─ attrValue.value "'123'\"abc\"" │ │ │ ╰─ attrValue "='123'\"abc\"" │ │ ╰─ attrName "test" diff --git a/src/__tests__/fixtures/attr-object-expressions/__snapshots__/attr-object-expressions.expected.txt b/src/__tests__/fixtures/attr-object-expressions/__snapshots__/attr-object-expressions.expected.txt index bcbb07a7..4aba1afd 100644 --- a/src/__tests__/fixtures/attr-object-expressions/__snapshots__/attr-object-expressions.expected.txt +++ b/src/__tests__/fixtures/attr-object-expressions/__snapshots__/attr-object-expressions.expected.txt @@ -7,4 +7,4 @@ 3╭─ }> │ ││ ╰─ closeTag(a).value │ │╰─ closeTag(a) "" - ╰─ ╰─ openTagEnd(a) \ No newline at end of file + ╰─ ╰─ openTagEnd \ No newline at end of file diff --git a/src/__tests__/fixtures/attr-operators-newline-after/__snapshots__/attr-operators-newline-after.expected.txt b/src/__tests__/fixtures/attr-operators-newline-after/__snapshots__/attr-operators-newline-after.expected.txt index 7b508719..1396b21e 100644 --- a/src/__tests__/fixtures/attr-operators-newline-after/__snapshots__/attr-operators-newline-after.expected.txt +++ b/src/__tests__/fixtures/attr-operators-newline-after/__snapshots__/attr-operators-newline-after.expected.txt @@ -9,7 +9,7 @@ │ │├─ attrValue "=x*\ny" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 4├─ y 5╭─ a=x** @@ -17,7 +17,7 @@ │ │├─ attrValue "=x**\ny" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 6├─ y 7╭─ a=x% @@ -25,7 +25,7 @@ │ │├─ attrValue "=x%\ny" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 8├─ y 9╭─ a=x& @@ -33,7 +33,7 @@ │ │├─ attrValue "=x&\ny" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 10├─ y 11╭─ a=x&& @@ -41,7 +41,7 @@ │ │├─ attrValue "=x&&\ny" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 12├─ y 13╭─ a=x^ @@ -49,7 +49,7 @@ │ │├─ attrValue "=x^\ny" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 14├─ y 15╭─ a=x~ @@ -57,7 +57,7 @@ │ │├─ attrValue "=x~\ny" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 16├─ y 17╭─ a=x| @@ -65,7 +65,7 @@ │ │├─ attrValue "=x|\ny" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 18├─ y 19╭─ a=x|| @@ -73,7 +73,7 @@ │ │├─ attrValue "=x||\ny" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 20├─ y 21╭─ a=x?? @@ -81,7 +81,7 @@ │ │├─ attrValue "=x??\ny" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 22├─ y 23╭─ a=x? @@ -89,7 +89,7 @@ │ │├─ attrValue "=x?\ny:\nz" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 24├─ y: 25├─ z @@ -98,7 +98,7 @@ │ │├─ attrValue "=x==\ny" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 27├─ y 28╭─ a=x=== @@ -106,7 +106,7 @@ │ │├─ attrValue "=x===\ny" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 29├─ y 30╭─ a=x!= @@ -114,7 +114,7 @@ │ │├─ attrValue "=x!=\ny" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 31├─ y 32╭─ a=x!== @@ -122,7 +122,7 @@ │ │├─ attrValue "=x!==\ny" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 33├─ y 34╭─ a=x<= @@ -130,7 +130,7 @@ │ │├─ attrValue "=x<=\ny" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 35├─ y 36╭─ a=x>= @@ -138,7 +138,7 @@ │ │├─ attrValue "=x>=\ny" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 37├─ y 38╭─ a=x&= @@ -146,7 +146,7 @@ │ │├─ attrValue "=x&=\ny" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 39├─ y 40╭─ a=x&&= @@ -154,7 +154,7 @@ │ │├─ attrValue "=x&&=\ny" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 41├─ y 42╭─ a=x|= @@ -162,7 +162,7 @@ │ │├─ attrValue "=x|=\ny" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 43├─ y 44╭─ a=x||= @@ -170,7 +170,7 @@ │ │├─ attrValue "=x||=\ny" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 45├─ y 46╭─ a=x^= @@ -178,7 +178,7 @@ │ │├─ attrValue "=x^=\ny" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 47├─ y 48╭─ a=x~= @@ -186,7 +186,7 @@ │ │├─ attrValue "=x~=\ny" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 49├─ y 50╭─ a=x>>= @@ -194,7 +194,7 @@ │ │├─ attrValue "=x>>=\ny" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 51├─ y 52╭─ a=x>>>= @@ -202,7 +202,7 @@ │ │├─ attrValue "=x>>>=\ny" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 53├─ y 54╭─ a=x-= @@ -210,7 +210,7 @@ │ │├─ attrValue "=x-=\ny" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 55├─ y 56╭─ a=x/= @@ -218,7 +218,7 @@ │ │├─ attrValue "=x/=\ny" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 57├─ y 58╭─ a=x*= @@ -226,7 +226,7 @@ │ │├─ attrValue "=x*=\ny" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 59├─ y 60╭─ a=x**= @@ -234,7 +234,7 @@ │ │├─ attrValue "=x**=\ny" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 61├─ y 62╭─ a=x%= @@ -242,7 +242,7 @@ │ │├─ attrValue "=x%=\ny" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 63├─ y 64╭─ a=x+= @@ -250,7 +250,7 @@ │ │├─ attrValue "=x+=\ny" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 65├─ y 66╭─ a=x. @@ -258,7 +258,7 @@ │ │├─ attrValue "=x.\ny" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 67├─ y 68╭─ a=x++ @@ -266,7 +266,7 @@ │ │├─ attrValue "=x++\n+y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 69├─ +y 70╭─ a=x+ @@ -274,7 +274,7 @@ │ │├─ attrValue "=x+\n++y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 71├─ ++y 72╭─ a=x> @@ -282,7 +282,7 @@ │ │├─ attrValue "=x>\ny" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 73├─ y 74╭─ a=x>> @@ -290,7 +290,7 @@ │ │├─ attrValue "=x>>\ny" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 75├─ y 76╭─ a=x>>> @@ -298,7 +298,7 @@ │ │├─ attrValue "=x>>>\ny" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 77├─ y 78╭─ a=x @@ -306,7 +306,7 @@ │ │├─ attrValue "=x\n(y)" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 79├─ (y) 80╭─ a=x @@ -314,7 +314,7 @@ │ │├─ attrValue "=x\n{y}" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 81├─ {y} 82╭─ - ╰─ ╰─ openTagEnd(a) "/>" + ╰─ ╰─ openTagEnd:selfClosed "/>" 84╭─ a=x │ ││╰─ attrValue.value "x\n=>\ny" │ │├─ attrValue "=x\n=>\ny" │ │╰─ attrName - │ ├─ closeTag(a) ╰─ ╰─ tagName 85├─ => 86╭─ y z @@ -340,7 +339,7 @@ │ │├─ attrValue "=x=>\n(y)" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 88╭─ (y) z ╰─ ╰─ attrName @@ -349,7 +348,7 @@ │ │├─ attrValue "=x=>\n{y}" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 90╭─ {y} z ╰─ ╰─ attrName @@ -358,9 +357,9 @@ │ │├─ attrValue "=(x)\n{y}" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 92╭─ {y} z │ │├─ closeTag(a) - │ │╰─ openTagEnd(a) + │ │╰─ openTagEnd ╰─ ╰─ attrName \ No newline at end of file diff --git a/src/__tests__/fixtures/attr-operators-newline-before/__snapshots__/attr-operators-newline-before.expected.txt b/src/__tests__/fixtures/attr-operators-newline-before/__snapshots__/attr-operators-newline-before.expected.txt index 97e40d45..fc043b65 100644 --- a/src/__tests__/fixtures/attr-operators-newline-before/__snapshots__/attr-operators-newline-before.expected.txt +++ b/src/__tests__/fixtures/attr-operators-newline-before/__snapshots__/attr-operators-newline-before.expected.txt @@ -9,7 +9,7 @@ │ │├─ attrValue "=x\n*y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 4├─ *y 5╭─ a=x @@ -17,7 +17,7 @@ │ │├─ attrValue "=x\n**y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 6├─ **y 7╭─ a=x @@ -25,7 +25,7 @@ │ │├─ attrValue "=x\n%y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 8├─ %y 9╭─ a=x @@ -33,7 +33,7 @@ │ │├─ attrValue "=x\n&y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 10├─ &y 11╭─ a=x @@ -41,7 +41,7 @@ │ │├─ attrValue "=x\n&&y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 12├─ &&y 13╭─ a=x @@ -49,7 +49,7 @@ │ │├─ attrValue "=x\n^y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 14├─ ^y 15╭─ a=x @@ -57,7 +57,7 @@ │ │├─ attrValue "=x\n~y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 16├─ ~y 17╭─ a=x @@ -65,7 +65,7 @@ │ │├─ attrValue "=x\n|y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 18├─ |y 19╭─ a=x @@ -73,7 +73,7 @@ │ │├─ attrValue "=x\n||y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 20├─ ||y 21╭─ a=x @@ -81,7 +81,7 @@ │ │├─ attrValue "=x\n??y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 22├─ ??y 23╭─ a=x @@ -89,7 +89,7 @@ │ │├─ attrValue "=x\n?y\n:z" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 24├─ ?y 25├─ :z @@ -98,7 +98,7 @@ │ │├─ attrValue "=x\n==y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 27├─ ==y 28╭─ a=x @@ -106,7 +106,7 @@ │ │├─ attrValue "=x\n===y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 29├─ ===y 30╭─ a=x @@ -114,7 +114,7 @@ │ │├─ attrValue "=x\n!=y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 31├─ !=y 32╭─ a=x @@ -122,7 +122,7 @@ │ │├─ attrValue "=x\n!==y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 33├─ !==y 34╭─ a=x @@ -130,7 +130,7 @@ │ │├─ attrValue "=x\n>=y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 35├─ >=y 36╭─ a=x @@ -138,7 +138,7 @@ │ │├─ attrValue "=x\n&=y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 37├─ &=y 38╭─ a=x @@ -146,7 +146,7 @@ │ │├─ attrValue "=x\n&&=y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 39├─ &&=y 40╭─ a=x @@ -154,7 +154,7 @@ │ │├─ attrValue "=x\n|=y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 41├─ |=y 42╭─ a=x @@ -162,7 +162,7 @@ │ │├─ attrValue "=x\n||=y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 43├─ ||=y 44╭─ a=x @@ -170,7 +170,7 @@ │ │├─ attrValue "=x\n^=y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 45├─ ^=y 46╭─ a=x @@ -178,7 +178,7 @@ │ │├─ attrValue "=x\n~=y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 47├─ ~=y 48╭─ a=x @@ -186,7 +186,7 @@ │ │├─ attrValue "=x\n>>=y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 49├─ >>=y 50╭─ a=x @@ -194,7 +194,7 @@ │ │├─ attrValue "=x\n>>>=y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 51├─ >>>=y 52╭─ a=x @@ -202,7 +202,7 @@ │ │├─ attrValue "=x\n/=y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 53├─ /=y 54╭─ a=x @@ -210,7 +210,7 @@ │ │├─ attrValue "=x\n*=y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 55├─ *=y 56╭─ a=x @@ -218,7 +218,7 @@ │ │├─ attrValue "=x\n**=y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 57├─ **=y 58╭─ a=x @@ -226,7 +226,7 @@ │ │├─ attrValue "=x\n%=y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 59├─ %=y 60╭─ a=x @@ -234,7 +234,7 @@ │ │├─ attrValue "=x\n+=y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 61├─ +=y 62╭─ - ╰─ ╰─ openTagEnd(a) "/>" + ╰─ ╰─ openTagEnd:selfClosed "/>" 64╭─ a=x │ ││╰─ attrValue.value "x\n+y" │ │├─ attrValue "=x\n+y" │ │╰─ attrName - │ ├─ closeTag(a) ╰─ ╰─ tagName 65├─ +y 66╭─ a=x @@ -258,7 +257,7 @@ │ │├─ attrValue "=x\n>y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 67├─ >y 68╭─ a=x @@ -266,7 +265,7 @@ │ │├─ attrValue "=x\n>>y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 69├─ >>y 70╭─ a=x @@ -274,7 +273,7 @@ │ │├─ attrValue "=x\n>>>y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 71├─ >>>y 72╭─ y │ │││ ╰─ closeTag(a).value │ ││╰─ closeTag(a) "" │ │╰─ text - ╰─ ╰─ openTagEnd(a) + ╰─ ╰─ openTagEnd 74╭─ >y" │ │├─ attrValue "=x\n>>y" │ │╰─ attrName ╰─ ╰─ tagName 75╭─ >>y/> - ╰─ ╰─ openTagEnd(a) "/>" + ╰─ ╰─ openTagEnd:selfClosed "/>" 76╭─ >>y" - │ ││├─ attrValue "=x\n>>>y" - │ ││╰─ attrName - │ │╰─ tagName - ╰─ ╰─ closeTag(a) + │ ││╰─ attrValue.value "x\n>>>y" + │ │├─ attrValue "=x\n>>>y" + │ │╰─ attrName + ╰─ ╰─ tagName 77╭─ >>>y/> - ╰─ ╰─ openTagEnd(a) "/>" + ╰─ ╰─ openTagEnd:selfClosed "/>" 78╭─ a=x │ ││╰─ attrValue.value "x\n=>y" │ │├─ attrValue "=x\n=>y" │ │╰─ attrName - │ ├─ closeTag(a) ╰─ ╰─ tagName 79╭─ =>y z ╰─ ╰─ attrName @@ -317,7 +314,7 @@ │ │├─ attrValue "=x\n=>\n(y)" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 81├─ => 82╭─ (y) z @@ -327,7 +324,7 @@ │ │├─ attrValue "=x\n=>\n{y}" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 84├─ => 85╭─ {y} z @@ -337,9 +334,9 @@ │ │├─ attrValue "=(x)\n{y}" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 87╭─ {y} z │ │├─ closeTag(a) - │ │╰─ openTagEnd(a) + │ │╰─ openTagEnd ╰─ ╰─ attrName \ No newline at end of file diff --git a/src/__tests__/fixtures/attr-operators-space-after/__snapshots__/attr-operators-space-after.expected.txt b/src/__tests__/fixtures/attr-operators-space-after/__snapshots__/attr-operators-space-after.expected.txt index 3172f8ae..9fee7fdc 100644 --- a/src/__tests__/fixtures/attr-operators-space-after/__snapshots__/attr-operators-space-after.expected.txt +++ b/src/__tests__/fixtures/attr-operators-space-after/__snapshots__/attr-operators-space-after.expected.txt @@ -8,288 +8,287 @@ │ │├─ attrValue "=x* y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 3╭─ a=x** y │ ││╰─ attrValue.value "x** y" │ │├─ attrValue "=x** y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 4╭─ a=x% y │ ││╰─ attrValue.value "x% y" │ │├─ attrValue "=x% y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 5╭─ a=x& y │ ││╰─ attrValue.value "x& y" │ │├─ attrValue "=x& y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 6╭─ a=x&& y │ ││╰─ attrValue.value "x&& y" │ │├─ attrValue "=x&& y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 7╭─ a=x^ y │ ││╰─ attrValue.value "x^ y" │ │├─ attrValue "=x^ y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 8╭─ a=x~ y │ ││╰─ attrValue.value "x~ y" │ │├─ attrValue "=x~ y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 9╭─ a=x| y │ ││╰─ attrValue.value "x| y" │ │├─ attrValue "=x| y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 10╭─ a=x|| y │ ││╰─ attrValue.value "x|| y" │ │├─ attrValue "=x|| y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 11╭─ a=x?? y │ ││╰─ attrValue.value "x?? y" │ │├─ attrValue "=x?? y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 12╭─ a=x? y : z │ ││╰─ attrValue.value "x? y : z" │ │├─ attrValue "=x? y : z" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 13╭─ a=x== y │ ││╰─ attrValue.value "x== y" │ │├─ attrValue "=x== y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 14╭─ a=x=== y │ ││╰─ attrValue.value "x=== y" │ │├─ attrValue "=x=== y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 15╭─ a=x!= y │ ││╰─ attrValue.value "x!= y" │ │├─ attrValue "=x!= y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 16╭─ a=x!== y │ ││╰─ attrValue.value "x!== y" │ │├─ attrValue "=x!== y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 17╭─ a=x<= y │ ││╰─ attrValue.value "x<= y" │ │├─ attrValue "=x<= y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 18╭─ a=x>= y │ ││╰─ attrValue.value "x>= y" │ │├─ attrValue "=x>= y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 19╭─ a=x&= y │ ││╰─ attrValue.value "x&= y" │ │├─ attrValue "=x&= y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 20╭─ a=x&&= y │ ││╰─ attrValue.value "x&&= y" │ │├─ attrValue "=x&&= y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 21╭─ a=x|= y │ ││╰─ attrValue.value "x|= y" │ │├─ attrValue "=x|= y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 22╭─ a=x||= y │ ││╰─ attrValue.value "x||= y" │ │├─ attrValue "=x||= y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 23╭─ a=x^= y │ ││╰─ attrValue.value "x^= y" │ │├─ attrValue "=x^= y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 24╭─ a=x~= y │ ││╰─ attrValue.value "x~= y" │ │├─ attrValue "=x~= y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 25╭─ a=x>>= y │ ││╰─ attrValue.value "x>>= y" │ │├─ attrValue "=x>>= y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 26╭─ a=x>>>= y │ ││╰─ attrValue.value "x>>>= y" │ │├─ attrValue "=x>>>= y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 27╭─ a=x-= y │ ││╰─ attrValue.value "x-= y" │ │├─ attrValue "=x-= y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 28╭─ a=x/= y │ ││╰─ attrValue.value "x/= y" │ │├─ attrValue "=x/= y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 29╭─ a=x*= y │ ││╰─ attrValue.value "x*= y" │ │├─ attrValue "=x*= y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 30╭─ a=x**= y │ ││╰─ attrValue.value "x**= y" │ │├─ attrValue "=x**= y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 31╭─ a=x%= y │ ││╰─ attrValue.value "x%= y" │ │├─ attrValue "=x%= y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 32╭─ a=x+= y │ ││╰─ attrValue.value "x+= y" │ │├─ attrValue "=x+= y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 33╭─ a=x. y │ ││╰─ attrValue.value "x. y" │ │├─ attrValue "=x. y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 34╭─ a=x++ +y │ ││╰─ attrValue.value "x++ +y" │ │├─ attrValue "=x++ +y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 35╭─ a=x+ ++y │ ││╰─ attrValue.value "x+ ++y" │ │├─ attrValue "=x+ ++y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 36╭─ a=x> y │ ││╰─ attrValue.value "x> y" │ │├─ attrValue "=x> y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 37╭─ a=x>> y │ ││╰─ attrValue.value "x>> y" │ │├─ attrValue "=x>> y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 38╭─ a=x>>> y │ ││╰─ attrValue.value "x>>> y" │ │├─ attrValue "=x>>> y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 39╭─ a=x( y ) │ ││╰─ attrValue.value "x( y )" │ │├─ attrValue "=x( y )" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 40╭─ a=z { y } │ ││╰─ attrValue.value "z { y }" │ │├─ attrValue "=z { y }" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 41╭─ - │ ││││ ╰─ openTagEnd(a) "/>" + │ ││││ ╰─ openTagEnd:selfClosed "/>" │ │││╰─ attrValue.value "x[ y ]" │ ││├─ attrValue "=x[ y ]" │ ││╰─ attrName │ │╰─ tagName │ ├─ closeTag(a) - ╰─ ╰─ openTagEnd(a) + ╰─ ╰─ openTagEnd 42╭─ a=x=> y z │ │││ ╰─ attrName │ ││╰─ attrValue.value "x=> y" │ │├─ attrValue "=x=> y" │ │╰─ attrName - │ ├─ closeTag(a) ╰─ ╰─ tagName 43╭─ a=x=> ( y ) z │ │││ ╰─ attrName @@ -297,7 +296,7 @@ │ │├─ attrValue "=x=> ( y )" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 44╭─ a=x=> { y } z │ │││ ╰─ attrName @@ -305,15 +304,15 @@ │ │├─ attrValue "=x=> { y }" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 45╭─ a=( x ){ y } z │ │││ │├─ closeTag(a) - │ │││ │╰─ openTagEnd(a) + │ │││ │╰─ openTagEnd │ │││ ╰─ attrName │ ││╰─ attrValue.value "( x ){ y }" │ │├─ attrValue "=( x ){ y }" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName \ No newline at end of file diff --git a/src/__tests__/fixtures/attr-operators-space-before/__snapshots__/attr-operators-space-before.expected.txt b/src/__tests__/fixtures/attr-operators-space-before/__snapshots__/attr-operators-space-before.expected.txt index efeae118..278e0aa3 100644 --- a/src/__tests__/fixtures/attr-operators-space-before/__snapshots__/attr-operators-space-before.expected.txt +++ b/src/__tests__/fixtures/attr-operators-space-before/__snapshots__/attr-operators-space-before.expected.txt @@ -8,290 +8,287 @@ │ │├─ attrValue "=x *y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 3╭─ a=x **y │ ││╰─ attrValue.value "x **y" │ │├─ attrValue "=x **y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 4╭─ a=x %y │ ││╰─ attrValue.value "x %y" │ │├─ attrValue "=x %y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 5╭─ a=x &y │ ││╰─ attrValue.value "x &y" │ │├─ attrValue "=x &y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 6╭─ a=x &&y │ ││╰─ attrValue.value "x &&y" │ │├─ attrValue "=x &&y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 7╭─ a=x ^y │ ││╰─ attrValue.value "x ^y" │ │├─ attrValue "=x ^y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 8╭─ a=x ~y │ ││╰─ attrValue.value "x ~y" │ │├─ attrValue "=x ~y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 9╭─ a=x |y │ ││╰─ attrValue.value "x |y" │ │├─ attrValue "=x |y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 10╭─ a=x ||y │ ││╰─ attrValue.value "x ||y" │ │├─ attrValue "=x ||y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 11╭─ a=x ??y │ ││╰─ attrValue.value "x ??y" │ │├─ attrValue "=x ??y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 12╭─ a=x ?y :z │ ││╰─ attrValue.value "x ?y :z" │ │├─ attrValue "=x ?y :z" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 13╭─ a=x ==y │ ││╰─ attrValue.value "x ==y" │ │├─ attrValue "=x ==y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 14╭─ a=x ===y │ ││╰─ attrValue.value "x ===y" │ │├─ attrValue "=x ===y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 15╭─ a=x !=y │ ││╰─ attrValue.value "x !=y" │ │├─ attrValue "=x !=y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 16╭─ a=x !==y │ ││╰─ attrValue.value "x !==y" │ │├─ attrValue "=x !==y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 17╭─ a=x <=y │ ││╰─ attrValue.value "x <=y" │ │├─ attrValue "=x <=y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 18╭─ a=x >=y │ ││╰─ attrValue.value "x >=y" │ │├─ attrValue "=x >=y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 19╭─ a=x &=y │ ││╰─ attrValue.value "x &=y" │ │├─ attrValue "=x &=y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 20╭─ a=x &&=y │ ││╰─ attrValue.value "x &&=y" │ │├─ attrValue "=x &&=y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 21╭─ a=x |=y │ ││╰─ attrValue.value "x |=y" │ │├─ attrValue "=x |=y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 22╭─ a=x ||=y │ ││╰─ attrValue.value "x ||=y" │ │├─ attrValue "=x ||=y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 23╭─ a=x ^=y │ ││╰─ attrValue.value "x ^=y" │ │├─ attrValue "=x ^=y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 24╭─ a=x ~=y │ ││╰─ attrValue.value "x ~=y" │ │├─ attrValue "=x ~=y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 25╭─ a=x >>=y │ ││╰─ attrValue.value "x >>=y" │ │├─ attrValue "=x >>=y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 26╭─ a=x >>>=y │ ││╰─ attrValue.value "x >>>=y" │ │├─ attrValue "=x >>>=y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 27╭─ a=x -=y │ ││╰─ attrValue.value "x -=y" │ │├─ attrValue "=x -=y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 28╭─ a=x /=y │ ││╰─ attrValue.value "x /=y" │ │├─ attrValue "=x /=y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 29╭─ a=x *=y │ ││╰─ attrValue.value "x *=y" │ │├─ attrValue "=x *=y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 30╭─ a=x **=y │ ││╰─ attrValue.value "x **=y" │ │├─ attrValue "=x **=y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 31╭─ a=x %=y │ ││╰─ attrValue.value "x %=y" │ │├─ attrValue "=x %=y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 32╭─ a=x +=y │ ││╰─ attrValue.value "x +=y" │ │├─ attrValue "=x +=y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 33╭─ a=x .y │ ││╰─ attrValue.value "x .y" │ │├─ attrValue "=x .y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 34╭─ a=x +y │ ││╰─ attrValue.value "x +y" │ │├─ attrValue "=x +y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 35╭─ - │ ││││ ╰─ openTagEnd(a) "/>" + │ ││││ ╰─ openTagEnd:selfClosed "/>" │ │││╰─ attrValue.value "x -y" │ ││├─ attrValue "=x -y" │ ││╰─ attrName │ │╰─ tagName │ ├─ closeTag(a) - ╰─ ╰─ openTagEnd(a) + ╰─ ╰─ openTagEnd 36╭─ a=x >y │ ││╰─ attrValue.value "x >y" │ │├─ attrValue "=x >y" │ │╰─ attrName - │ ├─ closeTag(a) ╰─ ╰─ tagName 37╭─ a=x >>y │ ││╰─ attrValue.value "x >>y" │ │├─ attrValue "=x >>y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 38╭─ a=x >>>y │ ││╰─ attrValue.value "x >>>y" │ │├─ attrValue "=x >>>y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 39╭─ y │ ││││ │││ ╰─ closeTag(a).value │ ││││ ││╰─ closeTag(a) "" │ ││││ │╰─ text - │ ││││ ╰─ openTagEnd(a) + │ ││││ ╰─ openTagEnd │ │││╰─ attrValue.value │ ││├─ attrValue "=x" │ ││╰─ attrName │ │╰─ tagName │ ├─ closeTag(a) - ╰─ ╰─ openTagEnd(a) + ╰─ ╰─ openTagEnd 40╭─ >y/> - │ │││ ╰─ openTagEnd(a) "/>" + │ │││ ╰─ openTagEnd:selfClosed "/>" │ ││╰─ attrValue.value "x >>y" │ │├─ attrValue "=x >>y" │ │╰─ attrName ╰─ ╰─ tagName 41╭─ >>y/> - │ ││││ ╰─ openTagEnd(a) "/>" - │ │││╰─ attrValue.value "x >>>y" - │ ││├─ attrValue "=x >>>y" - │ ││╰─ attrName - │ │╰─ tagName - ╰─ ╰─ closeTag(a) + │ │││ ╰─ openTagEnd:selfClosed "/>" + │ ││╰─ attrValue.value "x >>>y" + │ │├─ attrValue "=x >>>y" + │ │╰─ attrName + ╰─ ╰─ tagName 42╭─ a=x =>y z │ │││ ╰─ attrName │ ││╰─ attrValue.value "x =>y" │ │├─ attrValue "=x =>y" │ │╰─ attrName - │ ├─ closeTag(a) ╰─ ╰─ tagName 43╭─ a=x => (y ) z │ │││ ╰─ attrName @@ -299,7 +296,7 @@ │ │├─ attrValue "=x => (y )" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 44╭─ a=x => {y } z │ │││ ╰─ attrName @@ -307,15 +304,15 @@ │ │├─ attrValue "=x => {y }" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 45╭─ a=( x ) {y } z │ │││ │├─ closeTag(a) - │ │││ │╰─ openTagEnd(a) + │ │││ │╰─ openTagEnd │ │││ ╰─ attrName │ ││╰─ attrValue.value "( x ) {y }" │ │├─ attrValue "=( x ) {y }" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName \ No newline at end of file diff --git a/src/__tests__/fixtures/attr-operators-space-between/__snapshots__/attr-operators-space-between.expected.txt b/src/__tests__/fixtures/attr-operators-space-between/__snapshots__/attr-operators-space-between.expected.txt index 89f6eccb..7c4da6cd 100644 --- a/src/__tests__/fixtures/attr-operators-space-between/__snapshots__/attr-operators-space-between.expected.txt +++ b/src/__tests__/fixtures/attr-operators-space-between/__snapshots__/attr-operators-space-between.expected.txt @@ -8,224 +8,224 @@ │ │├─ attrValue "=x * y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 3╭─ a=x ** y │ ││╰─ attrValue.value "x ** y" │ │├─ attrValue "=x ** y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 4╭─ a=x % y │ ││╰─ attrValue.value "x % y" │ │├─ attrValue "=x % y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 5╭─ a=x & y │ ││╰─ attrValue.value "x & y" │ │├─ attrValue "=x & y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 6╭─ a=x && y │ ││╰─ attrValue.value "x && y" │ │├─ attrValue "=x && y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 7╭─ a=x ^ y │ ││╰─ attrValue.value "x ^ y" │ │├─ attrValue "=x ^ y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 8╭─ a=x ~ y │ ││╰─ attrValue.value "x ~ y" │ │├─ attrValue "=x ~ y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 9╭─ a=x | y │ ││╰─ attrValue.value "x | y" │ │├─ attrValue "=x | y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 10╭─ a=x || y │ ││╰─ attrValue.value "x || y" │ │├─ attrValue "=x || y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 11╭─ a=x ?? y │ ││╰─ attrValue.value "x ?? y" │ │├─ attrValue "=x ?? y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 12╭─ a=x ? y : z │ ││╰─ attrValue.value "x ? y : z" │ │├─ attrValue "=x ? y : z" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 13╭─ a=x == y │ ││╰─ attrValue.value "x == y" │ │├─ attrValue "=x == y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 14╭─ a=x === y │ ││╰─ attrValue.value "x === y" │ │├─ attrValue "=x === y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 15╭─ a=x != y │ ││╰─ attrValue.value "x != y" │ │├─ attrValue "=x != y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 16╭─ a=x !== y │ ││╰─ attrValue.value "x !== y" │ │├─ attrValue "=x !== y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 17╭─ a=x <= y │ ││╰─ attrValue.value "x <= y" │ │├─ attrValue "=x <= y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 18╭─ a=x >= y │ ││╰─ attrValue.value "x >= y" │ │├─ attrValue "=x >= y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 19╭─ a=x &= y │ ││╰─ attrValue.value "x &= y" │ │├─ attrValue "=x &= y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 20╭─ a=x &&= y │ ││╰─ attrValue.value "x &&= y" │ │├─ attrValue "=x &&= y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 21╭─ a=x |= y │ ││╰─ attrValue.value "x |= y" │ │├─ attrValue "=x |= y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 22╭─ a=x ||= y │ ││╰─ attrValue.value "x ||= y" │ │├─ attrValue "=x ||= y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 23╭─ a=x ^= y │ ││╰─ attrValue.value "x ^= y" │ │├─ attrValue "=x ^= y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 24╭─ a=x ~= y │ ││╰─ attrValue.value "x ~= y" │ │├─ attrValue "=x ~= y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 25╭─ a=x >>= y │ ││╰─ attrValue.value "x >>= y" │ │├─ attrValue "=x >>= y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 26╭─ a=x >>>= y │ ││╰─ attrValue.value "x >>>= y" │ │├─ attrValue "=x >>>= y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 27╭─ a=x -= y │ ││╰─ attrValue.value "x -= y" │ │├─ attrValue "=x -= y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 28╭─ a=x /= y │ ││╰─ attrValue.value "x /= y" │ │├─ attrValue "=x /= y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 29╭─ a=x *= y │ ││╰─ attrValue.value "x *= y" │ │├─ attrValue "=x *= y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 30╭─ a=x **= y │ ││╰─ attrValue.value "x **= y" │ │├─ attrValue "=x **= y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 31╭─ a=x %= y │ ││╰─ attrValue.value "x %= y" │ │├─ attrValue "=x %= y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 32╭─ a=x += y │ ││╰─ attrValue.value "x += y" │ │├─ attrValue "=x += y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 33╭─ a=x . y │ ││╰─ attrValue.value "x . y" │ │├─ attrValue "=x . y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 34╭─ a=x in; │ │││ ╰─ attrName "in" @@ -233,14 +233,14 @@ │ │├─ attrValue "=x" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 35╭─ a=x in y │ ││╰─ attrValue.value "x in y" │ │├─ attrValue "=x in y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 36╭─ a=x in=y │ │││ │ │╰─ attrValue.value @@ -250,7 +250,7 @@ │ │├─ attrValue "=x" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 37╭─ a=x in, y │ │││ │ ╰─ attrName @@ -259,115 +259,110 @@ │ │├─ attrValue "=x" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 38╭─ a=x instanceof y │ ││╰─ attrValue.value "x instanceof y" │ │├─ attrValue "=x instanceof y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 39╭─ a=x++ +y │ ││╰─ attrValue.value "x++ +y" │ │├─ attrValue "=x++ +y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 40╭─ a=x+ ++y │ ││╰─ attrValue.value "x+ ++y" │ │├─ attrValue "=x+ ++y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 41╭─ - │ ││││ ╰─ openTagEnd(a) "/>" + │ ││││ ╰─ openTagEnd:selfClosed "/>" │ │││╰─ attrValue.value "x-- -y" │ ││├─ attrValue "=x-- -y" │ ││╰─ attrName │ │╰─ tagName │ ├─ closeTag(a) - ╰─ ╰─ openTagEnd(a) + ╰─ ╰─ openTagEnd 42╭─ - │ ││││ ╰─ openTagEnd(a) "/>" - │ │││╰─ attrValue.value "x- --y" - │ ││├─ attrValue "=x- --y" - │ ││╰─ attrName - │ │╰─ tagName - ╰─ ╰─ closeTag(a) + │ │││ ╰─ openTagEnd:selfClosed "/>" + │ ││╰─ attrValue.value "x- --y" + │ │├─ attrValue "=x- --y" + │ │╰─ attrName + ╰─ ╰─ tagName 43╭─ a=x > y │ ││╰─ attrValue.value "x > y" │ │├─ attrValue "=x > y" │ │╰─ attrName - │ ├─ closeTag(a) ╰─ ╰─ tagName 44╭─ a=x >> y │ ││╰─ attrValue.value "x >> y" │ │├─ attrValue "=x >> y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 45╭─ a=x >>> y │ ││╰─ attrValue.value "x >>> y" │ │├─ attrValue "=x >>> y" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 46╭─ y │ ││││ ││ │ ╰─ closeTag(a).value │ ││││ ││ ╰─ closeTag(a) "" │ ││││ │╰─ text " y" - │ ││││ ╰─ openTagEnd(a) + │ ││││ ╰─ openTagEnd │ │││╰─ attrValue.value │ ││├─ attrValue "=x" │ ││╰─ attrName │ │╰─ tagName │ ├─ closeTag(a) - ╰─ ╰─ openTagEnd(a) + ╰─ ╰─ openTagEnd 47╭─ > y/> - │ │││ ╰─ openTagEnd(a) "/>" + │ │││ ╰─ openTagEnd:selfClosed "/>" │ ││╰─ attrValue.value "x >> y" │ │├─ attrValue "=x >> y" │ │╰─ attrName ╰─ ╰─ tagName 48╭─ >> y/> - │ ││││ ╰─ openTagEnd(a) "/>" - │ │││╰─ attrValue.value "x >>> y" - │ ││├─ attrValue "=x >>> y" - │ ││╰─ attrName - │ │╰─ tagName - ╰─ ╰─ closeTag(a) + │ │││ ╰─ openTagEnd:selfClosed "/>" + │ ││╰─ attrValue.value "x >>> y" + │ │├─ attrValue "=x >>> y" + │ │╰─ attrName + ╰─ ╰─ tagName 49╭─ a=x ( y ) │ ││╰─ attrValue.value "x ( y )" │ │├─ attrValue "=x ( y )" │ │╰─ attrName - │ ├─ closeTag(a) ╰─ ╰─ tagName 50╭─ a=z { y } │ ││╰─ attrValue.value "z { y }" │ │├─ attrValue "=z { y }" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 51╭─ - │ ││││ ╰─ openTagEnd(a) "/>" + │ ││││ ╰─ openTagEnd:selfClosed "/>" │ │││╰─ attrValue.value "x [ y ]" │ ││├─ attrValue "=x [ y ]" │ ││╰─ attrName │ │╰─ tagName │ ├─ closeTag(a) - ╰─ ╰─ openTagEnd(a) + ╰─ ╰─ openTagEnd 52╭─ a=x => y z │ │││ ╰─ attrName │ ││╰─ attrValue.value "x => y" │ │├─ attrValue "=x => y" │ │╰─ attrName - │ ├─ closeTag(a) ╰─ ╰─ tagName 53╭─ a=x => ( y ) z │ │││ ╰─ attrName @@ -375,7 +370,7 @@ │ │├─ attrValue "=x => ( y )" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 54╭─ a=x => { y } z │ │││ ╰─ attrName @@ -383,15 +378,15 @@ │ │├─ attrValue "=x => { y }" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName 55╭─ a=( x ) { y } z │ │││ │├─ closeTag(a) - │ │││ │╰─ openTagEnd(a) + │ │││ │╰─ openTagEnd │ │││ ╰─ attrName │ ││╰─ attrValue.value "( x ) { y }" │ │├─ attrValue "=( x ) { y }" │ │╰─ attrName │ ├─ closeTag(a) - │ ├─ openTagEnd(a) + │ ├─ openTagEnd ╰─ ╰─ tagName \ No newline at end of file diff --git a/src/__tests__/fixtures/attr-simple-expression/__snapshots__/attr-simple-expression.expected.txt b/src/__tests__/fixtures/attr-simple-expression/__snapshots__/attr-simple-expression.expected.txt index 8c291705..a055464f 100644 --- a/src/__tests__/fixtures/attr-simple-expression/__snapshots__/attr-simple-expression.expected.txt +++ b/src/__tests__/fixtures/attr-simple-expression/__snapshots__/attr-simple-expression.expected.txt @@ -2,7 +2,7 @@ │ │ │││ ││ │ ╰─ closeTag(a).value │ │ │││ ││ ╰─ closeTag(a) "" │ │ │││ │╰─ text "test" - │ │ │││ ╰─ openTagEnd(a) + │ │ │││ ╰─ openTagEnd │ │ ││╰─ attrValue.value "1/2" │ │ │╰─ attrValue "=1/2" │ │ ╰─ attrName diff --git a/src/__tests__/fixtures/attr-spread/__snapshots__/attr-spread.expected.txt b/src/__tests__/fixtures/attr-spread/__snapshots__/attr-spread.expected.txt index fbf72e85..466ea088 100644 --- a/src/__tests__/fixtures/attr-spread/__snapshots__/attr-spread.expected.txt +++ b/src/__tests__/fixtures/attr-spread/__snapshots__/attr-spread.expected.txt @@ -1,44 +1,39 @@ 1╭─ - │ │ │ │╰─ openTagEnd(span) "/>" + │ │ │ │╰─ openTagEnd:selfClosed "/>" │ │ │ ╰─ attrSpread.value │ │ ╰─ attrSpread "...a" ╰─ ╰─ tagName "span" 2╭─ - │ ││ │ │ │╰─ openTagEnd(span) "/>" - │ ││ │ │ ╰─ attrSpread.value - │ ││ │ ╰─ attrSpread "...b" - │ ││ ╰─ attrName - │ │╰─ tagName "span" - ╰─ ╰─ closeTag(span) + │ │ │ │ │╰─ openTagEnd:selfClosed "/>" + │ │ │ │ ╰─ attrSpread.value + │ │ │ ╰─ attrSpread "...b" + │ │ ╰─ attrName + ╰─ ╰─ tagName "span" 3╭─ - │ ││ │ │ │ │ │╰─ openTagEnd(span) "/>" - │ ││ │ │ │ │ ╰─ attrSpread.value - │ ││ │ │ │ ╰─ attrSpread "...c" - │ ││ │ │ ╰─ attrSpread.value - │ ││ │ ╰─ attrSpread "...b" - │ ││ ╰─ attrName - │ │╰─ tagName "span" - ╰─ ╰─ closeTag(span) + │ │ │ │ │ │ │╰─ openTagEnd:selfClosed "/>" + │ │ │ │ │ │ ╰─ attrSpread.value + │ │ │ │ │ ╰─ attrSpread "...c" + │ │ │ │ ╰─ attrSpread.value + │ │ │ ╰─ attrSpread "...b" + │ │ ╰─ attrName + ╰─ ╰─ tagName "span" 4╭─ - │ ││ │ │ │ │ │ │╰─ openTagEnd(span) "/>" - │ ││ │ │ │ │ │ ╰─ attrSpread.value - │ ││ │ │ │ │ ╰─ attrSpread "...d" - │ ││ │ │ │ ╰─ attrName - │ ││ │ │ ╰─ attrSpread.value - │ ││ │ ╰─ attrSpread "...b" - │ ││ ╰─ attrName - │ │╰─ tagName "span" - ╰─ ╰─ closeTag(span) + │ │ │ │ │ │ │ │╰─ openTagEnd:selfClosed "/>" + │ │ │ │ │ │ │ ╰─ attrSpread.value + │ │ │ │ │ │ ╰─ attrSpread "...d" + │ │ │ │ │ ╰─ attrName + │ │ │ │ ╰─ attrSpread.value + │ │ │ ╰─ attrSpread "...b" + │ │ ╰─ attrName + ╰─ ╰─ tagName "span" 5╭─ - │ ││ │ │ │ │ │ │ │╰─ openTagEnd(span) "/>" - │ ││ │ │ │ │ │ │ ╰─ attrName - │ ││ │ │ │ │ │ ╰─ attrSpread.value - │ ││ │ │ │ │ ╰─ attrSpread "...d" - │ ││ │ │ │ ╰─ attrName - │ ││ │ │ ╰─ attrSpread.value - │ ││ │ ╰─ attrSpread "...b" - │ ││ ╰─ attrName - │ │╰─ tagName "span" - ╰─ ╰─ closeTag(span) -6╭─ - ╰─ ╰─ closeTag(span) \ No newline at end of file + │ │ │ │ │ │ │ │ │╰─ openTagEnd:selfClosed "/>" + │ │ │ │ │ │ │ │ ╰─ attrName + │ │ │ │ │ │ │ ╰─ attrSpread.value + │ │ │ │ │ │ ╰─ attrSpread "...d" + │ │ │ │ │ ╰─ attrName + │ │ │ │ ╰─ attrSpread.value + │ │ │ ╰─ attrSpread "...b" + │ │ ╰─ attrName + ╰─ ╰─ tagName "span" +6╰─ \ No newline at end of file diff --git a/src/__tests__/fixtures/attr-unenclosed-whitespace-minus/__snapshots__/attr-unenclosed-whitespace-minus.expected.txt b/src/__tests__/fixtures/attr-unenclosed-whitespace-minus/__snapshots__/attr-unenclosed-whitespace-minus.expected.txt index a4f1b67a..3689d45c 100644 --- a/src/__tests__/fixtures/attr-unenclosed-whitespace-minus/__snapshots__/attr-unenclosed-whitespace-minus.expected.txt +++ b/src/__tests__/fixtures/attr-unenclosed-whitespace-minus/__snapshots__/attr-unenclosed-whitespace-minus.expected.txt @@ -1,6 +1,6 @@ 1╭─ var foo = 5 - data │ │ │ │ │ ├─ closeTag(var) - │ │ │ │ │ ╰─ openTagEnd(var) + │ │ │ │ │ ╰─ openTagEnd │ │ │ │ ╰─ attrValue.value "5 - data" │ │ │ ╰─ attrValue "= 5 - data" │ │ ╰─ attrName "foo" diff --git a/src/__tests__/fixtures/attr-unenclosed-whitespace-multiple-attrs/__snapshots__/attr-unenclosed-whitespace-multiple-attrs.expected.txt b/src/__tests__/fixtures/attr-unenclosed-whitespace-multiple-attrs/__snapshots__/attr-unenclosed-whitespace-multiple-attrs.expected.txt index 49929ef6..c071adfe 100644 --- a/src/__tests__/fixtures/attr-unenclosed-whitespace-multiple-attrs/__snapshots__/attr-unenclosed-whitespace-multiple-attrs.expected.txt +++ b/src/__tests__/fixtures/attr-unenclosed-whitespace-multiple-attrs/__snapshots__/attr-unenclosed-whitespace-multiple-attrs.expected.txt @@ -1,7 +1,7 @@ 1╭─ │ │ │ │ │ │ │ │ ││ ╰─ closeTag(test).value "test" │ │ │ │ │ │ │ │ │╰─ closeTag(test) "" - │ │ │ │ │ │ │ │ ╰─ openTagEnd(test) + │ │ │ │ │ │ │ │ ╰─ openTagEnd │ │ │ │ │ │ │ ╰─ attrValue.value "789" │ │ │ │ │ │ ╰─ attrValue "= 789" │ │ │ │ │ ╰─ attrName @@ -12,7 +12,7 @@ 2╭─ │ │ │ │ │ │ │ │ ││ ╰─ closeTag(test).value "test" │ │ │ │ │ │ │ │ │╰─ closeTag(test) "" - │ │ │ │ │ │ │ │ ╰─ openTagEnd(test) + │ │ │ │ │ │ │ │ ╰─ openTagEnd │ │ │ │ │ │ │ ╰─ attrValue.value "456 + 789" │ │ │ │ │ │ ╰─ attrValue "= 456 + 789" │ │ │ │ │ ╰─ attrName diff --git a/src/__tests__/fixtures/attr-unenclosed-whitespace-odd/__snapshots__/attr-unenclosed-whitespace-odd.expected.txt b/src/__tests__/fixtures/attr-unenclosed-whitespace-odd/__snapshots__/attr-unenclosed-whitespace-odd.expected.txt index eb1704d2..1e63809d 100644 --- a/src/__tests__/fixtures/attr-unenclosed-whitespace-odd/__snapshots__/attr-unenclosed-whitespace-odd.expected.txt +++ b/src/__tests__/fixtures/attr-unenclosed-whitespace-odd/__snapshots__/attr-unenclosed-whitespace-odd.expected.txt @@ -1,7 +1,7 @@ 1╭─
│ │ │ │ │ │ │ │ ││ ╰─ closeTag(div).value "div" │ │ │ │ │ │ │ │ │╰─ closeTag(div) "" - │ │ │ │ │ │ │ │ ╰─ openTagEnd(div) + │ │ │ │ │ │ │ │ ╰─ openTagEnd │ │ │ │ │ │ │ ╰─ attrValue.value "x /y" │ │ │ │ │ │ ╰─ attrValue "= x /y" │ │ │ │ │ ╰─ attrName "bar" diff --git a/src/__tests__/fixtures/attr-unenclosed-whitespace/__snapshots__/attr-unenclosed-whitespace.expected.txt b/src/__tests__/fixtures/attr-unenclosed-whitespace/__snapshots__/attr-unenclosed-whitespace.expected.txt index ba80388d..0625b273 100644 --- a/src/__tests__/fixtures/attr-unenclosed-whitespace/__snapshots__/attr-unenclosed-whitespace.expected.txt +++ b/src/__tests__/fixtures/attr-unenclosed-whitespace/__snapshots__/attr-unenclosed-whitespace.expected.txt @@ -1,7 +1,7 @@ 1╭─
│ │ │ │ │ │ │ │ ││ ╰─ closeTag(div).value "div" │ │ │ │ │ │ │ │ │╰─ closeTag(div) "" - │ │ │ │ │ │ │ │ ╰─ openTagEnd(div) + │ │ │ │ │ │ │ │ ╰─ openTagEnd │ │ │ │ │ │ │ ╰─ attrValue.value "x / y" │ │ │ │ │ │ ╰─ attrValue "= x / y" │ │ │ │ │ ╰─ attrName "bar" diff --git a/src/__tests__/fixtures/attr-value-self-closed/__snapshots__/attr-value-self-closed.expected.txt b/src/__tests__/fixtures/attr-value-self-closed/__snapshots__/attr-value-self-closed.expected.txt index af35c911..e50d4420 100644 --- a/src/__tests__/fixtures/attr-value-self-closed/__snapshots__/attr-value-self-closed.expected.txt +++ b/src/__tests__/fixtures/attr-value-self-closed/__snapshots__/attr-value-self-closed.expected.txt @@ -1,6 +1,5 @@ 1╭─ - │ │ │ ││ │ ╰─ closeTag(var) - │ │ │ ││ ╰─ openTagEnd(var) "/>" + │ │ │ ││ ╰─ openTagEnd:selfClosed "/>" │ │ │ │╰─ attrValue.value "'bar'" │ │ │ ╰─ attrValue "='bar'" │ │ ╰─ attrName "foo" diff --git a/src/__tests__/fixtures/attr-value-single-quote-escaped/__snapshots__/attr-value-single-quote-escaped.expected.txt b/src/__tests__/fixtures/attr-value-single-quote-escaped/__snapshots__/attr-value-single-quote-escaped.expected.txt index 84a98452..8918ee9a 100644 --- a/src/__tests__/fixtures/attr-value-single-quote-escaped/__snapshots__/attr-value-single-quote-escaped.expected.txt +++ b/src/__tests__/fixtures/attr-value-single-quote-escaped/__snapshots__/attr-value-single-quote-escaped.expected.txt @@ -1,6 +1,6 @@ 1╭─ var decade = '1960\'s' │ │ │ │ │ ├─ closeTag(var) - │ │ │ │ │ ╰─ openTagEnd(var) + │ │ │ │ │ ╰─ openTagEnd │ │ │ │ ╰─ attrValue.value "'1960\\'s'" │ │ │ ╰─ attrValue "= '1960\\'s'" │ │ ╰─ attrName "decade" diff --git a/src/__tests__/fixtures/attr-value-string-concat/__snapshots__/attr-value-string-concat.expected.txt b/src/__tests__/fixtures/attr-value-string-concat/__snapshots__/attr-value-string-concat.expected.txt index ff5f3b03..64afd8da 100644 --- a/src/__tests__/fixtures/attr-value-string-concat/__snapshots__/attr-value-string-concat.expected.txt +++ b/src/__tests__/fixtures/attr-value-string-concat/__snapshots__/attr-value-string-concat.expected.txt @@ -1,7 +1,7 @@ 1╭─
│ │ │ ││ ││ ╰─ closeTag(div).value "div" │ │ │ ││ │╰─ closeTag(div) "" - │ │ │ ││ ╰─ openTagEnd(div) + │ │ │ ││ ╰─ openTagEnd │ │ │ │╰─ attrValue.value "'a'+bar" │ │ │ ╰─ attrValue "='a'+bar" │ │ ╰─ attrName "foo" diff --git a/src/__tests__/fixtures/attr-value-typeof-comma/__snapshots__/attr-value-typeof-comma.expected.txt b/src/__tests__/fixtures/attr-value-typeof-comma/__snapshots__/attr-value-typeof-comma.expected.txt index 835d8adb..647b9004 100644 --- a/src/__tests__/fixtures/attr-value-typeof-comma/__snapshots__/attr-value-typeof-comma.expected.txt +++ b/src/__tests__/fixtures/attr-value-typeof-comma/__snapshots__/attr-value-typeof-comma.expected.txt @@ -7,5 +7,5 @@ │ │ ╰─ attrName "foo" ╰─ ╰─ tagName "var" 2╭─ - │ ├─ openTagEnd(var) + │ ├─ openTagEnd ╰─ ╰─ closeTag(var) \ No newline at end of file diff --git a/src/__tests__/fixtures/attr-value-typeof-no-space-prefix/__snapshots__/attr-value-typeof-no-space-prefix.expected.txt b/src/__tests__/fixtures/attr-value-typeof-no-space-prefix/__snapshots__/attr-value-typeof-no-space-prefix.expected.txt index 27040fc9..831d3a5b 100644 --- a/src/__tests__/fixtures/attr-value-typeof-no-space-prefix/__snapshots__/attr-value-typeof-no-space-prefix.expected.txt +++ b/src/__tests__/fixtures/attr-value-typeof-no-space-prefix/__snapshots__/attr-value-typeof-no-space-prefix.expected.txt @@ -4,5 +4,5 @@ │ │ ╰─ attrName "isString" ╰─ ╰─ tagName "var" 2╭─ - │ ├─ openTagEnd(var) + │ ├─ openTagEnd ╰─ ╰─ closeTag(var) \ No newline at end of file diff --git a/src/__tests__/fixtures/attr-value-typeof/__snapshots__/attr-value-typeof.expected.txt b/src/__tests__/fixtures/attr-value-typeof/__snapshots__/attr-value-typeof.expected.txt index ea1919a8..cfe3eff2 100644 --- a/src/__tests__/fixtures/attr-value-typeof/__snapshots__/attr-value-typeof.expected.txt +++ b/src/__tests__/fixtures/attr-value-typeof/__snapshots__/attr-value-typeof.expected.txt @@ -1,6 +1,6 @@ 1╭─ var test = typeof 'foo' === 'string' │ │ │ │ │ ├─ closeTag(var) - │ │ │ │ │ ╰─ openTagEnd(var) + │ │ │ │ │ ╰─ openTagEnd │ │ │ │ ╰─ attrValue.value "typeof 'foo' === 'string'" │ │ │ ╰─ attrValue "= typeof 'foo' === 'string'" │ │ ╰─ attrName "test" diff --git a/src/__tests__/fixtures/attr-value-void/__snapshots__/attr-value-void.expected.txt b/src/__tests__/fixtures/attr-value-void/__snapshots__/attr-value-void.expected.txt index d8126c5a..391d7455 100644 --- a/src/__tests__/fixtures/attr-value-void/__snapshots__/attr-value-void.expected.txt +++ b/src/__tests__/fixtures/attr-value-void/__snapshots__/attr-value-void.expected.txt @@ -4,5 +4,5 @@ │ │ ╰─ attrName "foo" ╰─ ╰─ tagName "var" 2╭─ - │ ├─ openTagEnd(var) + │ ├─ openTagEnd ╰─ ╰─ closeTag(var) \ No newline at end of file diff --git a/src/__tests__/fixtures/attr-with-parens-and-double-quoted-strings/__snapshots__/attr-with-parens-and-double-quoted-strings.expected.txt b/src/__tests__/fixtures/attr-with-parens-and-double-quoted-strings/__snapshots__/attr-with-parens-and-double-quoted-strings.expected.txt index e665c9c4..4098f091 100644 --- a/src/__tests__/fixtures/attr-with-parens-and-double-quoted-strings/__snapshots__/attr-with-parens-and-double-quoted-strings.expected.txt +++ b/src/__tests__/fixtures/attr-with-parens-and-double-quoted-strings/__snapshots__/attr-with-parens-and-double-quoted-strings.expected.txt @@ -1,7 +1,7 @@ 1╭─ │ │ │ ││ ││ ╰─ closeTag(a).value │ │ │ ││ │╰─ closeTag(a) "" - │ │ │ ││ ╰─ openTagEnd(a) + │ │ │ ││ ╰─ openTagEnd │ │ │ │╰─ attrValue.value "((a-b)/2 + \")\")" │ │ │ ╰─ attrValue "=((a-b)/2 + \")\")" │ │ ╰─ attrName "data" diff --git a/src/__tests__/fixtures/attr-with-parens-and-single-quoted-strings/__snapshots__/attr-with-parens-and-single-quoted-strings.expected.txt b/src/__tests__/fixtures/attr-with-parens-and-single-quoted-strings/__snapshots__/attr-with-parens-and-single-quoted-strings.expected.txt index 0110cdc4..c5792215 100644 --- a/src/__tests__/fixtures/attr-with-parens-and-single-quoted-strings/__snapshots__/attr-with-parens-and-single-quoted-strings.expected.txt +++ b/src/__tests__/fixtures/attr-with-parens-and-single-quoted-strings/__snapshots__/attr-with-parens-and-single-quoted-strings.expected.txt @@ -1,7 +1,7 @@ 1╭─ │ │ │ ││ ││ ╰─ closeTag(a).value │ │ │ ││ │╰─ closeTag(a) "" - │ │ │ ││ ╰─ openTagEnd(a) + │ │ │ ││ ╰─ openTagEnd │ │ │ │╰─ attrValue.value "((a-b)/2 + ')')" │ │ │ ╰─ attrValue "=((a-b)/2 + ')')" │ │ ╰─ attrName "data" diff --git a/src/__tests__/fixtures/attr-with-right-angle-bracket-parens/__snapshots__/attr-with-right-angle-bracket-parens.expected.txt b/src/__tests__/fixtures/attr-with-right-angle-bracket-parens/__snapshots__/attr-with-right-angle-bracket-parens.expected.txt index e5ca3ace..1841e0c0 100644 --- a/src/__tests__/fixtures/attr-with-right-angle-bracket-parens/__snapshots__/attr-with-right-angle-bracket-parens.expected.txt +++ b/src/__tests__/fixtures/attr-with-right-angle-bracket-parens/__snapshots__/attr-with-right-angle-bracket-parens.expected.txt @@ -2,7 +2,7 @@ │ │ │││ ││ │ ╰─ closeTag(a).value │ │ │││ ││ ╰─ closeTag(a) "" │ │ │││ │╰─ text "test" - │ │ │││ ╰─ openTagEnd(a) + │ │ │││ ╰─ openTagEnd │ │ ││╰─ attrValue.value "(1>2)" │ │ │╰─ attrValue "=(1>2)" │ │ ╰─ attrName diff --git a/src/__tests__/fixtures/attr-with-right-angle-bracket/__snapshots__/attr-with-right-angle-bracket.expected.txt b/src/__tests__/fixtures/attr-with-right-angle-bracket/__snapshots__/attr-with-right-angle-bracket.expected.txt index 538e68b3..ced6b319 100644 --- a/src/__tests__/fixtures/attr-with-right-angle-bracket/__snapshots__/attr-with-right-angle-bracket.expected.txt +++ b/src/__tests__/fixtures/attr-with-right-angle-bracket/__snapshots__/attr-with-right-angle-bracket.expected.txt @@ -2,7 +2,7 @@ │ │ │││││ │ ╰─ closeTag(a).value │ │ │││││ ╰─ closeTag(a) "" │ │ ││││╰─ text "2>test" - │ │ │││╰─ openTagEnd(a) + │ │ │││╰─ openTagEnd │ │ ││╰─ attrValue.value │ │ │╰─ attrValue "=1" │ │ ╰─ attrName diff --git a/src/__tests__/fixtures/attr-without-delimiters/__snapshots__/attr-without-delimiters.expected.txt b/src/__tests__/fixtures/attr-without-delimiters/__snapshots__/attr-without-delimiters.expected.txt index 4386e8e9..aa72d5aa 100644 --- a/src/__tests__/fixtures/attr-without-delimiters/__snapshots__/attr-without-delimiters.expected.txt +++ b/src/__tests__/fixtures/attr-without-delimiters/__snapshots__/attr-without-delimiters.expected.txt @@ -1,7 +1,7 @@ 1╭─ │ │ │ ││ ││ ╰─ closeTag(a).value │ │ │ ││ │╰─ closeTag(a) "" - │ │ │ ││ ╰─ openTagEnd(a) + │ │ │ ││ ╰─ openTagEnd │ │ │ │╰─ attrValue.value "123\"abc\"" │ │ │ ╰─ attrValue "=123\"abc\"" │ │ ╰─ attrName "data" diff --git a/src/__tests__/fixtures/backtick-string-nested-with-space/__snapshots__/backtick-string-nested-with-space.expected.txt b/src/__tests__/fixtures/backtick-string-nested-with-space/__snapshots__/backtick-string-nested-with-space.expected.txt index f72a7faa..3f1b3ad0 100644 --- a/src/__tests__/fixtures/backtick-string-nested-with-space/__snapshots__/backtick-string-nested-with-space.expected.txt +++ b/src/__tests__/fixtures/backtick-string-nested-with-space/__snapshots__/backtick-string-nested-with-space.expected.txt @@ -1,7 +1,7 @@ 1╭─ │ │ │ ││ ││ ╰─ closeTag(hello).value "hello" │ │ │ ││ │╰─ closeTag(hello) "" - │ │ │ ││ ╰─ openTagEnd(hello) + │ │ │ ││ ╰─ openTagEnd │ │ │ │╰─ attrValue.value "`${`hi ${name}`}!`" │ │ │ ╰─ attrValue "=`${`hi ${name}`}!`" │ │ ╰─ attrName "message" diff --git a/src/__tests__/fixtures/backtick-string-placeholder-newline/__snapshots__/backtick-string-placeholder-newline.expected.txt b/src/__tests__/fixtures/backtick-string-placeholder-newline/__snapshots__/backtick-string-placeholder-newline.expected.txt index c9db2360..04e4ff46 100644 --- a/src/__tests__/fixtures/backtick-string-placeholder-newline/__snapshots__/backtick-string-placeholder-newline.expected.txt +++ b/src/__tests__/fixtures/backtick-string-placeholder-newline/__snapshots__/backtick-string-placeholder-newline.expected.txt @@ -7,4 +7,4 @@ 3╭─ }!`> │ ││ ╰─ closeTag(hello).value "hello" │ │╰─ closeTag(hello) "" - ╰─ ╰─ openTagEnd(hello) \ No newline at end of file + ╰─ ╰─ openTagEnd \ No newline at end of file diff --git a/src/__tests__/fixtures/backtick-string/__snapshots__/backtick-string.expected.txt b/src/__tests__/fixtures/backtick-string/__snapshots__/backtick-string.expected.txt index fb7c7c98..f497f900 100644 --- a/src/__tests__/fixtures/backtick-string/__snapshots__/backtick-string.expected.txt +++ b/src/__tests__/fixtures/backtick-string/__snapshots__/backtick-string.expected.txt @@ -6,4 +6,4 @@ 2╭─ ${foo}!`> │ ││ ╰─ closeTag(hello).value "hello" │ │╰─ closeTag(hello) "" - ╰─ ╰─ openTagEnd(hello) \ No newline at end of file + ╰─ ╰─ openTagEnd \ No newline at end of file diff --git a/src/__tests__/fixtures/cdata-2/__snapshots__/cdata-2.expected.txt b/src/__tests__/fixtures/cdata-2/__snapshots__/cdata-2.expected.txt index 07bdf119..25c1e8e7 100644 --- a/src/__tests__/fixtures/cdata-2/__snapshots__/cdata-2.expected.txt +++ b/src/__tests__/fixtures/cdata-2/__snapshots__/cdata-2.expected.txt @@ -1,5 +1,5 @@ 1╭─
- │ │ ╰─ openTagEnd(div) + │ │ ╰─ openTagEnd ╰─ ╰─ tagName "div" 2╭─ BEFORE]]>AFTER │ │ │ │ ╰─ text "AFTER\n" diff --git a/src/__tests__/fixtures/cdata-pos/__snapshots__/cdata-pos.expected.txt b/src/__tests__/fixtures/cdata-pos/__snapshots__/cdata-pos.expected.txt index 99447ef9..f6c4c987 100644 --- a/src/__tests__/fixtures/cdata-pos/__snapshots__/cdata-pos.expected.txt +++ b/src/__tests__/fixtures/cdata-pos/__snapshots__/cdata-pos.expected.txt @@ -1,9 +1,9 @@ 1╭─ test ╰─ ╰─ tagName "test" 2╭─ - │ │ │ ╰─ openTagEnd(foo) + │ │ │ ╰─ openTagEnd │ │ ╰─ tagName "foo" - ╰─ ╰─ openTagEnd(test) + ╰─ ╰─ openTagEnd 3╭─
│ │ │ ╰─ cdata.value "[if lt IE 9]>
" diff --git a/src/__tests__/fixtures/cdata/__snapshots__/cdata.expected.txt b/src/__tests__/fixtures/cdata/__snapshots__/cdata.expected.txt index f9ad383f..5bced100 100644 --- a/src/__tests__/fixtures/cdata/__snapshots__/cdata.expected.txt +++ b/src/__tests__/fixtures/cdata/__snapshots__/cdata.expected.txt @@ -3,5 +3,5 @@ │ │ ││ │ ╰─ closeTag(html-comment) "" │ │ ││ ╰─ cdata.value "[if lt IE 9]>
" - │ │ ╰─ openTagEnd(html-comment) + │ │ ╰─ openTagEnd ╰─ ╰─ tagName "html-comment" \ No newline at end of file diff --git a/src/__tests__/fixtures/comma-ends-attr-operators/__snapshots__/comma-ends-attr-operators.expected.txt b/src/__tests__/fixtures/comma-ends-attr-operators/__snapshots__/comma-ends-attr-operators.expected.txt index e2d9f186..4a5ccf00 100644 --- a/src/__tests__/fixtures/comma-ends-attr-operators/__snapshots__/comma-ends-attr-operators.expected.txt +++ b/src/__tests__/fixtures/comma-ends-attr-operators/__snapshots__/comma-ends-attr-operators.expected.txt @@ -1,7 +1,7 @@ 1╭─
│ │ │ │ │ │ │ │ ││ ╰─ closeTag(div).value "div" │ │ │ │ │ │ │ │ │╰─ closeTag(div) "
" - │ │ │ │ │ │ │ │ ╰─ openTagEnd(div) + │ │ │ │ │ │ │ │ ╰─ openTagEnd │ │ │ │ │ │ │ ╰─ attrValue.value "true" │ │ │ │ │ │ ╰─ attrValue "= true" │ │ │ │ │ ╰─ attrName "+2" diff --git a/src/__tests__/fixtures/commas-relax/__snapshots__/commas-relax.expected.txt b/src/__tests__/fixtures/commas-relax/__snapshots__/commas-relax.expected.txt index b3ecf5e6..16f1c054 100644 --- a/src/__tests__/fixtures/commas-relax/__snapshots__/commas-relax.expected.txt +++ b/src/__tests__/fixtures/commas-relax/__snapshots__/commas-relax.expected.txt @@ -3,9 +3,7 @@ 2├─ hello: true 3├─ }; 4╭─ - ╰─ ╰─ openTagEnd(static) + ╰─ ╰─ openTagEnd 5╭─ import mod, { b as bar } from "./bar" - │ │ ├─ closeTag(import) - │ │ ╰─ openTagEnd(import) - │ ├─ closeTag(static) + │ │ ╰─ openTagEnd ╰─ ╰─ tagName "import" \ No newline at end of file diff --git a/src/__tests__/fixtures/commas-require-all-attrs-first/__snapshots__/commas-require-all-attrs-first.expected.txt b/src/__tests__/fixtures/commas-require-all-attrs-first/__snapshots__/commas-require-all-attrs-first.expected.txt index dfbe24a3..9e28708d 100644 --- a/src/__tests__/fixtures/commas-require-all-attrs-first/__snapshots__/commas-require-all-attrs-first.expected.txt +++ b/src/__tests__/fixtures/commas-require-all-attrs-first/__snapshots__/commas-require-all-attrs-first.expected.txt @@ -1,6 +1,5 @@ 1╭─ - │ │ │││ │││ │││ │ ╰─ closeTag(foo) - │ │ │││ │││ │││ ╰─ openTagEnd(foo) "/>" + │ │ │││ │││ │││ ╰─ openTagEnd:selfClosed "/>" │ │ │││ │││ ││╰─ attrValue.value "\"3\"" │ │ │││ │││ │╰─ attrValue "=\"3\"" │ │ │││ │││ ╰─ attrName diff --git a/src/__tests__/fixtures/commas-require-all-attrs-last/__snapshots__/commas-require-all-attrs-last.expected.txt b/src/__tests__/fixtures/commas-require-all-attrs-last/__snapshots__/commas-require-all-attrs-last.expected.txt index 66e54c9b..cd0f14ef 100644 --- a/src/__tests__/fixtures/commas-require-all-attrs-last/__snapshots__/commas-require-all-attrs-last.expected.txt +++ b/src/__tests__/fixtures/commas-require-all-attrs-last/__snapshots__/commas-require-all-attrs-last.expected.txt @@ -1,6 +1,5 @@ 1╭─ - │ │ │││ │││ │││ │ ╰─ closeTag(foo) - │ │ │││ │││ │││ ╰─ openTagEnd(foo) "/>" + │ │ │││ │││ │││ ╰─ openTagEnd:selfClosed "/>" │ │ │││ │││ ││╰─ attrValue.value "\"3\"" │ │ │││ │││ │╰─ attrValue "=\"3\"" │ │ │││ │││ ╰─ attrName diff --git a/src/__tests__/fixtures/comment-concise-js-block-trailing/__snapshots__/comment-concise-js-block-trailing.expected.txt b/src/__tests__/fixtures/comment-concise-js-block-trailing/__snapshots__/comment-concise-js-block-trailing.expected.txt index 9fd88dae..793983b3 100644 --- a/src/__tests__/fixtures/comment-concise-js-block-trailing/__snapshots__/comment-concise-js-block-trailing.expected.txt +++ b/src/__tests__/fixtures/comment-concise-js-block-trailing/__snapshots__/comment-concise-js-block-trailing.expected.txt @@ -2,7 +2,7 @@ ╰─ ╰─ tagName 2╭─ /* │ │ ╰─ comment "/*\n This is a\n multiline comment\n */" - ╰─ ╰─ openTagEnd(p) + ╰─ ╰─ openTagEnd 3╭─ This is a ╰─ ╰─ comment.value "\n This is a\n multiline comment\n " 4├─ multiline comment diff --git a/src/__tests__/fixtures/comment-concise-js-block/__snapshots__/comment-concise-js-block.expected.txt b/src/__tests__/fixtures/comment-concise-js-block/__snapshots__/comment-concise-js-block.expected.txt index 372b243d..6bc7c9bc 100644 --- a/src/__tests__/fixtures/comment-concise-js-block/__snapshots__/comment-concise-js-block.expected.txt +++ b/src/__tests__/fixtures/comment-concise-js-block/__snapshots__/comment-concise-js-block.expected.txt @@ -2,7 +2,7 @@ ╰─ ╰─ tagName 2╭─ /* │ │ ╰─ comment "/*\n This is a\n multiline comment\n */" - ╰─ ╰─ openTagEnd(p) + ╰─ ╰─ openTagEnd 3╭─ This is a ╰─ ╰─ comment.value "\n This is a\n multiline comment\n " 4├─ multiline comment diff --git a/src/__tests__/fixtures/comment-concise-js-line/__snapshots__/comment-concise-js-line.expected.txt b/src/__tests__/fixtures/comment-concise-js-line/__snapshots__/comment-concise-js-line.expected.txt index 9b197b56..7fecacdf 100644 --- a/src/__tests__/fixtures/comment-concise-js-line/__snapshots__/comment-concise-js-line.expected.txt +++ b/src/__tests__/fixtures/comment-concise-js-line/__snapshots__/comment-concise-js-line.expected.txt @@ -3,7 +3,7 @@ 2╭─ // This is a single line comment │ │ │ ╰─ comment.value " This is a single line comment" │ │ ╰─ comment "// This is a single line comment" - ╰─ ╰─ openTagEnd(div) + ╰─ ╰─ openTagEnd 3╭─ -- This is the body of the div tag │ │ ╰─ closeTag(div) ╰─ ╰─ text "This is the body of the div tag" \ No newline at end of file diff --git a/src/__tests__/fixtures/comments-within-open-tag/__snapshots__/comments-within-open-tag.expected.txt b/src/__tests__/fixtures/comments-within-open-tag/__snapshots__/comments-within-open-tag.expected.txt index cd2de8c8..70b81d40 100644 --- a/src/__tests__/fixtures/comments-within-open-tag/__snapshots__/comments-within-open-tag.expected.txt +++ b/src/__tests__/fixtures/comments-within-open-tag/__snapshots__/comments-within-open-tag.expected.txt @@ -1,7 +1,7 @@ 1╭─
│ │ │ ││ │ ││ ││ ╰─ closeTag(div).value "div" │ │ │ ││ │ ││ │╰─ closeTag(div) "
" - │ │ │ ││ │ ││ ╰─ openTagEnd(div) + │ │ │ ││ │ ││ ╰─ openTagEnd │ │ │ ││ │ │╰─ attrValue.value "\"world\"" │ │ │ ││ │ ╰─ attrValue "=\"world\"" │ │ │ ││ ╰─ attrName "hello" diff --git a/src/__tests__/fixtures/complex-attr-name/__snapshots__/complex-attr-name.expected.txt b/src/__tests__/fixtures/complex-attr-name/__snapshots__/complex-attr-name.expected.txt index ccb1a4e6..8aab8f34 100644 --- a/src/__tests__/fixtures/complex-attr-name/__snapshots__/complex-attr-name.expected.txt +++ b/src/__tests__/fixtures/complex-attr-name/__snapshots__/complex-attr-name.expected.txt @@ -1,6 +1,5 @@ 1╭─ - │ │ │ ││ │ ││ │ ╰─ closeTag(assign) - │ │ │ ││ │ ││ ╰─ openTagEnd(assign) "/>" + │ │ │ ││ │ ││ ╰─ openTagEnd:selfClosed "/>" │ │ │ ││ │ │╰─ attrValue.value "1+1" │ │ │ ││ │ ╰─ attrValue "=1+1" │ │ │ ││ ╰─ attrName ".hello" diff --git a/src/__tests__/fixtures/complex/__snapshots__/complex.expected.txt b/src/__tests__/fixtures/complex/__snapshots__/complex.expected.txt index 81a3da30..744fbd03 100644 --- a/src/__tests__/fixtures/complex/__snapshots__/complex.expected.txt +++ b/src/__tests__/fixtures/complex/__snapshots__/complex.expected.txt @@ -5,7 +5,7 @@ 4╭─ p ╰─ ╰─ tagName 5╭─ -- - ╰─ ╰─ openTagEnd(p) + ╰─ ╰─ openTagEnd 6╭─ This is text that spans multiple lines. ╰─ ╰─ text "\n This is text that spans multiple lines.\n\n " 7├─ @@ -13,7 +13,7 @@ │ │ ││ │ ╰─ closeTag(strong).value "strong" │ │ ││ ╰─ closeTag(strong) "" │ │ │╰─ text "You can throw in some HTML markup if you want!" - │ │ ╰─ openTagEnd(strong) + │ │ ╰─ openTagEnd ╰─ ╰─ tagName "strong" 9╭─ -- ╰─ ╰─ text "\n" @@ -21,7 +21,7 @@ │ ├─ closeTag(p) ╰─ ╰─ tagName 11╭─ ----- - ╰─ ╰─ openTagEnd(p) + ╰─ ╰─ openTagEnd 12╭─ If you really want to you can change the block delimiter for the following ╰─ ╰─ text "\n If you really want to you can change the block delimiter for the following\n reasons:\n - Avoid accidentally ending a block\n - To improve readability\n" 13├─ reasons: @@ -30,7 +30,7 @@ 16├─ ----- 17╭─ i -- This text will be in italics │ │ │ ╰─ text "This text will be in italics" - │ │ ╰─ openTagEnd(i) + │ │ ╰─ openTagEnd │ ├─ closeTag(p) ╰─ ╰─ tagName 18╭─ b @@ -38,7 +38,7 @@ ╰─ ╰─ tagName 19╭─ -- This text will be bold │ │ ╰─ text "This text will be bold" - ╰─ ╰─ openTagEnd(b) + ╰─ ╰─ openTagEnd 20╭─ -- This is okay too ╰─ ╰─ text "This is okay too" 21╭─ app-hello @@ -49,7 +49,7 @@ │ │ │ │││ │ ╰─ closeTag(b).value │ │ │ │││ ╰─ closeTag(b) "" │ │ │ ││╰─ text "bold" - │ │ │ │╰─ openTagEnd(b) + │ │ │ │╰─ openTagEnd │ │ │ ╰─ tagName │ │ ╰─ text " some html - " - ╰─ ╰─ openTagEnd(app-hello) \ No newline at end of file + ╰─ ╰─ openTagEnd \ No newline at end of file diff --git a/src/__tests__/fixtures/concise-contentplaceholder-html-start/__snapshots__/concise-contentplaceholder-html-start.expected.txt b/src/__tests__/fixtures/concise-contentplaceholder-html-start/__snapshots__/concise-contentplaceholder-html-start.expected.txt index 12849329..d6403205 100644 --- a/src/__tests__/fixtures/concise-contentplaceholder-html-start/__snapshots__/concise-contentplaceholder-html-start.expected.txt +++ b/src/__tests__/fixtures/concise-contentplaceholder-html-start/__snapshots__/concise-contentplaceholder-html-start.expected.txt @@ -2,6 +2,6 @@ │ │ │││ │ ╰─ closeTag(b).value │ │ │││ ╰─ closeTag(b) "" │ │ ││╰─ text "bold" - │ │ │╰─ openTagEnd(b) + │ │ │╰─ openTagEnd │ │ ╰─ tagName ╰─ ╰─ text " some html - " \ No newline at end of file diff --git a/src/__tests__/fixtures/css-calc/__snapshots__/css-calc.expected.txt b/src/__tests__/fixtures/css-calc/__snapshots__/css-calc.expected.txt index 53760a3b..a5f35b92 100644 --- a/src/__tests__/fixtures/css-calc/__snapshots__/css-calc.expected.txt +++ b/src/__tests__/fixtures/css-calc/__snapshots__/css-calc.expected.txt @@ -6,5 +6,5 @@ 4├─ } 5├─ } 6╭─ - │ ├─ openTagEnd(style) + │ ├─ openTagEnd ╰─ ╰─ closeTag(style) \ No newline at end of file diff --git a/src/__tests__/fixtures/default-attr-comma/__snapshots__/default-attr-comma.expected.txt b/src/__tests__/fixtures/default-attr-comma/__snapshots__/default-attr-comma.expected.txt index a37dfd24..abf409d0 100644 --- a/src/__tests__/fixtures/default-attr-comma/__snapshots__/default-attr-comma.expected.txt +++ b/src/__tests__/fixtures/default-attr-comma/__snapshots__/default-attr-comma.expected.txt @@ -1,6 +1,5 @@ 1╭─ - │ │││ ││││ ╰─ closeTag(a) - │ │││ │││╰─ openTagEnd(a) "/>" + │ │││ │││╰─ openTagEnd:selfClosed "/>" │ │││ ││╰─ attrValue.value │ │││ │╰─ attrValue "=2" │ │││ ╰─ attrName diff --git a/src/__tests__/fixtures/default-attr-no-space/__snapshots__/default-attr-no-space.expected.txt b/src/__tests__/fixtures/default-attr-no-space/__snapshots__/default-attr-no-space.expected.txt index 0bd8bc0b..2ee0840a 100644 --- a/src/__tests__/fixtures/default-attr-no-space/__snapshots__/default-attr-no-space.expected.txt +++ b/src/__tests__/fixtures/default-attr-no-space/__snapshots__/default-attr-no-space.expected.txt @@ -1,5 +1,5 @@ 1╭─ - │ │││ │││╰─ openTagEnd(a) "/>" + │ │││ │││╰─ openTagEnd:selfClosed "/>" │ │││ ││╰─ attrValue.value │ │││ │╰─ attrValue "=2" │ │││ ╰─ attrName @@ -8,12 +8,11 @@ │ │╰─ attrName ╰─ ╰─ tagName 2╭─ - │ ││ ││ ╰─ openTagEnd(if) - │ ││ │╰─ attrValue.value "(a && b)" - │ ││ ├─ attrValue "=(a && b)" - │ ││ ╰─ attrName - │ │╰─ tagName "if" - ╰─ ╰─ closeTag(a) + │ │ ││ ╰─ openTagEnd + │ │ │╰─ attrValue.value "(a && b)" + │ │ ├─ attrValue "=(a && b)" + │ │ ╰─ attrName + ╰─ ╰─ tagName "if" 3╭─ │ │ ╰─ closeTag(if).value "if" │ ├─ text "\n" diff --git a/src/__tests__/fixtures/default-attr/__snapshots__/default-attr.expected.txt b/src/__tests__/fixtures/default-attr/__snapshots__/default-attr.expected.txt index 3a004bc2..b8eea498 100644 --- a/src/__tests__/fixtures/default-attr/__snapshots__/default-attr.expected.txt +++ b/src/__tests__/fixtures/default-attr/__snapshots__/default-attr.expected.txt @@ -1,6 +1,5 @@ 1╭─ - │ │ │ │ │ │ ││ ╰─ closeTag(a) - │ │ │ │ │ │ │╰─ openTagEnd(a) "/>" + │ │ │ │ │ │ │╰─ openTagEnd:selfClosed "/>" │ │ │ │ │ │ ╰─ attrValue.value │ │ │ │ │ ╰─ attrValue "= 2" │ │ │ │ ╰─ attrName diff --git a/src/__tests__/fixtures/double-hyphen-block/__snapshots__/double-hyphen-block.expected.txt b/src/__tests__/fixtures/double-hyphen-block/__snapshots__/double-hyphen-block.expected.txt index 2e702192..508df655 100644 --- a/src/__tests__/fixtures/double-hyphen-block/__snapshots__/double-hyphen-block.expected.txt +++ b/src/__tests__/fixtures/double-hyphen-block/__snapshots__/double-hyphen-block.expected.txt @@ -8,17 +8,17 @@ ╰─ ╰─ tagName "html" 3╭─ body │ │ ╰─ tagName "body" - ╰─ ╰─ openTagEnd(html) + ╰─ ╰─ openTagEnd 4╭─ h1 -- Title │ │ │ │ ╰─ text "Title" - │ │ │ ╰─ openTagEnd(h1) + │ │ │ ╰─ openTagEnd │ │ ╰─ tagName "h1" - ╰─ ╰─ openTagEnd(body) + ╰─ ╰─ openTagEnd 5╭─ script │ │ ╰─ tagName "script" ╰─ ╰─ closeTag(h1) 6╭─ --- - ╰─ ╰─ openTagEnd(script) + ╰─ ╰─ openTagEnd 7╭─ var a = 'marko'; ╰─ ╰─ text "\n var a = 'marko';\n" 8╭─ --- diff --git a/src/__tests__/fixtures/double-hyphen-line-start/__snapshots__/double-hyphen-line-start.expected.txt b/src/__tests__/fixtures/double-hyphen-line-start/__snapshots__/double-hyphen-line-start.expected.txt index fce5f3b5..6835ccb9 100644 --- a/src/__tests__/fixtures/double-hyphen-line-start/__snapshots__/double-hyphen-line-start.expected.txt +++ b/src/__tests__/fixtures/double-hyphen-line-start/__snapshots__/double-hyphen-line-start.expected.txt @@ -8,12 +8,12 @@ ╰─ ╰─ tagName "html" 3╭─ body │ │ ╰─ tagName "body" - ╰─ ╰─ openTagEnd(html) + ╰─ ╰─ openTagEnd 4╭─ h1 -- Title │ │ │ │ ╰─ text "Title" - │ │ │ ╰─ openTagEnd(h1) + │ │ │ ╰─ openTagEnd │ │ ╰─ tagName "h1" - ╰─ ╰─ openTagEnd(body) + ╰─ ╰─ openTagEnd 5╭─ script │ │ ╰─ tagName "script" ╰─ ╰─ closeTag(h1) @@ -22,4 +22,4 @@ │ │ │ ├─ closeTag(body) │ │ │ ╰─ closeTag(script) │ │ ╰─ text "var a = 'marko';" - ╰─ ╰─ openTagEnd(script) \ No newline at end of file + ╰─ ╰─ openTagEnd \ No newline at end of file diff --git a/src/__tests__/fixtures/double-hyphen-line/__snapshots__/double-hyphen-line.expected.txt b/src/__tests__/fixtures/double-hyphen-line/__snapshots__/double-hyphen-line.expected.txt index 73f387c1..ebb176a4 100644 --- a/src/__tests__/fixtures/double-hyphen-line/__snapshots__/double-hyphen-line.expected.txt +++ b/src/__tests__/fixtures/double-hyphen-line/__snapshots__/double-hyphen-line.expected.txt @@ -8,17 +8,17 @@ ╰─ ╰─ tagName "html" 3╭─ body │ │ ╰─ tagName "body" - ╰─ ╰─ openTagEnd(html) + ╰─ ╰─ openTagEnd 4╭─ h1 -- Title │ │ │ │ ╰─ text "Title" - │ │ │ ╰─ openTagEnd(h1) + │ │ │ ╰─ openTagEnd │ │ ╰─ tagName "h1" - ╰─ ╰─ openTagEnd(body) + ╰─ ╰─ openTagEnd 5╭─ script -- var a = 'marko'; │ │ │ │ │ ├─ closeTag(html) │ │ │ │ │ ├─ closeTag(body) │ │ │ │ │ ╰─ closeTag(script) │ │ │ │ ╰─ text "var a = 'marko';" - │ │ │ ╰─ openTagEnd(script) + │ │ │ ╰─ openTagEnd │ │ ╰─ tagName "script" ╰─ ╰─ closeTag(h1) \ No newline at end of file diff --git a/src/__tests__/fixtures/empty-closing-tag/__snapshots__/empty-closing-tag.expected.txt b/src/__tests__/fixtures/empty-closing-tag/__snapshots__/empty-closing-tag.expected.txt index ecdf65a3..a87e2878 100644 --- a/src/__tests__/fixtures/empty-closing-tag/__snapshots__/empty-closing-tag.expected.txt +++ b/src/__tests__/fixtures/empty-closing-tag/__snapshots__/empty-closing-tag.expected.txt @@ -1,10 +1,10 @@ 1╭─
- │ │ ╰─ openTagEnd(div) + │ │ ╰─ openTagEnd ╰─ ╰─ tagName "div" 2╭─ Hello World ╰─ ╰─ text "\n Hello World\n " 3╭─ - │ │ ╰─ openTagEnd(span) + │ │ ╰─ openTagEnd ╰─ ╰─ tagName "span" 4╭─ Hello Universe ╰─ ╰─ text "\n Hello Universe\n " diff --git a/src/__tests__/fixtures/empty-closing-tag2/__snapshots__/empty-closing-tag2.expected.txt b/src/__tests__/fixtures/empty-closing-tag2/__snapshots__/empty-closing-tag2.expected.txt index 0734338e..318549a7 100644 --- a/src/__tests__/fixtures/empty-closing-tag2/__snapshots__/empty-closing-tag2.expected.txt +++ b/src/__tests__/fixtures/empty-closing-tag2/__snapshots__/empty-closing-tag2.expected.txt @@ -1,10 +1,10 @@ 1╭─ - │ │ ││ ╰─ openTagEnd(ul) + │ │ ││ ╰─ openTagEnd │ │ │╰─ tagShorthandClass.quasis[0] "features" │ │ ╰─ tagShorthandClass ".features" ╰─ ╰─ tagName "ul" 2╭─
  • - │ │ │ │ ││ ╰─ openTagEnd(li) + │ │ │ │ ││ ╰─ openTagEnd │ │ │ │ │╰─ attrArgs.value "feature in []" │ │ │ │ ╰─ attrArgs "(feature in [])" │ │ │ ╰─ attrName "for" diff --git a/src/__tests__/fixtures/eof-attr-name/__snapshots__/eof-attr-name.expected.txt b/src/__tests__/fixtures/eof-attr-name/__snapshots__/eof-attr-name.expected.txt index 46fece56..ac398dd8 100644 --- a/src/__tests__/fixtures/eof-attr-name/__snapshots__/eof-attr-name.expected.txt +++ b/src/__tests__/fixtures/eof-attr-name/__snapshots__/eof-attr-name.expected.txt @@ -1,5 +1,5 @@ 1╭─ Hello ${abc
  • │ │ ││ ╰─ error(MALFORMED_PLACEHOLDER:EOF reached while parsing placeholder) │ │ │╰─ text "Hello " - │ │ ╰─ openTagEnd(div) + │ │ ╰─ openTagEnd ╰─ ╰─ tagName "div" \ No newline at end of file diff --git a/src/__tests__/fixtures/eof-placeholder-body-non-escaped/__snapshots__/eof-placeholder-body-non-escaped.expected.txt b/src/__tests__/fixtures/eof-placeholder-body-non-escaped/__snapshots__/eof-placeholder-body-non-escaped.expected.txt index 3425cd6e..c65e92b7 100644 --- a/src/__tests__/fixtures/eof-placeholder-body-non-escaped/__snapshots__/eof-placeholder-body-non-escaped.expected.txt +++ b/src/__tests__/fixtures/eof-placeholder-body-non-escaped/__snapshots__/eof-placeholder-body-non-escaped.expected.txt @@ -1,5 +1,5 @@ 1╭─
    - │ │ ╰─ openTagEnd(div) + │ │ ╰─ openTagEnd ╰─ ╰─ tagName "div" 2╭─ Hello ╰─ ╰─ text "\n Hello\n " diff --git a/src/__tests__/fixtures/eof-placeholder-concise/__snapshots__/eof-placeholder-concise.expected.txt b/src/__tests__/fixtures/eof-placeholder-concise/__snapshots__/eof-placeholder-concise.expected.txt index 2ef4bc36..ebcaa26c 100644 --- a/src/__tests__/fixtures/eof-placeholder-concise/__snapshots__/eof-placeholder-concise.expected.txt +++ b/src/__tests__/fixtures/eof-placeholder-concise/__snapshots__/eof-placeholder-concise.expected.txt @@ -2,4 +2,4 @@ ╰─ ╰─ tagName "div" 2╭─ -- $!{abc │ │ ╰─ error(MALFORMED_PLACEHOLDER:EOF reached while parsing placeholder) - ╰─ ╰─ openTagEnd(div) \ No newline at end of file + ╰─ ╰─ openTagEnd \ No newline at end of file diff --git a/src/__tests__/fixtures/eof-placeholder-script-body-escaped/__snapshots__/eof-placeholder-script-body-escaped.expected.txt b/src/__tests__/fixtures/eof-placeholder-script-body-escaped/__snapshots__/eof-placeholder-script-body-escaped.expected.txt index 75f203c5..5f0ccbf6 100644 --- a/src/__tests__/fixtures/eof-placeholder-script-body-escaped/__snapshots__/eof-placeholder-script-body-escaped.expected.txt +++ b/src/__tests__/fixtures/eof-placeholder-script-body-escaped/__snapshots__/eof-placeholder-script-body-escaped.expected.txt @@ -1,5 +1,5 @@ 1╭─ diff --git a/src/__tests__/fixtures/html-comments/__snapshots__/html-comments.expected.txt b/src/__tests__/fixtures/html-comments/__snapshots__/html-comments.expected.txt index c8f3bc86..f4f6b280 100644 --- a/src/__tests__/fixtures/html-comments/__snapshots__/html-comments.expected.txt +++ b/src/__tests__/fixtures/html-comments/__snapshots__/html-comments.expected.txt @@ -3,5 +3,5 @@ │ │││ │ ╰─ closeTag(a) "" │ │││ ╰─ comment.value "" │ ││╰─ comment "" - │ │╰─ openTagEnd(a) + │ │╰─ openTagEnd ╰─ ╰─ tagName \ No newline at end of file diff --git a/src/__tests__/fixtures/ignoreNonstandardStringPlaceholders/__snapshots__/ignoreNonstandardStringPlaceholders.expected.txt b/src/__tests__/fixtures/ignoreNonstandardStringPlaceholders/__snapshots__/ignoreNonstandardStringPlaceholders.expected.txt index faaa876a..c53a90e5 100644 --- a/src/__tests__/fixtures/ignoreNonstandardStringPlaceholders/__snapshots__/ignoreNonstandardStringPlaceholders.expected.txt +++ b/src/__tests__/fixtures/ignoreNonstandardStringPlaceholders/__snapshots__/ignoreNonstandardStringPlaceholders.expected.txt @@ -1,7 +1,7 @@ 1╭─
    │ │ │ ││ ││ ╰─ closeTag(div).value "div" │ │ │ ││ │╰─ closeTag(div) "
    " - │ │ │ ││ ╰─ openTagEnd(div) + │ │ │ ││ ╰─ openTagEnd │ │ │ │╰─ attrValue.value "\"Hello ${foo}\"" │ │ │ ╰─ attrValue "=\"Hello ${foo}\"" │ │ ╰─ attrName "data-foo" diff --git a/src/__tests__/fixtures/ignorePlaceholders-attr-double-escaped-dollar-placeholder/__snapshots__/ignorePlaceholders-attr-double-escaped-dollar-placeholder.expected.txt b/src/__tests__/fixtures/ignorePlaceholders-attr-double-escaped-dollar-placeholder/__snapshots__/ignorePlaceholders-attr-double-escaped-dollar-placeholder.expected.txt index 5a9ad4bb..6235e320 100644 --- a/src/__tests__/fixtures/ignorePlaceholders-attr-double-escaped-dollar-placeholder/__snapshots__/ignorePlaceholders-attr-double-escaped-dollar-placeholder.expected.txt +++ b/src/__tests__/fixtures/ignorePlaceholders-attr-double-escaped-dollar-placeholder/__snapshots__/ignorePlaceholders-attr-double-escaped-dollar-placeholder.expected.txt @@ -1,7 +1,7 @@ 1╭─
    │ │ │ ││ ││ ╰─ closeTag(div).value "div" │ │ │ ││ │╰─ closeTag(div) "
    " - │ │ │ ││ ╰─ openTagEnd(div) + │ │ │ ││ ╰─ openTagEnd │ │ │ │╰─ attrValue.value "\"\\\\${foo}\"" │ │ │ ╰─ attrValue "=\"\\\\${foo}\"" │ │ ╰─ attrName "data-foo" diff --git a/src/__tests__/fixtures/ignorePlaceholders-attr-escaped-dollar-placeholder/__snapshots__/ignorePlaceholders-attr-escaped-dollar-placeholder.expected.txt b/src/__tests__/fixtures/ignorePlaceholders-attr-escaped-dollar-placeholder/__snapshots__/ignorePlaceholders-attr-escaped-dollar-placeholder.expected.txt index 0e5f0382..6d245c8f 100644 --- a/src/__tests__/fixtures/ignorePlaceholders-attr-escaped-dollar-placeholder/__snapshots__/ignorePlaceholders-attr-escaped-dollar-placeholder.expected.txt +++ b/src/__tests__/fixtures/ignorePlaceholders-attr-escaped-dollar-placeholder/__snapshots__/ignorePlaceholders-attr-escaped-dollar-placeholder.expected.txt @@ -1,7 +1,7 @@ 1╭─
    │ │ │ ││ ││ ╰─ closeTag(div).value "div" │ │ │ ││ │╰─ closeTag(div) "
    " - │ │ │ ││ ╰─ openTagEnd(div) + │ │ │ ││ ╰─ openTagEnd │ │ │ │╰─ attrValue.value "\"\\${foo}\"" │ │ │ ╰─ attrValue "=\"\\${foo}\"" │ │ ╰─ attrName "data-foo" diff --git a/src/__tests__/fixtures/ignorePlaceholders-attr-placeholder/__snapshots__/ignorePlaceholders-attr-placeholder.expected.txt b/src/__tests__/fixtures/ignorePlaceholders-attr-placeholder/__snapshots__/ignorePlaceholders-attr-placeholder.expected.txt index 73887b2e..aa6a5a4e 100644 --- a/src/__tests__/fixtures/ignorePlaceholders-attr-placeholder/__snapshots__/ignorePlaceholders-attr-placeholder.expected.txt +++ b/src/__tests__/fixtures/ignorePlaceholders-attr-placeholder/__snapshots__/ignorePlaceholders-attr-placeholder.expected.txt @@ -1,7 +1,7 @@ 1╭─
    │ │ │ ││ ││ ╰─ closeTag(div).value "div" │ │ │ ││ │╰─ closeTag(div) "
    " - │ │ │ ││ ╰─ openTagEnd(div) + │ │ │ ││ ╰─ openTagEnd │ │ │ │╰─ attrValue.value "\"${foo}\"" │ │ │ ╰─ attrValue "=\"${foo}\"" │ │ ╰─ attrName "data-foo" diff --git a/src/__tests__/fixtures/invalid-closing-tag/__snapshots__/invalid-closing-tag.expected.txt b/src/__tests__/fixtures/invalid-closing-tag/__snapshots__/invalid-closing-tag.expected.txt index 98a0ed61..f2eff90b 100644 --- a/src/__tests__/fixtures/invalid-closing-tag/__snapshots__/invalid-closing-tag.expected.txt +++ b/src/__tests__/fixtures/invalid-closing-tag/__snapshots__/invalid-closing-tag.expected.txt @@ -1,5 +1,5 @@ 1╭─
    │ │ ││╰─ error(MISMATCHED_CLOSING_TAG:The closing "span" tag does not match the corresponding opening "div" tag) "" │ │ │╰─ text " " - │ │ ╰─ openTagEnd(div) + │ │ ╰─ openTagEnd ╰─ ╰─ tagName "div" \ No newline at end of file diff --git a/src/__tests__/fixtures/mixed-bad-indentation/__snapshots__/mixed-bad-indentation.expected.txt b/src/__tests__/fixtures/mixed-bad-indentation/__snapshots__/mixed-bad-indentation.expected.txt index 02e64eab..cbf32d23 100644 --- a/src/__tests__/fixtures/mixed-bad-indentation/__snapshots__/mixed-bad-indentation.expected.txt +++ b/src/__tests__/fixtures/mixed-bad-indentation/__snapshots__/mixed-bad-indentation.expected.txt @@ -4,8 +4,8 @@ │ │ │││ │ ╰─ closeTag(b).value │ │ │││ ╰─ closeTag(b) "
    " │ │ ││╰─ text "Hello" - │ │ │╰─ openTagEnd(b) + │ │ │╰─ openTagEnd │ │ ╰─ tagName - ╰─ ╰─ openTagEnd(p) + ╰─ ╰─ openTagEnd 3╭─ BAD ╰─ ╰─ error(BAD_INDENTATION:Line indentation does match indentation of previous line) \ No newline at end of file diff --git a/src/__tests__/fixtures/mixed-cdata/__snapshots__/mixed-cdata.expected.txt b/src/__tests__/fixtures/mixed-cdata/__snapshots__/mixed-cdata.expected.txt index 3a10e446..95523a71 100644 --- a/src/__tests__/fixtures/mixed-cdata/__snapshots__/mixed-cdata.expected.txt +++ b/src/__tests__/fixtures/mixed-cdata/__snapshots__/mixed-cdata.expected.txt @@ -7,12 +7,12 @@ │ │ │ │ ╰─ text " This is after CDATA" │ │ │ ╰─ cdata.value "Hello World" │ │ ╰─ cdata "" - ╰─ ╰─ openTagEnd(p) + ╰─ ╰─ openTagEnd 3╭─ div class="bar" -- │ │ │ ││ │ │ │ ╰─ closeTag(div) │ │ │ ││ │ │ ╰─ cdata.value "Hello World" │ │ │ ││ │ ╰─ cdata "" - │ │ │ ││ ╰─ openTagEnd(div) + │ │ │ ││ ╰─ openTagEnd │ │ │ │╰─ attrValue.value "\"bar\"" │ │ │ ╰─ attrValue "=\"bar\"" │ │ ╰─ attrName "class" diff --git a/src/__tests__/fixtures/mixed-comment/__snapshots__/mixed-comment.expected.txt b/src/__tests__/fixtures/mixed-comment/__snapshots__/mixed-comment.expected.txt index a9183d92..b27195df 100644 --- a/src/__tests__/fixtures/mixed-comment/__snapshots__/mixed-comment.expected.txt +++ b/src/__tests__/fixtures/mixed-comment/__snapshots__/mixed-comment.expected.txt @@ -5,7 +5,7 @@ ╰─ ╰─ tagName 2╭─ " - ╰─ ╰─ openTagEnd(p) + ╰─ ╰─ openTagEnd 3╭─ A multiline HTML comment ╰─ ╰─ comment.value "\n A multiline HTML comment\n should be okay\n " 4├─ should be okay @@ -14,7 +14,7 @@ │ │ │ ││ │ │ │ ╰─ closeTag(div) │ │ │ ││ │ │ ╰─ comment.value " test " │ │ │ ││ │ ╰─ comment "" - │ │ │ ││ ╰─ openTagEnd(div) + │ │ │ ││ ╰─ openTagEnd │ │ │ │╰─ attrValue.value "\"bar\"" │ │ │ ╰─ attrValue "=\"bar\"" │ │ ╰─ attrName "class" diff --git a/src/__tests__/fixtures/mixed-invalid/__snapshots__/mixed-invalid.expected.txt b/src/__tests__/fixtures/mixed-invalid/__snapshots__/mixed-invalid.expected.txt index 8fe3d963..7b77a5d0 100644 --- a/src/__tests__/fixtures/mixed-invalid/__snapshots__/mixed-invalid.expected.txt +++ b/src/__tests__/fixtures/mixed-invalid/__snapshots__/mixed-invalid.expected.txt @@ -4,12 +4,12 @@ │ │ ╰─ attrName "colors" ╰─ ╰─ tagName "var" 2╭─
    - │ ││ ╰─ openTagEnd(div) + │ ││ ╰─ openTagEnd │ │╰─ tagName "div" │ ├─ closeTag(var) - ╰─ ╰─ openTagEnd(var) + ╰─ ╰─ openTagEnd 3╭─ - │ │ │ │ ││ ╰─ openTagEnd(span) + │ │ │ │ ││ ╰─ openTagEnd │ │ │ │ │╰─ attrValue.value "\"foo\"" │ │ │ │ ╰─ attrValue "=\"foo\"" │ │ │ ╰─ attrName "class" @@ -23,7 +23,7 @@ ╰─ ╰─ closeTag(span) "" 6╭─
    This is not │ │ │ │ ││╰─ text "This is not\n allowed" - │ │ │ │ │╰─ openTagEnd(b) + │ │ │ │ │╰─ openTagEnd │ │ │ │ ╰─ tagName │ │ │ ╰─ text " " │ │ ╰─ closeTag(div).value "div" @@ -42,6 +42,6 @@ │ │ │ ││ │ ╰─ closeTag(span).value "span" │ │ │ ││ ╰─ closeTag(span) "" │ │ │ │╰─ text "Test" - │ │ │ ╰─ openTagEnd(span) + │ │ │ ╰─ openTagEnd │ │ ╰─ tagName "span" - ╰─ ╰─ openTagEnd(p) \ No newline at end of file + ╰─ ╰─ openTagEnd \ No newline at end of file diff --git a/src/__tests__/fixtures/mixed-open-tag-only/__snapshots__/mixed-open-tag-only.expected.txt b/src/__tests__/fixtures/mixed-open-tag-only/__snapshots__/mixed-open-tag-only.expected.txt index 05507e2d..945ff27b 100644 --- a/src/__tests__/fixtures/mixed-open-tag-only/__snapshots__/mixed-open-tag-only.expected.txt +++ b/src/__tests__/fixtures/mixed-open-tag-only/__snapshots__/mixed-open-tag-only.expected.txt @@ -4,25 +4,23 @@ │ │ ╰─ attrName "colors" ╰─ ╰─ tagName "var" 2╭─ - │ ││ │ ││ ╰─ openTagEnd(img) + │ ││ │ ││ ╰─ openTagEnd │ ││ │ │╰─ attrValue.value "\"marko.png\"" │ ││ │ ╰─ attrValue "=\"marko.png\"" │ ││ ╰─ attrName "src" │ │╰─ tagName "img" │ ├─ closeTag(var) - ╰─ ╰─ openTagEnd(var) + ╰─ ╰─ openTagEnd 3╭─ img src="marko2.png" │ │ │ │╰─ attrValue.value "\"marko2.png\"" │ │ │ ╰─ attrValue "=\"marko2.png\"" │ │ ╰─ attrName "src" - │ ├─ closeTag(img) ╰─ ╰─ tagName "img" 4╭─ div class="foo" │ │ │ ││ ├─ closeTag(div) - │ │ │ ││ ╰─ openTagEnd(div) + │ │ │ ││ ╰─ openTagEnd │ │ │ │╰─ attrValue.value "\"foo\"" │ │ │ ╰─ attrValue "=\"foo\"" │ │ ╰─ attrName "class" - │ ├─ closeTag(img) - │ ├─ openTagEnd(img) + │ ├─ openTagEnd ╰─ ╰─ tagName "div" \ No newline at end of file diff --git a/src/__tests__/fixtures/mixed/__snapshots__/mixed.expected.txt b/src/__tests__/fixtures/mixed/__snapshots__/mixed.expected.txt index 9fb0e06b..7d4f7702 100644 --- a/src/__tests__/fixtures/mixed/__snapshots__/mixed.expected.txt +++ b/src/__tests__/fixtures/mixed/__snapshots__/mixed.expected.txt @@ -4,12 +4,12 @@ │ │ ╰─ attrName "colors" ╰─ ╰─ tagName "var" 2╭─
    - │ ││ ╰─ openTagEnd(div) + │ ││ ╰─ openTagEnd │ │╰─ tagName "div" │ ├─ closeTag(var) - ╰─ ╰─ openTagEnd(var) + ╰─ ╰─ openTagEnd 3╭─ - │ │ │ │ ││ ╰─ openTagEnd(span) + │ │ │ │ ││ ╰─ openTagEnd │ │ │ │ │╰─ attrValue.value "\"foo\"" │ │ │ │ ╰─ attrValue "=\"foo\"" │ │ │ ╰─ attrName "class" @@ -25,7 +25,7 @@ │ │ │ │ │││ │ ╰─ closeTag(b).value │ │ │ │ │││ ╰─ closeTag(b) "" │ │ │ │ ││╰─ text "This is after the span" - │ │ │ │ │╰─ openTagEnd(b) + │ │ │ │ │╰─ openTagEnd │ │ │ │ ╰─ tagName │ │ │ ╰─ text " " │ │ ╰─ closeTag(div).value "div" @@ -41,6 +41,6 @@ │ │ │ ││ │ ╰─ closeTag(span).value "span" │ │ │ ││ ╰─ closeTag(span) "" │ │ │ │╰─ text "Test" - │ │ │ ╰─ openTagEnd(span) + │ │ │ ╰─ openTagEnd │ │ ╰─ tagName "span" - ╰─ ╰─ openTagEnd(p) \ No newline at end of file + ╰─ ╰─ openTagEnd \ No newline at end of file diff --git a/src/__tests__/fixtures/multi-line-attrs/__snapshots__/multi-line-attrs.expected.txt b/src/__tests__/fixtures/multi-line-attrs/__snapshots__/multi-line-attrs.expected.txt index f2df554e..5fecfbe3 100644 --- a/src/__tests__/fixtures/multi-line-attrs/__snapshots__/multi-line-attrs.expected.txt +++ b/src/__tests__/fixtures/multi-line-attrs/__snapshots__/multi-line-attrs.expected.txt @@ -15,6 +15,5 @@ 8╭─ not-preserve-attr-a ╰─ ╰─ attrName "not-preserve-attr-a" 9╭─ /> - ╰─ ╰─ openTagEnd(custom-tag) "/>" -10╭─ - ╰─ ╰─ closeTag(custom-tag) \ No newline at end of file + ╰─ ╰─ openTagEnd:selfClosed "/>" +10╰─ \ No newline at end of file diff --git a/src/__tests__/fixtures/multiline-html-block-missing-end/__snapshots__/multiline-html-block-missing-end.expected.txt b/src/__tests__/fixtures/multiline-html-block-missing-end/__snapshots__/multiline-html-block-missing-end.expected.txt index 1321ca69..eb2cbfbb 100644 --- a/src/__tests__/fixtures/multiline-html-block-missing-end/__snapshots__/multiline-html-block-missing-end.expected.txt +++ b/src/__tests__/fixtures/multiline-html-block-missing-end/__snapshots__/multiline-html-block-missing-end.expected.txt @@ -1,13 +1,13 @@ 1╭─ div ╰─ ╰─ tagName "div" 2╭─ -- - ╰─ ╰─ openTagEnd(div) + ╰─ ╰─ openTagEnd 3╭─ Hello World ╰─ ╰─ text "\n Hello World\n Hello Again\n" 4├─ Hello Again 5├─ 6╭─ script -- - │ │ ╰─ openTagEnd(script) + │ │ ╰─ openTagEnd │ ├─ closeTag(div) ╰─ ╰─ tagName "script" 7╭─ console.log('foo'); diff --git a/src/__tests__/fixtures/multiline-html-block-nested-empty/__snapshots__/multiline-html-block-nested-empty.expected.txt b/src/__tests__/fixtures/multiline-html-block-nested-empty/__snapshots__/multiline-html-block-nested-empty.expected.txt index c73f811c..d234dd8d 100644 --- a/src/__tests__/fixtures/multiline-html-block-nested-empty/__snapshots__/multiline-html-block-nested-empty.expected.txt +++ b/src/__tests__/fixtures/multiline-html-block-nested-empty/__snapshots__/multiline-html-block-nested-empty.expected.txt @@ -1,7 +1,7 @@ 1╭─ p ╰─ ╰─ tagName 2╭─ --- - ╰─ ╰─ openTagEnd(p) + ╰─ ╰─ openTagEnd 3╭─ --- │ │ ╰─ closeTag(p) ╰─ ╰─ text "\n" \ No newline at end of file diff --git a/src/__tests__/fixtures/multiline-html-block-nested/__snapshots__/multiline-html-block-nested.expected.txt b/src/__tests__/fixtures/multiline-html-block-nested/__snapshots__/multiline-html-block-nested.expected.txt index 0db224ed..3dd978a5 100644 --- a/src/__tests__/fixtures/multiline-html-block-nested/__snapshots__/multiline-html-block-nested.expected.txt +++ b/src/__tests__/fixtures/multiline-html-block-nested/__snapshots__/multiline-html-block-nested.expected.txt @@ -1,12 +1,12 @@ 1╭─ p ╰─ ╰─ tagName 2╭─ --- - ╰─ ╰─ openTagEnd(p) + ╰─ ╰─ openTagEnd 3╭─ Hello Frank │ │ │ ││ │ ╰─ closeTag(strong).value "strong" │ │ │ ││ ╰─ closeTag(strong) "" │ │ │ │╰─ text "Frank" - │ │ │ ╰─ openTagEnd(strong) + │ │ │ ╰─ openTagEnd │ │ ╰─ tagName "strong" ╰─ ╰─ text "\n Hello " 4╭─ Line 2 diff --git a/src/__tests__/fixtures/multiline-html-block-same-line/__snapshots__/multiline-html-block-same-line.expected.txt b/src/__tests__/fixtures/multiline-html-block-same-line/__snapshots__/multiline-html-block-same-line.expected.txt index fa4a7050..d5ab1708 100644 --- a/src/__tests__/fixtures/multiline-html-block-same-line/__snapshots__/multiline-html-block-same-line.expected.txt +++ b/src/__tests__/fixtures/multiline-html-block-same-line/__snapshots__/multiline-html-block-same-line.expected.txt @@ -1,12 +1,12 @@ 1╭─ div -- - │ │ ╰─ openTagEnd(div) + │ │ ╰─ openTagEnd ╰─ ╰─ tagName "div" 2╭─ Hello World ╰─ ╰─ text "\n Hello World\n Hello Again\n" 3├─ Hello Again 4├─ -- 5╭─ span -- - │ │ ╰─ openTagEnd(span) + │ │ ╰─ openTagEnd ╰─ ╰─ tagName "span" 6╭─ Goodbye ╰─ ╰─ text "\n Goodbye\n" diff --git a/src/__tests__/fixtures/multiline-html-block/__snapshots__/multiline-html-block.expected.txt b/src/__tests__/fixtures/multiline-html-block/__snapshots__/multiline-html-block.expected.txt index 49d94f89..d6c67300 100644 --- a/src/__tests__/fixtures/multiline-html-block/__snapshots__/multiline-html-block.expected.txt +++ b/src/__tests__/fixtures/multiline-html-block/__snapshots__/multiline-html-block.expected.txt @@ -3,7 +3,7 @@ │ │ │ ││ │ ╰─ closeTag(strong).value "strong" │ │ │ ││ ╰─ closeTag(strong) "" │ │ │ │╰─ text "Frank" - │ │ │ ╰─ openTagEnd(strong) + │ │ │ ╰─ openTagEnd │ │ ╰─ tagName "strong" ╰─ ╰─ text "\nHello " 3╭─ Line 2 diff --git a/src/__tests__/fixtures/multiple-tags-on-line-close-next/__snapshots__/multiple-tags-on-line-close-next.expected.txt b/src/__tests__/fixtures/multiple-tags-on-line-close-next/__snapshots__/multiple-tags-on-line-close-next.expected.txt index accae409..cc19428e 100644 --- a/src/__tests__/fixtures/multiple-tags-on-line-close-next/__snapshots__/multiple-tags-on-line-close-next.expected.txt +++ b/src/__tests__/fixtures/multiple-tags-on-line-close-next/__snapshots__/multiple-tags-on-line-close-next.expected.txt @@ -1,9 +1,9 @@ 1╭─
    - │ │ ││ │ │ ╰─ openTagEnd(div) + │ │ ││ │ │ ╰─ openTagEnd │ │ ││ │ ╰─ tagName "div" │ │ ││ ╰─ closeTag(span).value "span" │ │ │╰─ closeTag(span) "" - │ │ ╰─ openTagEnd(span) + │ │ ╰─ openTagEnd ╰─ ╰─ tagName "span" 2╭─
    │ │ ╰─ closeTag(div).value "div" diff --git a/src/__tests__/fixtures/nested-pyramid/__snapshots__/nested-pyramid.expected.txt b/src/__tests__/fixtures/nested-pyramid/__snapshots__/nested-pyramid.expected.txt index 275b74a5..35c60ae4 100644 --- a/src/__tests__/fixtures/nested-pyramid/__snapshots__/nested-pyramid.expected.txt +++ b/src/__tests__/fixtures/nested-pyramid/__snapshots__/nested-pyramid.expected.txt @@ -2,24 +2,24 @@ ╰─ ╰─ tagName 2╭─ b │ │ ╰─ tagName - ╰─ ╰─ openTagEnd(a) + ╰─ ╰─ openTagEnd 3╭─ c │ │ ╰─ tagName - ╰─ ╰─ openTagEnd(b) + ╰─ ╰─ openTagEnd 4╭─ c2 │ │ ╰─ tagName "c2" │ ├─ closeTag(c) - ╰─ ╰─ openTagEnd(c) + ╰─ ╰─ openTagEnd 5╭─ b2 │ │ ╰─ tagName "b2" │ ├─ closeTag(b) │ ├─ closeTag(c2) - ╰─ ╰─ openTagEnd(c2) + ╰─ ╰─ openTagEnd 6╭─ a2 │ ├─ closeTag(a) │ ├─ closeTag(b2) - │ ├─ openTagEnd(b2) + │ ├─ openTagEnd ╰─ ╰─ tagName "a2" 7╭─ - │ ├─ openTagEnd(a2) + │ ├─ openTagEnd ╰─ ╰─ closeTag(a2) \ No newline at end of file diff --git a/src/__tests__/fixtures/nested-siblings/__snapshots__/nested-siblings.expected.txt b/src/__tests__/fixtures/nested-siblings/__snapshots__/nested-siblings.expected.txt index 32c572dd..8a6f826a 100644 --- a/src/__tests__/fixtures/nested-siblings/__snapshots__/nested-siblings.expected.txt +++ b/src/__tests__/fixtures/nested-siblings/__snapshots__/nested-siblings.expected.txt @@ -8,14 +8,14 @@ │ │ │ │ ╰─ attrValue "=\"bar\"" │ │ │ ╰─ attrName "class" │ │ ╰─ tagName "span" - ╰─ ╰─ openTagEnd(div) + ╰─ ╰─ openTagEnd 3╭─ span class="baz" │ │ │ │ ││ ├─ closeTag(div) │ │ │ │ ││ ├─ closeTag(span) - │ │ │ │ ││ ╰─ openTagEnd(span) + │ │ │ │ ││ ╰─ openTagEnd │ │ │ │ │╰─ attrValue.value "\"baz\"" │ │ │ │ ╰─ attrValue "=\"baz\"" │ │ │ ╰─ attrName "class" │ │ ╰─ tagName "span" │ ├─ closeTag(span) - ╰─ ╰─ openTagEnd(span) \ No newline at end of file + ╰─ ╰─ openTagEnd \ No newline at end of file diff --git a/src/__tests__/fixtures/nested-tags/__snapshots__/nested-tags.expected.txt b/src/__tests__/fixtures/nested-tags/__snapshots__/nested-tags.expected.txt index 65526d4a..24123940 100644 --- a/src/__tests__/fixtures/nested-tags/__snapshots__/nested-tags.expected.txt +++ b/src/__tests__/fixtures/nested-tags/__snapshots__/nested-tags.expected.txt @@ -6,9 +6,9 @@ 2╭─ span class="bar" │ │ │ │ ││ ├─ closeTag(div) │ │ │ │ ││ ├─ closeTag(span) - │ │ │ │ ││ ╰─ openTagEnd(span) + │ │ │ │ ││ ╰─ openTagEnd │ │ │ │ │╰─ attrValue.value "\"bar\"" │ │ │ │ ╰─ attrValue "=\"bar\"" │ │ │ ╰─ attrName "class" │ │ ╰─ tagName "span" - ╰─ ╰─ openTagEnd(div) \ No newline at end of file + ╰─ ╰─ openTagEnd \ No newline at end of file diff --git a/src/__tests__/fixtures/nested-text/__snapshots__/nested-text.expected.txt b/src/__tests__/fixtures/nested-text/__snapshots__/nested-text.expected.txt index ba96d346..bbd666ff 100644 --- a/src/__tests__/fixtures/nested-text/__snapshots__/nested-text.expected.txt +++ b/src/__tests__/fixtures/nested-text/__snapshots__/nested-text.expected.txt @@ -1,14 +1,14 @@ 1╭─ div ╰─ ╰─ tagName "div" 2╭─ --- - ╰─ ╰─ openTagEnd(div) + ╰─ ╰─ openTagEnd 3╭─ This is ╰─ ╰─ text "\n This is\n multi-line text\n" 4├─ multi-line text 5├─ --- 6╭─ span -- This is body text of span │ │ │ ╰─ text "This is body text of span" - │ │ ╰─ openTagEnd(span) + │ │ ╰─ openTagEnd ╰─ ╰─ tagName "span" 7╭─ -- This is also body text of span ╰─ ╰─ text "This is also body text of span" diff --git a/src/__tests__/fixtures/open-tag-only-with-body-concise/__snapshots__/open-tag-only-with-body-concise.expected.txt b/src/__tests__/fixtures/open-tag-only-with-body-concise/__snapshots__/open-tag-only-with-body-concise.expected.txt index 1cb4cd69..7457d043 100644 --- a/src/__tests__/fixtures/open-tag-only-with-body-concise/__snapshots__/open-tag-only-with-body-concise.expected.txt +++ b/src/__tests__/fixtures/open-tag-only-with-body-concise/__snapshots__/open-tag-only-with-body-concise.expected.txt @@ -4,5 +4,5 @@ │ │ ╰─ attrName "src" ╰─ ╰─ tagName "img" 2╭─ This is not allowed! - │ │ ╰─ error(INVALID_BODY:The "img" tag does not allow nested body content) - ╰─ ╰─ openTagEnd(img) \ No newline at end of file + │ │ ╰─ error(BAD_INDENTATION:Line has extra indentation at the beginning) + ╰─ ╰─ openTagEnd \ No newline at end of file diff --git a/src/__tests__/fixtures/open-tag-only-with-body/__snapshots__/open-tag-only-with-body.expected.txt b/src/__tests__/fixtures/open-tag-only-with-body/__snapshots__/open-tag-only-with-body.expected.txt index 0b7d7d8d..7517e8f9 100644 --- a/src/__tests__/fixtures/open-tag-only-with-body/__snapshots__/open-tag-only-with-body.expected.txt +++ b/src/__tests__/fixtures/open-tag-only-with-body/__snapshots__/open-tag-only-with-body.expected.txt @@ -1,14 +1,13 @@ 1╭─ --- 2╭─ - │ ││ │ ││ ╰─ openTagEnd(img) + │ ││ │ ││ ╰─ openTagEnd │ ││ │ │╰─ attrValue.value "\"marko.png\"" │ ││ │ ╰─ attrValue "=\"marko.png\"" │ ││ ╰─ attrName "src" │ │╰─ tagName "img" ╰─ ╰─ text "\n" 3╭─ This is not allowed! - │ ├─ text "\n This is not allowed!\n" - ╰─ ╰─ closeTag(img) + ╰─ ╰─ text "\n This is not allowed!\n" 4╭─ ╰─ ╰─ error(EXTRA_CLOSING_TAG:The closing "img" tag was not expected) "" 5╰─ --- \ No newline at end of file diff --git a/src/__tests__/fixtures/open-tag-only/__snapshots__/open-tag-only.expected.txt b/src/__tests__/fixtures/open-tag-only/__snapshots__/open-tag-only.expected.txt index 317b11cf..8244471f 100644 --- a/src/__tests__/fixtures/open-tag-only/__snapshots__/open-tag-only.expected.txt +++ b/src/__tests__/fixtures/open-tag-only/__snapshots__/open-tag-only.expected.txt @@ -1,27 +1,24 @@ 1╭─
    A B C D
    │ │ ││ │ │ ││ ││ │ │ ││ ││ │ │ ││ ││ │ ╰─ closeTag(div).value "div" │ │ ││ │ │ ││ ││ │ │ ││ ││ │ │ ││ ││ ╰─ closeTag(div) "
    " - │ │ ││ │ │ ││ ││ │ │ ││ ││ │ │ ││ │├─ text " D " - │ │ ││ │ │ ││ ││ │ │ ││ ││ │ │ ││ │╰─ closeTag(img) - │ │ ││ │ │ ││ ││ │ │ ││ ││ │ │ ││ ╰─ openTagEnd(img) + │ │ ││ │ │ ││ ││ │ │ ││ ││ │ │ ││ │╰─ text " D " + │ │ ││ │ │ ││ ││ │ │ ││ ││ │ │ ││ ╰─ openTagEnd │ │ ││ │ │ ││ ││ │ │ ││ ││ │ │ │╰─ attrValue.value "\"image3.png\"" │ │ ││ │ │ ││ ││ │ │ ││ ││ │ │ ╰─ attrValue "=\"image3.png\"" │ │ ││ │ │ ││ ││ │ │ ││ ││ │ ╰─ attrName "src" │ │ ││ │ │ ││ ││ │ │ ││ ││ ╰─ tagName "img" - │ │ ││ │ │ ││ ││ │ │ ││ │├─ text " C " - │ │ ││ │ │ ││ ││ │ │ ││ │╰─ closeTag(img) - │ │ ││ │ │ ││ ││ │ │ ││ ╰─ openTagEnd(img) + │ │ ││ │ │ ││ ││ │ │ ││ │╰─ text " C " + │ │ ││ │ │ ││ ││ │ │ ││ ╰─ openTagEnd │ │ ││ │ │ ││ ││ │ │ │╰─ attrValue.value "\"image2.png\"" │ │ ││ │ │ ││ ││ │ │ ╰─ attrValue "=\"image2.png\"" │ │ ││ │ │ ││ ││ │ ╰─ attrName "src" │ │ ││ │ │ ││ ││ ╰─ tagName "img" - │ │ ││ │ │ ││ │├─ text " B " - │ │ ││ │ │ ││ │╰─ closeTag(img) - │ │ ││ │ │ ││ ╰─ openTagEnd(img) + │ │ ││ │ │ ││ │╰─ text " B " + │ │ ││ │ │ ││ ╰─ openTagEnd │ │ ││ │ │ │╰─ attrValue.value "\"image1.png\"" │ │ ││ │ │ ╰─ attrValue "=\"image1.png\"" │ │ ││ │ ╰─ attrName "src" │ │ ││ ╰─ tagName "img" │ │ │╰─ text " A " - │ │ ╰─ openTagEnd(div) + │ │ ╰─ openTagEnd ╰─ ╰─ tagName "div" \ No newline at end of file diff --git a/src/__tests__/fixtures/param-tag/__snapshots__/param-tag.expected.txt b/src/__tests__/fixtures/param-tag/__snapshots__/param-tag.expected.txt index dc65f871..873b093a 100644 --- a/src/__tests__/fixtures/param-tag/__snapshots__/param-tag.expected.txt +++ b/src/__tests__/fixtures/param-tag/__snapshots__/param-tag.expected.txt @@ -1,7 +1,7 @@ 1╭─ │ │ ││ │ ││ ││ ╰─ closeTag(for).value "for" │ │ ││ │ ││ │╰─ closeTag(for) "" - │ │ ││ │ ││ ╰─ openTagEnd(for) + │ │ ││ │ ││ ╰─ openTagEnd │ │ ││ │ │╰─ attrValue.value "array" │ │ ││ │ ╰─ attrValue "=array" │ │ ││ ╰─ attrName "of" diff --git a/src/__tests__/fixtures/parsed-text-placeholder-in-template-literal-string/__snapshots__/parsed-text-placeholder-in-template-literal-string.expected.txt b/src/__tests__/fixtures/parsed-text-placeholder-in-template-literal-string/__snapshots__/parsed-text-placeholder-in-template-literal-string.expected.txt index d2fdad84..bcd88038 100644 --- a/src/__tests__/fixtures/parsed-text-placeholder-in-template-literal-string/__snapshots__/parsed-text-placeholder-in-template-literal-string.expected.txt +++ b/src/__tests__/fixtures/parsed-text-placeholder-in-template-literal-string/__snapshots__/parsed-text-placeholder-in-template-literal-string.expected.txt @@ -1,5 +1,5 @@ 1╭─ " │ │ │╰─ text "/* Copyright $!{date} */" - │ │ ╰─ openTagEnd(script) + │ │ ╰─ openTagEnd ╰─ ╰─ tagName "script" \ No newline at end of file diff --git a/src/__tests__/fixtures/placeholder-body-single-line-js-comment/__snapshots__/placeholder-body-single-line-js-comment.expected.txt b/src/__tests__/fixtures/placeholder-body-single-line-js-comment/__snapshots__/placeholder-body-single-line-js-comment.expected.txt index aa159211..8bce3af7 100644 --- a/src/__tests__/fixtures/placeholder-body-single-line-js-comment/__snapshots__/placeholder-body-single-line-js-comment.expected.txt +++ b/src/__tests__/fixtures/placeholder-body-single-line-js-comment/__snapshots__/placeholder-body-single-line-js-comment.expected.txt @@ -1,6 +1,6 @@ 1╭─ │ │ ╰─ closeTag(script).value "script" diff --git a/src/__tests__/fixtures/placeholder-body-text/__snapshots__/placeholder-body-text.expected.txt b/src/__tests__/fixtures/placeholder-body-text/__snapshots__/placeholder-body-text.expected.txt index 80dab634..dfdae2e8 100644 --- a/src/__tests__/fixtures/placeholder-body-text/__snapshots__/placeholder-body-text.expected.txt +++ b/src/__tests__/fixtures/placeholder-body-text/__snapshots__/placeholder-body-text.expected.txt @@ -3,5 +3,5 @@ │ │ ││ │╰─ closeTag(div) "
    " │ │ ││ ╰─ text │ │ │╰─ text "Hello " - │ │ ╰─ openTagEnd(div) + │ │ ╰─ openTagEnd ╰─ ╰─ tagName "div" \ No newline at end of file diff --git a/src/__tests__/fixtures/placeholder-escape/__snapshots__/placeholder-escape.expected.txt b/src/__tests__/fixtures/placeholder-escape/__snapshots__/placeholder-escape.expected.txt index 3111cb46..d153bb8f 100644 --- a/src/__tests__/fixtures/placeholder-escape/__snapshots__/placeholder-escape.expected.txt +++ b/src/__tests__/fixtures/placeholder-escape/__snapshots__/placeholder-escape.expected.txt @@ -1,5 +1,5 @@ 1╭─ - │ │ │ ││ ╰─ openTagEnd(custom) + │ │ │ ││ ╰─ openTagEnd │ │ │ │╰─ attrValue.value "\"Hello ${name}!\"" │ │ │ ╰─ attrValue "=\"Hello ${name}!\"" │ │ ╰─ attrName "name" diff --git a/src/__tests__/fixtures/placeholder-no-escape/__snapshots__/placeholder-no-escape.expected.txt b/src/__tests__/fixtures/placeholder-no-escape/__snapshots__/placeholder-no-escape.expected.txt index a1e7fe36..207bfe47 100644 --- a/src/__tests__/fixtures/placeholder-no-escape/__snapshots__/placeholder-no-escape.expected.txt +++ b/src/__tests__/fixtures/placeholder-no-escape/__snapshots__/placeholder-no-escape.expected.txt @@ -1,5 +1,5 @@ 1╭─ - │ │ │ ││ ╰─ openTagEnd(custom) + │ │ │ ││ ╰─ openTagEnd │ │ │ │╰─ attrValue.value "\"Hello $!{name}!\"" │ │ │ ╰─ attrValue "=\"Hello $!{name}!\"" │ │ ╰─ attrName "name" diff --git a/src/__tests__/fixtures/placeholder-tag-name-concise/__snapshots__/placeholder-tag-name-concise.expected.txt b/src/__tests__/fixtures/placeholder-tag-name-concise/__snapshots__/placeholder-tag-name-concise.expected.txt index dbd72efb..2e87893a 100644 --- a/src/__tests__/fixtures/placeholder-tag-name-concise/__snapshots__/placeholder-tag-name-concise.expected.txt +++ b/src/__tests__/fixtures/placeholder-tag-name-concise/__snapshots__/placeholder-tag-name-concise.expected.txt @@ -1,6 +1,6 @@ 1╭─ ${test} foo=123 │ │ │ ││ ├─ closeTag(${test}) - │ │ │ ││ ╰─ openTagEnd(${test}) + │ │ │ ││ ╰─ openTagEnd │ │ │ │╰─ attrValue.value "123" │ │ │ ╰─ attrValue "=123" │ │ ├─ attrName "foo" diff --git a/src/__tests__/fixtures/placeholder-tag-name-html/__snapshots__/placeholder-tag-name-html.expected.txt b/src/__tests__/fixtures/placeholder-tag-name-html/__snapshots__/placeholder-tag-name-html.expected.txt index 48a55e90..9d434340 100644 --- a/src/__tests__/fixtures/placeholder-tag-name-html/__snapshots__/placeholder-tag-name-html.expected.txt +++ b/src/__tests__/fixtures/placeholder-tag-name-html/__snapshots__/placeholder-tag-name-html.expected.txt @@ -1,6 +1,5 @@ 1╭─ <${test} foo=123/> - │ │ │ ││ │ ╰─ closeTag(${test}) - │ │ │ ││ ╰─ openTagEnd(${test}) "/>" + │ │ │ ││ ╰─ openTagEnd:selfClosed "/>" │ │ │ │╰─ attrValue.value "123" │ │ │ ╰─ attrValue "=123" │ │ ├─ attrName "foo" diff --git a/src/__tests__/fixtures/placeholder-unnamed-attr-escaped-escaped/__snapshots__/placeholder-unnamed-attr-escaped-escaped.expected.txt b/src/__tests__/fixtures/placeholder-unnamed-attr-escaped-escaped/__snapshots__/placeholder-unnamed-attr-escaped-escaped.expected.txt index 387f8a8c..68701acc 100644 --- a/src/__tests__/fixtures/placeholder-unnamed-attr-escaped-escaped/__snapshots__/placeholder-unnamed-attr-escaped-escaped.expected.txt +++ b/src/__tests__/fixtures/placeholder-unnamed-attr-escaped-escaped/__snapshots__/placeholder-unnamed-attr-escaped-escaped.expected.txt @@ -1,7 +1,7 @@ 1╭─
    │ │ │ ││ │ ││ ╰─ closeTag(div).value "div" │ │ │ ││ │ │╰─ closeTag(div) "" - │ │ │ ││ │ ╰─ openTagEnd(div) + │ │ │ ││ │ ╰─ openTagEnd │ │ │ ││ ╰─ attrName "\\\\${myCustomAttrs}" │ │ │ │╰─ attrValue.value "\"foo\"" │ │ │ ╰─ attrValue "=\"foo\"" diff --git a/src/__tests__/fixtures/placeholder-unnamed-attr-escaped/__snapshots__/placeholder-unnamed-attr-escaped.expected.txt b/src/__tests__/fixtures/placeholder-unnamed-attr-escaped/__snapshots__/placeholder-unnamed-attr-escaped.expected.txt index a1925655..ef038179 100644 --- a/src/__tests__/fixtures/placeholder-unnamed-attr-escaped/__snapshots__/placeholder-unnamed-attr-escaped.expected.txt +++ b/src/__tests__/fixtures/placeholder-unnamed-attr-escaped/__snapshots__/placeholder-unnamed-attr-escaped.expected.txt @@ -1,7 +1,7 @@ 1╭─
    │ │ │ ││ │ ││ ╰─ closeTag(div).value "div" │ │ │ ││ │ │╰─ closeTag(div) "" - │ │ │ ││ │ ╰─ openTagEnd(div) + │ │ │ ││ │ ╰─ openTagEnd │ │ │ ││ ╰─ attrName "\\${myCustomAttrs}" │ │ │ │╰─ attrValue.value "\"foo\"" │ │ │ ╰─ attrValue "=\"foo\"" diff --git a/src/__tests__/fixtures/placeholder-unnamed-attr-last-concise/__snapshots__/placeholder-unnamed-attr-last-concise.expected.txt b/src/__tests__/fixtures/placeholder-unnamed-attr-last-concise/__snapshots__/placeholder-unnamed-attr-last-concise.expected.txt index e87a8e0d..4c7ee392 100644 --- a/src/__tests__/fixtures/placeholder-unnamed-attr-last-concise/__snapshots__/placeholder-unnamed-attr-last-concise.expected.txt +++ b/src/__tests__/fixtures/placeholder-unnamed-attr-last-concise/__snapshots__/placeholder-unnamed-attr-last-concise.expected.txt @@ -8,8 +8,8 @@ 2╭─ span.bar │ │ │ ││ ├─ closeTag(div) │ │ │ ││ ├─ closeTag(span) - │ │ │ ││ ╰─ openTagEnd(span) + │ │ │ ││ ╰─ openTagEnd │ │ │ │╰─ tagShorthandClass.quasis[0] "bar" │ │ │ ╰─ tagShorthandClass ".bar" │ │ ╰─ tagName "span" - ╰─ ╰─ openTagEnd(div) \ No newline at end of file + ╰─ ╰─ openTagEnd \ No newline at end of file diff --git a/src/__tests__/fixtures/placeholder-unnamed-attr-last-self-closed/__snapshots__/placeholder-unnamed-attr-last-self-closed.expected.txt b/src/__tests__/fixtures/placeholder-unnamed-attr-last-self-closed/__snapshots__/placeholder-unnamed-attr-last-self-closed.expected.txt index 54a3c103..626103e2 100644 --- a/src/__tests__/fixtures/placeholder-unnamed-attr-last-self-closed/__snapshots__/placeholder-unnamed-attr-last-self-closed.expected.txt +++ b/src/__tests__/fixtures/placeholder-unnamed-attr-last-self-closed/__snapshots__/placeholder-unnamed-attr-last-self-closed.expected.txt @@ -1,6 +1,5 @@ 1╭─
    - │ │ │ ││ │ │ │ ╰─ closeTag(div) - │ │ │ ││ │ │ ╰─ openTagEnd(div) "/>" + │ │ │ ││ │ │ ╰─ openTagEnd:selfClosed "/>" │ │ │ ││ │ ╰─ attrSpread.value "myCustomAttrs" │ │ │ ││ ╰─ attrSpread "...myCustomAttrs" │ │ │ │╰─ attrValue.value "\"foo\"" diff --git a/src/__tests__/fixtures/placeholder-unnamed-attr-last/__snapshots__/placeholder-unnamed-attr-last.expected.txt b/src/__tests__/fixtures/placeholder-unnamed-attr-last/__snapshots__/placeholder-unnamed-attr-last.expected.txt index 1c94e9e5..35fea564 100644 --- a/src/__tests__/fixtures/placeholder-unnamed-attr-last/__snapshots__/placeholder-unnamed-attr-last.expected.txt +++ b/src/__tests__/fixtures/placeholder-unnamed-attr-last/__snapshots__/placeholder-unnamed-attr-last.expected.txt @@ -1,7 +1,7 @@ 1╭─
    │ │ │ ││ │ │ ││ ╰─ closeTag(div).value "div" │ │ │ ││ │ │ │╰─ closeTag(div) "
    " - │ │ │ ││ │ │ ╰─ openTagEnd(div) + │ │ │ ││ │ │ ╰─ openTagEnd │ │ │ ││ │ ╰─ attrSpread.value "myCustomAttrs" │ │ │ ││ ╰─ attrSpread "...myCustomAttrs" │ │ │ │╰─ attrValue.value "\"foo\"" diff --git a/src/__tests__/fixtures/placeholder-unnamed-attr/__snapshots__/placeholder-unnamed-attr.expected.txt b/src/__tests__/fixtures/placeholder-unnamed-attr/__snapshots__/placeholder-unnamed-attr.expected.txt index 5b661749..d5889194 100644 --- a/src/__tests__/fixtures/placeholder-unnamed-attr/__snapshots__/placeholder-unnamed-attr.expected.txt +++ b/src/__tests__/fixtures/placeholder-unnamed-attr/__snapshots__/placeholder-unnamed-attr.expected.txt @@ -1,7 +1,7 @@ 1╭─
    │ │ │ ││ │ │ │ ││ ││ ╰─ closeTag(div).value "div" │ │ │ ││ │ │ │ ││ │╰─ closeTag(div) "" - │ │ │ ││ │ │ │ ││ ╰─ openTagEnd(div) + │ │ │ ││ │ │ │ ││ ╰─ openTagEnd │ │ │ ││ │ │ │ │╰─ attrValue.value "\"bar\"" │ │ │ ││ │ │ │ ╰─ attrValue "=\"bar\"" │ │ │ ││ │ │ ╰─ attrName "foo" diff --git a/src/__tests__/fixtures/placeholder-within-script-tag/__snapshots__/placeholder-within-script-tag.expected.txt b/src/__tests__/fixtures/placeholder-within-script-tag/__snapshots__/placeholder-within-script-tag.expected.txt index 741ca98f..dad97363 100644 --- a/src/__tests__/fixtures/placeholder-within-script-tag/__snapshots__/placeholder-within-script-tag.expected.txt +++ b/src/__tests__/fixtures/placeholder-within-script-tag/__snapshots__/placeholder-within-script-tag.expected.txt @@ -3,5 +3,5 @@ │ │ ││ │╰─ closeTag(script) "" │ │ ││ ╰─ text │ │ │╰─ text "Hello " - │ │ ╰─ openTagEnd(script) + │ │ ╰─ openTagEnd ╰─ ╰─ tagName "script" \ No newline at end of file diff --git a/src/__tests__/fixtures/placeholder-within-script-within-string/__snapshots__/placeholder-within-script-within-string.expected.txt b/src/__tests__/fixtures/placeholder-within-script-within-string/__snapshots__/placeholder-within-script-within-string.expected.txt index 4fb62158..c97b28ac 100644 --- a/src/__tests__/fixtures/placeholder-within-script-within-string/__snapshots__/placeholder-within-script-within-string.expected.txt +++ b/src/__tests__/fixtures/placeholder-within-script-within-string/__snapshots__/placeholder-within-script-within-string.expected.txt @@ -3,5 +3,5 @@ │ │ ││ │ ╰─ closeTag(script) "" │ │ ││ ╰─ text "!\")" │ │ │╰─ text "alert(\"Hello " - │ │ ╰─ openTagEnd(script) + │ │ ╰─ openTagEnd ╰─ ╰─ tagName "script" \ No newline at end of file diff --git a/src/__tests__/fixtures/placeholder-within-string-newlines/__snapshots__/placeholder-within-string-newlines.expected.txt b/src/__tests__/fixtures/placeholder-within-string-newlines/__snapshots__/placeholder-within-string-newlines.expected.txt index b6893376..34db9659 100644 --- a/src/__tests__/fixtures/placeholder-within-string-newlines/__snapshots__/placeholder-within-string-newlines.expected.txt +++ b/src/__tests__/fixtures/placeholder-within-string-newlines/__snapshots__/placeholder-within-string-newlines.expected.txt @@ -7,4 +7,4 @@ 3╭─ }">
    │ ││ ╰─ closeTag(custom).value "custom" │ │╰─ closeTag(custom) "
    " - ╰─ ╰─ openTagEnd(custom) \ No newline at end of file + ╰─ ╰─ openTagEnd \ No newline at end of file diff --git a/src/__tests__/fixtures/root-el/__snapshots__/root-el.expected.txt b/src/__tests__/fixtures/root-el/__snapshots__/root-el.expected.txt index 26241be4..ec8340cd 100644 --- a/src/__tests__/fixtures/root-el/__snapshots__/root-el.expected.txt +++ b/src/__tests__/fixtures/root-el/__snapshots__/root-el.expected.txt @@ -1,6 +1,6 @@ 1╭─ var colors=['red', 'green', 'blue'] │ │ │ ││ ├─ closeTag(var) - │ │ │ ││ ╰─ openTagEnd(var) + │ │ │ ││ ╰─ openTagEnd │ │ │ │╰─ attrValue.value "['red', 'green', 'blue']" │ │ │ ╰─ attrValue "=['red', 'green', 'blue']" │ │ ╰─ attrName "colors" diff --git a/src/__tests__/fixtures/root-els/__snapshots__/root-els.expected.txt b/src/__tests__/fixtures/root-els/__snapshots__/root-els.expected.txt index 3d797858..7a736a3e 100644 --- a/src/__tests__/fixtures/root-els/__snapshots__/root-els.expected.txt +++ b/src/__tests__/fixtures/root-els/__snapshots__/root-els.expected.txt @@ -5,10 +5,10 @@ ╰─ ╰─ tagName "div" 2╭─ span class="bar" │ │ │ ││ ├─ closeTag(span) - │ │ │ ││ ╰─ openTagEnd(span) + │ │ │ ││ ╰─ openTagEnd │ │ │ │╰─ attrValue.value "\"bar\"" │ │ │ ╰─ attrValue "=\"bar\"" │ │ ╰─ attrName "class" │ ├─ closeTag(div) - │ ├─ openTagEnd(div) + │ ├─ openTagEnd ╰─ ╰─ tagName "span" \ No newline at end of file diff --git a/src/__tests__/fixtures/script-concise-invalid-nested-tag/__snapshots__/script-concise-invalid-nested-tag.expected.txt b/src/__tests__/fixtures/script-concise-invalid-nested-tag/__snapshots__/script-concise-invalid-nested-tag.expected.txt index f96da76a..a0dae1fd 100644 --- a/src/__tests__/fixtures/script-concise-invalid-nested-tag/__snapshots__/script-concise-invalid-nested-tag.expected.txt +++ b/src/__tests__/fixtures/script-concise-invalid-nested-tag/__snapshots__/script-concise-invalid-nested-tag.expected.txt @@ -2,5 +2,5 @@ ╰─ ╰─ tagName "script" 2╭─ p - This is not allowed │ │ ╰─ error(ILLEGAL_LINE_START:A line within a tag that only allows text content must begin with a "-" character) - ╰─ ╰─ openTagEnd(script) + ╰─ ╰─ openTagEnd 3╰─ div \ No newline at end of file diff --git a/src/__tests__/fixtures/script-concise/__snapshots__/script-concise.expected.txt b/src/__tests__/fixtures/script-concise/__snapshots__/script-concise.expected.txt index 82f3ff10..c09118c6 100644 --- a/src/__tests__/fixtures/script-concise/__snapshots__/script-concise.expected.txt +++ b/src/__tests__/fixtures/script-concise/__snapshots__/script-concise.expected.txt @@ -1,7 +1,7 @@ 1╭─ script ╰─ ╰─ tagName "script" 2╭─ --- - ╰─ ╰─ openTagEnd(script) + ╰─ ╰─ openTagEnd 3╭─ This is text ╰─ ╰─ text "\n This is text\n within the block\n" 4├─ within the block @@ -10,6 +10,6 @@ ╰─ ╰─ text "This should be okay too" 7╭─ div │ │ ├─ closeTag(div) - │ │ ╰─ openTagEnd(div) + │ │ ╰─ openTagEnd │ ├─ closeTag(script) ╰─ ╰─ tagName "div" \ No newline at end of file diff --git a/src/__tests__/fixtures/script-empty-concise/__snapshots__/script-empty-concise.expected.txt b/src/__tests__/fixtures/script-empty-concise/__snapshots__/script-empty-concise.expected.txt index 0d68ef49..2006cb70 100644 --- a/src/__tests__/fixtures/script-empty-concise/__snapshots__/script-empty-concise.expected.txt +++ b/src/__tests__/fixtures/script-empty-concise/__snapshots__/script-empty-concise.expected.txt @@ -5,11 +5,11 @@ │ │ │ │ ╰─ attrValue "=\"http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js\"" │ │ │ ╰─ attrName "src" │ │ ╰─ tagName "script" - ╰─ ╰─ openTagEnd(head) + ╰─ ╰─ openTagEnd 3╭─ lasso-head │ │ │ ├─ closeTag(head) │ │ │ ├─ closeTag(lasso-head) - │ │ │ ╰─ openTagEnd(lasso-head) + │ │ │ ╰─ openTagEnd │ │ ╰─ tagName "lasso-head" │ ├─ closeTag(script) - ╰─ ╰─ openTagEnd(script) \ No newline at end of file + ╰─ ╰─ openTagEnd \ No newline at end of file diff --git a/src/__tests__/fixtures/script-escaped-placeholder/__snapshots__/script-escaped-placeholder.expected.txt b/src/__tests__/fixtures/script-escaped-placeholder/__snapshots__/script-escaped-placeholder.expected.txt index 640e6d96..1e442613 100644 --- a/src/__tests__/fixtures/script-escaped-placeholder/__snapshots__/script-escaped-placeholder.expected.txt +++ b/src/__tests__/fixtures/script-escaped-placeholder/__snapshots__/script-escaped-placeholder.expected.txt @@ -1,5 +1,5 @@ 1╭─ " │ │ │╰─ text "// this is a comment" - │ │ ╰─ openTagEnd(script) + │ │ ╰─ openTagEnd ╰─ ╰─ tagName "script" \ No newline at end of file diff --git a/src/__tests__/fixtures/script-tag-entities/__snapshots__/script-tag-entities.expected.txt b/src/__tests__/fixtures/script-tag-entities/__snapshots__/script-tag-entities.expected.txt index 1eecae0d..d4b52402 100644 --- a/src/__tests__/fixtures/script-tag-entities/__snapshots__/script-tag-entities.expected.txt +++ b/src/__tests__/fixtures/script-tag-entities/__snapshots__/script-tag-entities.expected.txt @@ -3,6 +3,6 @@ │ │ ││ │ ╰─ closeTag(script) "" │ │ ││ ╰─ text "');" │ │ │╰─ text "console.log('
    Hello " - │ │ ╰─ openTagEnd(script) + │ │ ╰─ openTagEnd ╰─ ╰─ tagName "script" 2╰─ \ No newline at end of file diff --git a/src/__tests__/fixtures/script/__snapshots__/script.expected.txt b/src/__tests__/fixtures/script/__snapshots__/script.expected.txt index b4cd8aba..2f31fe9d 100644 --- a/src/__tests__/fixtures/script/__snapshots__/script.expected.txt +++ b/src/__tests__/fixtures/script/__snapshots__/script.expected.txt @@ -1,6 +1,6 @@ 1╭─ │ │ ╰─ closeTag(script).value "script" diff --git a/src/__tests__/fixtures/scriptlet-line-multiline-comments/__snapshots__/scriptlet-line-multiline-comments.expected.txt b/src/__tests__/fixtures/scriptlet-line-multiline-comments/__snapshots__/scriptlet-line-multiline-comments.expected.txt index 019e5c99..fca5b378 100644 --- a/src/__tests__/fixtures/scriptlet-line-multiline-comments/__snapshots__/scriptlet-line-multiline-comments.expected.txt +++ b/src/__tests__/fixtures/scriptlet-line-multiline-comments/__snapshots__/scriptlet-line-multiline-comments.expected.txt @@ -5,7 +5,7 @@ 3├─ */ 4├─ 5╭─
    - │ │ ╰─ openTagEnd(div) + │ │ ╰─ openTagEnd ╰─ ╰─ tagName "div" 6╭─ Hello ╰─ ╰─ text "\n Hello\n" diff --git a/src/__tests__/fixtures/scriptlet-line-no-middle/__snapshots__/scriptlet-line-no-middle.expected.txt b/src/__tests__/fixtures/scriptlet-line-no-middle/__snapshots__/scriptlet-line-no-middle.expected.txt index 42c8dcba..2b175f66 100644 --- a/src/__tests__/fixtures/scriptlet-line-no-middle/__snapshots__/scriptlet-line-no-middle.expected.txt +++ b/src/__tests__/fixtures/scriptlet-line-no-middle/__snapshots__/scriptlet-line-no-middle.expected.txt @@ -1,6 +1,6 @@ 1╭─ tag $ var foo = 123; │ │ │ │ │ │ │ ├─ closeTag(tag) - │ │ │ │ │ │ │ ╰─ openTagEnd(tag) + │ │ │ │ │ │ │ ╰─ openTagEnd │ │ │ │ │ │ ╰─ attrValue.value "123" │ │ │ │ │ ╰─ attrValue "= 123" │ │ │ │ ╰─ attrName "foo" diff --git a/src/__tests__/fixtures/scriptlet-line-trailing-line-comment/__snapshots__/scriptlet-line-trailing-line-comment.expected.txt b/src/__tests__/fixtures/scriptlet-line-trailing-line-comment/__snapshots__/scriptlet-line-trailing-line-comment.expected.txt index eeb82637..bdab76b5 100644 --- a/src/__tests__/fixtures/scriptlet-line-trailing-line-comment/__snapshots__/scriptlet-line-trailing-line-comment.expected.txt +++ b/src/__tests__/fixtures/scriptlet-line-trailing-line-comment/__snapshots__/scriptlet-line-trailing-line-comment.expected.txt @@ -3,7 +3,7 @@ ╰─ ╰─ scriptlet " var str = '' // a string" 2├─ 3╭─
    - │ │ ╰─ openTagEnd(div) + │ │ ╰─ openTagEnd ╰─ ╰─ tagName "div" 4╭─ Hello ╰─ ╰─ text "\n Hello\n" diff --git a/src/__tests__/fixtures/self-closed-tag-attrs/__snapshots__/self-closed-tag-attrs.expected.txt b/src/__tests__/fixtures/self-closed-tag-attrs/__snapshots__/self-closed-tag-attrs.expected.txt index 2a01b860..02333d07 100644 --- a/src/__tests__/fixtures/self-closed-tag-attrs/__snapshots__/self-closed-tag-attrs.expected.txt +++ b/src/__tests__/fixtures/self-closed-tag-attrs/__snapshots__/self-closed-tag-attrs.expected.txt @@ -1,6 +1,5 @@ 1╭─ - │ │ │ ││ │ ││ │ ╰─ closeTag(a) - │ │ │ ││ │ ││ ╰─ openTagEnd(a) "/>" + │ │ │ ││ │ ││ ╰─ openTagEnd:selfClosed "/>" │ │ │ ││ │ │╰─ attrValue.value "\"\"" │ │ │ ││ │ ╰─ attrValue "=\"\"" │ │ │ ││ ╰─ attrName "baz" diff --git a/src/__tests__/fixtures/self-closed-tag/__snapshots__/self-closed-tag.expected.txt b/src/__tests__/fixtures/self-closed-tag/__snapshots__/self-closed-tag.expected.txt index b6845eae..f3e10fbb 100644 --- a/src/__tests__/fixtures/self-closed-tag/__snapshots__/self-closed-tag.expected.txt +++ b/src/__tests__/fixtures/self-closed-tag/__snapshots__/self-closed-tag.expected.txt @@ -1,4 +1,3 @@ 1╭─ - │ │ │ ╰─ closeTag(a) - │ │ ╰─ openTagEnd(a) "/>" + │ │ ╰─ openTagEnd:selfClosed "/>" ╰─ ╰─ tagName \ No newline at end of file diff --git a/src/__tests__/fixtures/self-closing-open-tag-only/__snapshots__/self-closing-open-tag-only.expected.txt b/src/__tests__/fixtures/self-closing-open-tag-only/__snapshots__/self-closing-open-tag-only.expected.txt index f338ba1c..728d8812 100644 --- a/src/__tests__/fixtures/self-closing-open-tag-only/__snapshots__/self-closing-open-tag-only.expected.txt +++ b/src/__tests__/fixtures/self-closing-open-tag-only/__snapshots__/self-closing-open-tag-only.expected.txt @@ -1,8 +1,7 @@ 1╭─ - │ │ │ ││ ╰─ openTagEnd(img) "/>" + │ │ │ ││ ╰─ openTagEnd:selfClosed "/>" │ │ │ │╰─ attrValue.value "\"foo.png\"" │ │ │ ╰─ attrValue "=\"foo.png\"" │ │ ╰─ attrName "src" ╰─ ╰─ tagName "img" -2╭─ - ╰─ ╰─ closeTag(img) \ No newline at end of file +2╰─ \ No newline at end of file diff --git a/src/__tests__/fixtures/semicolon-concise/__snapshots__/semicolon-concise.expected.txt b/src/__tests__/fixtures/semicolon-concise/__snapshots__/semicolon-concise.expected.txt index 01249dd3..5cb52c59 100644 --- a/src/__tests__/fixtures/semicolon-concise/__snapshots__/semicolon-concise.expected.txt +++ b/src/__tests__/fixtures/semicolon-concise/__snapshots__/semicolon-concise.expected.txt @@ -5,10 +5,10 @@ ╰─ ╰─ tagName "var" 2╭─ var pageTitle = "hi"; │ │ │ │ │ ├─ closeTag(var) - │ │ │ │ │ ╰─ openTagEnd(var) + │ │ │ │ │ ╰─ openTagEnd │ │ │ │ ╰─ attrValue.value "\"hi\"" │ │ │ ╰─ attrValue "= \"hi\"" │ │ ╰─ attrName "pageTitle" │ ├─ closeTag(var) - │ ├─ openTagEnd(var) + │ ├─ openTagEnd ╰─ ╰─ tagName "var" \ No newline at end of file diff --git a/src/__tests__/fixtures/shorthand-class-dynamic-literal-prefix/__snapshots__/shorthand-class-dynamic-literal-prefix.expected.txt b/src/__tests__/fixtures/shorthand-class-dynamic-literal-prefix/__snapshots__/shorthand-class-dynamic-literal-prefix.expected.txt index f8fcb285..366ce87f 100644 --- a/src/__tests__/fixtures/shorthand-class-dynamic-literal-prefix/__snapshots__/shorthand-class-dynamic-literal-prefix.expected.txt +++ b/src/__tests__/fixtures/shorthand-class-dynamic-literal-prefix/__snapshots__/shorthand-class-dynamic-literal-prefix.expected.txt @@ -1,7 +1,7 @@ 1╭─ .bar${data.foo} │ ││ │ │╰─ tagShorthandClass.quasis[1] │ ││ │ ├─ closeTag() - │ ││ │ ╰─ openTagEnd() + │ ││ │ ╰─ openTagEnd │ ││ ╰─ tagShorthandClass.expressions[0] "${data.foo}" │ │╰─ tagShorthandClass.quasis[0] "bar" │ ├─ tagShorthandClass ".bar${data.foo}" diff --git a/src/__tests__/fixtures/shorthand-class-dynamic-literal-suffix/__snapshots__/shorthand-class-dynamic-literal-suffix.expected.txt b/src/__tests__/fixtures/shorthand-class-dynamic-literal-suffix/__snapshots__/shorthand-class-dynamic-literal-suffix.expected.txt index df29674f..0dc72b40 100644 --- a/src/__tests__/fixtures/shorthand-class-dynamic-literal-suffix/__snapshots__/shorthand-class-dynamic-literal-suffix.expected.txt +++ b/src/__tests__/fixtures/shorthand-class-dynamic-literal-suffix/__snapshots__/shorthand-class-dynamic-literal-suffix.expected.txt @@ -1,6 +1,6 @@ 1╭─ .${data.foo}-bar │ ││ │ ├─ closeTag() - │ ││ │ ╰─ openTagEnd() + │ ││ │ ╰─ openTagEnd │ ││ ╰─ tagShorthandClass.quasis[1] "bar" │ │├─ tagShorthandClass.expressions[0] "${data.foo}" │ │╰─ tagShorthandClass.quasis[0] diff --git a/src/__tests__/fixtures/shorthand-class-dynamic/__snapshots__/shorthand-class-dynamic.expected.txt b/src/__tests__/fixtures/shorthand-class-dynamic/__snapshots__/shorthand-class-dynamic.expected.txt index a38bf0c9..e5146c39 100644 --- a/src/__tests__/fixtures/shorthand-class-dynamic/__snapshots__/shorthand-class-dynamic.expected.txt +++ b/src/__tests__/fixtures/shorthand-class-dynamic/__snapshots__/shorthand-class-dynamic.expected.txt @@ -1,7 +1,7 @@ 1╭─ span.${data.foo} │ │ ││ │╰─ tagShorthandClass.quasis[1] │ │ ││ ├─ closeTag(span) - │ │ ││ ╰─ openTagEnd(span) + │ │ ││ ╰─ openTagEnd │ │ │├─ tagShorthandClass.expressions[0] "${data.foo}" │ │ │╰─ tagShorthandClass.quasis[0] │ │ ╰─ tagShorthandClass ".${data.foo}" diff --git a/src/__tests__/fixtures/shorthand-class-self-closed/__snapshots__/shorthand-class-self-closed.expected.txt b/src/__tests__/fixtures/shorthand-class-self-closed/__snapshots__/shorthand-class-self-closed.expected.txt index 063496b5..195fc9f4 100644 --- a/src/__tests__/fixtures/shorthand-class-self-closed/__snapshots__/shorthand-class-self-closed.expected.txt +++ b/src/__tests__/fixtures/shorthand-class-self-closed/__snapshots__/shorthand-class-self-closed.expected.txt @@ -1,8 +1,8 @@ 1╭─ - │ │ ╰─ openTagEnd(span) + │ │ ╰─ openTagEnd ╰─ ╰─ tagName "span" 2╭─ - │ │ │ ││ ╰─ openTagEnd(div) "/>" + │ │ │ ││ ╰─ openTagEnd:selfClosed "/>" │ │ │ │╰─ tagShorthandClass.quasis[0] "color" │ │ │ ╰─ tagShorthandClass ".color" │ │ ╰─ tagName "div" @@ -10,5 +10,4 @@ 3╭─ │ │ ╰─ closeTag(span).value "span" │ ├─ text "\n" - │ ├─ closeTag(div) ╰─ ╰─ closeTag(span) "" \ No newline at end of file diff --git a/src/__tests__/fixtures/shorthand-closing-html/__snapshots__/shorthand-closing-html.expected.txt b/src/__tests__/fixtures/shorthand-closing-html/__snapshots__/shorthand-closing-html.expected.txt index 151749e1..14e45409 100644 --- a/src/__tests__/fixtures/shorthand-closing-html/__snapshots__/shorthand-closing-html.expected.txt +++ b/src/__tests__/fixtures/shorthand-closing-html/__snapshots__/shorthand-closing-html.expected.txt @@ -1,8 +1,8 @@ 1╭─
  • - │ │ ╰─ openTagEnd(li) + │ │ ╰─ openTagEnd ╰─ ╰─ tagName "li" 2╭─ - │ │ │││ │ ││ │ ││ ╰─ openTagEnd(a) + │ │ │││ │ ││ │ ││ ╰─ openTagEnd │ │ │││ │ ││ │ │╰─ attrValue.value "href" │ │ │││ │ ││ │ ╰─ attrValue "=href" │ │ │││ │ ││ ╰─ attrName "href" diff --git a/src/__tests__/fixtures/shorthand-closing-html2/__snapshots__/shorthand-closing-html2.expected.txt b/src/__tests__/fixtures/shorthand-closing-html2/__snapshots__/shorthand-closing-html2.expected.txt index 707bb067..8211fbb7 100644 --- a/src/__tests__/fixtures/shorthand-closing-html2/__snapshots__/shorthand-closing-html2.expected.txt +++ b/src/__tests__/fixtures/shorthand-closing-html2/__snapshots__/shorthand-closing-html2.expected.txt @@ -1,5 +1,5 @@ 1╭─ <#foo> - │ ││ ╰─ openTagEnd() + │ ││ ╰─ openTagEnd │ │╰─ tagShorthandId.quasis[0] "foo" │ ├─ tagShorthandId "#foo" ╰─ ╰─ tagName diff --git a/src/__tests__/fixtures/shorthand-closing-html3/__snapshots__/shorthand-closing-html3.expected.txt b/src/__tests__/fixtures/shorthand-closing-html3/__snapshots__/shorthand-closing-html3.expected.txt index c6a509db..fb7c4a29 100644 --- a/src/__tests__/fixtures/shorthand-closing-html3/__snapshots__/shorthand-closing-html3.expected.txt +++ b/src/__tests__/fixtures/shorthand-closing-html3/__snapshots__/shorthand-closing-html3.expected.txt @@ -1,5 +1,5 @@ 1╭─ <#foo> - │ ││ ╰─ openTagEnd() + │ ││ ╰─ openTagEnd │ │╰─ tagShorthandId.quasis[0] "foo" │ ├─ tagShorthandId "#foo" ╰─ ╰─ tagName diff --git a/src/__tests__/fixtures/shorthand-div-id-class-multiple/__snapshots__/shorthand-div-id-class-multiple.expected.txt b/src/__tests__/fixtures/shorthand-div-id-class-multiple/__snapshots__/shorthand-div-id-class-multiple.expected.txt index 5288a49f..fb677e0d 100644 --- a/src/__tests__/fixtures/shorthand-div-id-class-multiple/__snapshots__/shorthand-div-id-class-multiple.expected.txt +++ b/src/__tests__/fixtures/shorthand-div-id-class-multiple/__snapshots__/shorthand-div-id-class-multiple.expected.txt @@ -1,6 +1,6 @@ 1╭─ div#foo.bar.baz │ │ ││ ││ ││ ├─ closeTag(div) - │ │ ││ ││ ││ ╰─ openTagEnd(div) + │ │ ││ ││ ││ ╰─ openTagEnd │ │ ││ ││ │╰─ tagShorthandClass.quasis[0] "baz" │ │ ││ ││ ╰─ tagShorthandClass ".baz" │ │ ││ │╰─ tagShorthandClass.quasis[0] "bar" diff --git a/src/__tests__/fixtures/shorthand-div-id-class/__snapshots__/shorthand-div-id-class.expected.txt b/src/__tests__/fixtures/shorthand-div-id-class/__snapshots__/shorthand-div-id-class.expected.txt index 9b3feb23..151d96c8 100644 --- a/src/__tests__/fixtures/shorthand-div-id-class/__snapshots__/shorthand-div-id-class.expected.txt +++ b/src/__tests__/fixtures/shorthand-div-id-class/__snapshots__/shorthand-div-id-class.expected.txt @@ -1,6 +1,6 @@ 1╭─ div#foo.bar │ │ ││ ││ ├─ closeTag(div) - │ │ ││ ││ ╰─ openTagEnd(div) + │ │ ││ ││ ╰─ openTagEnd │ │ ││ │╰─ tagShorthandClass.quasis[0] "bar" │ │ ││ ╰─ tagShorthandClass ".bar" │ │ │╰─ tagShorthandId.quasis[0] "foo" diff --git a/src/__tests__/fixtures/shorthand-div-id/__snapshots__/shorthand-div-id.expected.txt b/src/__tests__/fixtures/shorthand-div-id/__snapshots__/shorthand-div-id.expected.txt index b00f050a..ba2c380f 100644 --- a/src/__tests__/fixtures/shorthand-div-id/__snapshots__/shorthand-div-id.expected.txt +++ b/src/__tests__/fixtures/shorthand-div-id/__snapshots__/shorthand-div-id.expected.txt @@ -1,6 +1,6 @@ 1╭─ div#foo │ │ ││ ├─ closeTag(div) - │ │ ││ ╰─ openTagEnd(div) + │ │ ││ ╰─ openTagEnd │ │ │╰─ tagShorthandId.quasis[0] "foo" │ │ ╰─ tagShorthandId "#foo" ╰─ ╰─ tagName "div" \ No newline at end of file diff --git a/src/__tests__/fixtures/shorthand-id-class-html/__snapshots__/shorthand-id-class-html.expected.txt b/src/__tests__/fixtures/shorthand-id-class-html/__snapshots__/shorthand-id-class-html.expected.txt index 4c90974d..58aaa56f 100644 --- a/src/__tests__/fixtures/shorthand-id-class-html/__snapshots__/shorthand-id-class-html.expected.txt +++ b/src/__tests__/fixtures/shorthand-id-class-html/__snapshots__/shorthand-id-class-html.expected.txt @@ -1,5 +1,5 @@ 1╭─ <#foo.bar> - │ ││ ││ ╰─ openTagEnd() + │ ││ ││ ╰─ openTagEnd │ ││ │╰─ tagShorthandClass.quasis[0] "bar" │ ││ ╰─ tagShorthandClass ".bar" │ │╰─ tagShorthandId.quasis[0] "foo" diff --git a/src/__tests__/fixtures/shorthand-id-class/__snapshots__/shorthand-id-class.expected.txt b/src/__tests__/fixtures/shorthand-id-class/__snapshots__/shorthand-id-class.expected.txt index a086b143..d8ad7f8c 100644 --- a/src/__tests__/fixtures/shorthand-id-class/__snapshots__/shorthand-id-class.expected.txt +++ b/src/__tests__/fixtures/shorthand-id-class/__snapshots__/shorthand-id-class.expected.txt @@ -1,6 +1,6 @@ 1╭─ #foo.bar │ ││ ││ ├─ closeTag() - │ ││ ││ ╰─ openTagEnd() + │ ││ ││ ╰─ openTagEnd │ ││ │╰─ tagShorthandClass.quasis[0] "bar" │ ││ ╰─ tagShorthandClass ".bar" │ │╰─ tagShorthandId.quasis[0] "foo" diff --git a/src/__tests__/fixtures/shorthand-id-dynamic-literal-prefix/__snapshots__/shorthand-id-dynamic-literal-prefix.expected.txt b/src/__tests__/fixtures/shorthand-id-dynamic-literal-prefix/__snapshots__/shorthand-id-dynamic-literal-prefix.expected.txt index 3b7efc12..041fb8d1 100644 --- a/src/__tests__/fixtures/shorthand-id-dynamic-literal-prefix/__snapshots__/shorthand-id-dynamic-literal-prefix.expected.txt +++ b/src/__tests__/fixtures/shorthand-id-dynamic-literal-prefix/__snapshots__/shorthand-id-dynamic-literal-prefix.expected.txt @@ -1,7 +1,7 @@ 1╭─ #bar${data.foo} │ ││ │ │╰─ tagShorthandId.quasis[1] │ ││ │ ├─ closeTag() - │ ││ │ ╰─ openTagEnd() + │ ││ │ ╰─ openTagEnd │ ││ ╰─ tagShorthandId.expressions[0] "${data.foo}" │ │╰─ tagShorthandId.quasis[0] "bar" │ ├─ tagShorthandId "#bar${data.foo}" diff --git a/src/__tests__/fixtures/shorthand-id-dynamic-literal-suffix/__snapshots__/shorthand-id-dynamic-literal-suffix.expected.txt b/src/__tests__/fixtures/shorthand-id-dynamic-literal-suffix/__snapshots__/shorthand-id-dynamic-literal-suffix.expected.txt index 83d64b95..11a12956 100644 --- a/src/__tests__/fixtures/shorthand-id-dynamic-literal-suffix/__snapshots__/shorthand-id-dynamic-literal-suffix.expected.txt +++ b/src/__tests__/fixtures/shorthand-id-dynamic-literal-suffix/__snapshots__/shorthand-id-dynamic-literal-suffix.expected.txt @@ -1,6 +1,6 @@ 1╭─ #${data.foo}-bar │ ││ │ ├─ closeTag() - │ ││ │ ╰─ openTagEnd() + │ ││ │ ╰─ openTagEnd │ ││ ╰─ tagShorthandId.quasis[1] "bar" │ │├─ tagShorthandId.expressions[0] "${data.foo}" │ │╰─ tagShorthandId.quasis[0] diff --git a/src/__tests__/fixtures/shorthand-id-dynamic/__snapshots__/shorthand-id-dynamic.expected.txt b/src/__tests__/fixtures/shorthand-id-dynamic/__snapshots__/shorthand-id-dynamic.expected.txt index 7e8481b1..0f0e55b0 100644 --- a/src/__tests__/fixtures/shorthand-id-dynamic/__snapshots__/shorthand-id-dynamic.expected.txt +++ b/src/__tests__/fixtures/shorthand-id-dynamic/__snapshots__/shorthand-id-dynamic.expected.txt @@ -1,7 +1,7 @@ 1╭─ span#${data.foo} │ │ ││ │╰─ tagShorthandId.quasis[1] │ │ ││ ├─ closeTag(span) - │ │ ││ ╰─ openTagEnd(span) + │ │ ││ ╰─ openTagEnd │ │ │├─ tagShorthandId.expressions[0] "${data.foo}" │ │ │╰─ tagShorthandId.quasis[0] │ │ ╰─ tagShorthandId "#${data.foo}" diff --git a/src/__tests__/fixtures/shorthand-id-self-closed/__snapshots__/shorthand-id-self-closed.expected.txt b/src/__tests__/fixtures/shorthand-id-self-closed/__snapshots__/shorthand-id-self-closed.expected.txt index 8abd3242..ec4a9401 100644 --- a/src/__tests__/fixtures/shorthand-id-self-closed/__snapshots__/shorthand-id-self-closed.expected.txt +++ b/src/__tests__/fixtures/shorthand-id-self-closed/__snapshots__/shorthand-id-self-closed.expected.txt @@ -1,8 +1,8 @@ 1╭─ - │ │ ╰─ openTagEnd(span) + │ │ ╰─ openTagEnd ╰─ ╰─ tagName "span" 2╭─ - │ │ │ ││ ╰─ openTagEnd(div) "/>" + │ │ │ ││ ╰─ openTagEnd:selfClosed "/>" │ │ │ │╰─ tagShorthandId.quasis[0] "foo" │ │ │ ╰─ tagShorthandId "#foo" │ │ ╰─ tagName "div" @@ -10,5 +10,4 @@ 3╭─ │ │ ╰─ closeTag(span).value "span" │ ├─ text "\n" - │ ├─ closeTag(div) ╰─ ╰─ closeTag(span) "" \ No newline at end of file diff --git a/src/__tests__/fixtures/shorthand-id/__snapshots__/shorthand-id.expected.txt b/src/__tests__/fixtures/shorthand-id/__snapshots__/shorthand-id.expected.txt index 5eeca481..a0bf7409 100644 --- a/src/__tests__/fixtures/shorthand-id/__snapshots__/shorthand-id.expected.txt +++ b/src/__tests__/fixtures/shorthand-id/__snapshots__/shorthand-id.expected.txt @@ -1,6 +1,6 @@ 1╭─ #foo │ ││ ├─ closeTag() - │ ││ ╰─ openTagEnd() + │ ││ ╰─ openTagEnd │ │╰─ tagShorthandId.quasis[0] "foo" │ ├─ tagShorthandId "#foo" ╰─ ╰─ tagName \ No newline at end of file diff --git a/src/__tests__/fixtures/shorthand-mixed-concise/__snapshots__/shorthand-mixed-concise.expected.txt b/src/__tests__/fixtures/shorthand-mixed-concise/__snapshots__/shorthand-mixed-concise.expected.txt index 037c2c4a..8bcc1bc7 100644 --- a/src/__tests__/fixtures/shorthand-mixed-concise/__snapshots__/shorthand-mixed-concise.expected.txt +++ b/src/__tests__/fixtures/shorthand-mixed-concise/__snapshots__/shorthand-mixed-concise.expected.txt @@ -1,6 +1,6 @@ 1╭─ #foo -- Hello │ ││ │ ╰─ text "Hello" - │ ││ ╰─ openTagEnd() + │ ││ ╰─ openTagEnd │ │╰─ tagShorthandId.quasis[0] "foo" │ ├─ tagShorthandId "#foo" ╰─ ╰─ tagName @@ -19,20 +19,20 @@ │ ││ ╰─ tagShorthandClass ".baz" │ │╰─ tagShorthandClass.quasis[0] "bar" │ ├─ closeTag() - │ ├─ openTagEnd() + │ ├─ openTagEnd │ ├─ tagShorthandClass ".bar" ╰─ ╰─ tagName 4╭─ div.foo │ │ │╰─ tagShorthandClass.quasis[0] "foo" │ │ ╰─ tagShorthandClass ".foo" │ ├─ closeTag() - │ ├─ openTagEnd() + │ ├─ openTagEnd ╰─ ╰─ tagName "div" 5╭─ span.foo │ │ ││ ├─ closeTag(span) - │ │ ││ ╰─ openTagEnd(span) + │ │ ││ ╰─ openTagEnd │ │ │╰─ tagShorthandClass.quasis[0] "foo" │ │ ╰─ tagShorthandClass ".foo" │ ├─ closeTag(div) - │ ├─ openTagEnd(div) + │ ├─ openTagEnd ╰─ ╰─ tagName "span" \ No newline at end of file diff --git a/src/__tests__/fixtures/shorthand-mixed/__snapshots__/shorthand-mixed.expected.txt b/src/__tests__/fixtures/shorthand-mixed/__snapshots__/shorthand-mixed.expected.txt index 8fc55671..9ba14394 100644 --- a/src/__tests__/fixtures/shorthand-mixed/__snapshots__/shorthand-mixed.expected.txt +++ b/src/__tests__/fixtures/shorthand-mixed/__snapshots__/shorthand-mixed.expected.txt @@ -2,14 +2,14 @@ │ ││ ││ │ ╰─ closeTag().value │ ││ ││ ╰─ closeTag() "" │ ││ │╰─ text "Hello" - │ ││ ╰─ openTagEnd() + │ ││ ╰─ openTagEnd │ │╰─ tagShorthandId.quasis[0] "foo" │ ├─ tagShorthandId "#foo" ╰─ ╰─ tagName 2╭─ <#foo.bar name="Frank"> │ ││ ││ │ ││ ││ ╰─ closeTag().value │ ││ ││ │ ││ │╰─ closeTag() "" - │ ││ ││ │ ││ ╰─ openTagEnd() + │ ││ ││ │ ││ ╰─ openTagEnd │ ││ ││ │ │╰─ attrValue.value "\"Frank\"" │ ││ ││ │ ╰─ attrValue "=\"Frank\"" │ ││ ││ ╰─ attrName "name" @@ -21,7 +21,7 @@ 3╭─ <.bar.baz> │ ││ ││ ││ ╰─ closeTag().value ".bar.baz" │ ││ ││ │╰─ closeTag() "" - │ ││ ││ ╰─ openTagEnd() + │ ││ ││ ╰─ openTagEnd │ ││ │╰─ tagShorthandClass.quasis[0] "baz" │ ││ ╰─ tagShorthandClass ".baz" │ │╰─ tagShorthandClass.quasis[0] "bar" @@ -30,14 +30,14 @@ 4╭─ │ │ ││ ││ ╰─ closeTag(div).value │ │ ││ │╰─ closeTag(div) "" - │ │ ││ ╰─ openTagEnd(div) + │ │ ││ ╰─ openTagEnd │ │ │╰─ tagShorthandClass.quasis[0] "foo" │ │ ╰─ tagShorthandClass ".foo" ╰─ ╰─ tagName "div" 5╭─ │ │ ││ ││ ╰─ closeTag(span).value "span.foo" │ │ ││ │╰─ closeTag(span) "" - │ │ ││ ╰─ openTagEnd(span) + │ │ ││ ╰─ openTagEnd │ │ │╰─ tagShorthandClass.quasis[0] "foo" │ │ ╰─ tagShorthandClass ".foo" ╰─ ╰─ tagName "span" \ No newline at end of file diff --git a/src/__tests__/fixtures/single-line-text-block-nested/__snapshots__/single-line-text-block-nested.expected.txt b/src/__tests__/fixtures/single-line-text-block-nested/__snapshots__/single-line-text-block-nested.expected.txt index 67258cd2..4dda43ac 100644 --- a/src/__tests__/fixtures/single-line-text-block-nested/__snapshots__/single-line-text-block-nested.expected.txt +++ b/src/__tests__/fixtures/single-line-text-block-nested/__snapshots__/single-line-text-block-nested.expected.txt @@ -2,7 +2,7 @@ ╰─ ╰─ tagName 2╭─ -- Line 1 │ │ ╰─ text "Line 1" - ╰─ ╰─ openTagEnd(p) + ╰─ ╰─ openTagEnd 3╭─ -- Line 2 │ │ ╰─ closeTag(p) ╰─ ╰─ text "Line 2" \ No newline at end of file diff --git a/src/__tests__/fixtures/single-line-text-block-sibling/__snapshots__/single-line-text-block-sibling.expected.txt b/src/__tests__/fixtures/single-line-text-block-sibling/__snapshots__/single-line-text-block-sibling.expected.txt index 742d8c6e..62541650 100644 --- a/src/__tests__/fixtures/single-line-text-block-sibling/__snapshots__/single-line-text-block-sibling.expected.txt +++ b/src/__tests__/fixtures/single-line-text-block-sibling/__snapshots__/single-line-text-block-sibling.expected.txt @@ -2,7 +2,7 @@ ╰─ ╰─ tagName 2╭─ -- Paragraph: Line 1 │ │ ╰─ text "Paragraph: Line 1" - ╰─ ╰─ openTagEnd(p) + ╰─ ╰─ openTagEnd 3╭─ -- Paragraph: Line 2 ╰─ ╰─ text "Paragraph: Line 2" 4╭─ -- Root: Line 1 diff --git a/src/__tests__/fixtures/statement-concise-only/__snapshots__/statement-concise-only.expected.txt b/src/__tests__/fixtures/statement-concise-only/__snapshots__/statement-concise-only.expected.txt index 8df2ebcd..2fcc7d52 100644 --- a/src/__tests__/fixtures/statement-concise-only/__snapshots__/statement-concise-only.expected.txt +++ b/src/__tests__/fixtures/statement-concise-only/__snapshots__/statement-concise-only.expected.txt @@ -1,3 +1,4 @@ 1╭─ - ╰─ ╰─ error(RESERVED_TAG_NAME:The "static" tag is reserved and cannot be used as an HTML tag.) "static" + │ ├─ error(RESERVED_TAG_NAME:The "static" tag is reserved and cannot be used as an HTML tag.) "static" + ╰─ ╰─ tagName "static" 2╰─ \ No newline at end of file diff --git a/src/__tests__/fixtures/statement-root-only/__snapshots__/statement-root-only.expected.txt b/src/__tests__/fixtures/statement-root-only/__snapshots__/statement-root-only.expected.txt index 129bec7b..affcc23b 100644 --- a/src/__tests__/fixtures/statement-root-only/__snapshots__/statement-root-only.expected.txt +++ b/src/__tests__/fixtures/statement-root-only/__snapshots__/statement-root-only.expected.txt @@ -1,6 +1,7 @@ 1╭─ div ╰─ ╰─ tagName "div" 2╭─ static const x = 1 - │ │ ╰─ error(ROOT_TAG_ONLY:"static" can only be used at the root of the template.) "static" - ╰─ ╰─ openTagEnd(div) + │ │ ├─ error(ROOT_TAG_ONLY:"static" can only be used at the root of the template.) "static" + │ │ ╰─ tagName "static" + ╰─ ╰─ openTagEnd 3╰─ \ No newline at end of file diff --git a/src/__tests__/fixtures/stray-special-chars/__snapshots__/stray-special-chars.expected.txt b/src/__tests__/fixtures/stray-special-chars/__snapshots__/stray-special-chars.expected.txt index 6e76d0dd..c1d2b8c8 100644 --- a/src/__tests__/fixtures/stray-special-chars/__snapshots__/stray-special-chars.expected.txt +++ b/src/__tests__/fixtures/stray-special-chars/__snapshots__/stray-special-chars.expected.txt @@ -2,5 +2,5 @@ │ │││ │ ╰─ closeTag(a).value │ │││ ╰─ closeTag(a) "" │ ││╰─ text "1 < > <> 2<" - │ │╰─ openTagEnd(a) + │ │╰─ openTagEnd ╰─ ╰─ tagName \ No newline at end of file diff --git a/src/__tests__/fixtures/strip-bom/__snapshots__/strip-bom.expected.txt b/src/__tests__/fixtures/strip-bom/__snapshots__/strip-bom.expected.txt index 08a9ecc9..8778d616 100644 --- a/src/__tests__/fixtures/strip-bom/__snapshots__/strip-bom.expected.txt +++ b/src/__tests__/fixtures/strip-bom/__snapshots__/strip-bom.expected.txt @@ -1,8 +1,7 @@ 1╭─  - │ │ │ ││ ╰─ openTagEnd(lasso-page) "/>" + │ │ │ ││ ╰─ openTagEnd:selfClosed "/>" │ │ │ │╰─ attrValue.value "\"./browser.json\"" │ │ │ ╰─ attrValue "=\"./browser.json\"" │ │ ╰─ attrName "package-path" ╰─ ╰─ tagName "lasso-page" -2╭─ - ╰─ ╰─ closeTag(lasso-page) \ No newline at end of file +2╰─ \ No newline at end of file diff --git a/src/__tests__/fixtures/tag-name-expression-literal-prefix-attrs/__snapshots__/tag-name-expression-literal-prefix-attrs.expected.txt b/src/__tests__/fixtures/tag-name-expression-literal-prefix-attrs/__snapshots__/tag-name-expression-literal-prefix-attrs.expected.txt index 9b6848cb..a8a1a78e 100644 --- a/src/__tests__/fixtures/tag-name-expression-literal-prefix-attrs/__snapshots__/tag-name-expression-literal-prefix-attrs.expected.txt +++ b/src/__tests__/fixtures/tag-name-expression-literal-prefix-attrs/__snapshots__/tag-name-expression-literal-prefix-attrs.expected.txt @@ -1,5 +1,5 @@ 1╭─ - │ │ │ │ ││ ╰─ openTagEnd(foo-${bar}) + │ │ │ │ ││ ╰─ openTagEnd │ │ │ │ │╰─ attrValue.value "\"world\"" │ │ │ │ ╰─ attrValue "=\"world\"" │ │ │ ├─ attrName "hello" diff --git a/src/__tests__/fixtures/tag-name-expression-literal-prefix-suffix/__snapshots__/tag-name-expression-literal-prefix-suffix.expected.txt b/src/__tests__/fixtures/tag-name-expression-literal-prefix-suffix/__snapshots__/tag-name-expression-literal-prefix-suffix.expected.txt index 1edc74e1..0afa11ed 100644 --- a/src/__tests__/fixtures/tag-name-expression-literal-prefix-suffix/__snapshots__/tag-name-expression-literal-prefix-suffix.expected.txt +++ b/src/__tests__/fixtures/tag-name-expression-literal-prefix-suffix/__snapshots__/tag-name-expression-literal-prefix-suffix.expected.txt @@ -1,5 +1,5 @@ 1╭─ - │ │ │ │ ╰─ openTagEnd(foo-${bar}-baz) + │ │ │ │ ╰─ openTagEnd │ │ │ ╰─ tagName.quasis[1] "baz" │ │ ╰─ tagName.expressions[0] "${bar}" │ ├─ tagName.quasis[0] "foo-" diff --git a/src/__tests__/fixtures/tag-name-expression-literal-prefix/__snapshots__/tag-name-expression-literal-prefix.expected.txt b/src/__tests__/fixtures/tag-name-expression-literal-prefix/__snapshots__/tag-name-expression-literal-prefix.expected.txt index ad0bb31b..45fc0562 100644 --- a/src/__tests__/fixtures/tag-name-expression-literal-prefix/__snapshots__/tag-name-expression-literal-prefix.expected.txt +++ b/src/__tests__/fixtures/tag-name-expression-literal-prefix/__snapshots__/tag-name-expression-literal-prefix.expected.txt @@ -1,5 +1,5 @@ 1╭─ - │ │ │ ╰─ openTagEnd(foo-${bar}) + │ │ │ ╰─ openTagEnd │ │ ╰─ tagName.expressions[0] "${bar}" │ ├─ tagName.quasis[0] "foo-" ╰─ ╰─ tagName "foo-${bar}" diff --git a/src/__tests__/fixtures/tag-name-expression-literal-suffix/__snapshots__/tag-name-expression-literal-suffix.expected.txt b/src/__tests__/fixtures/tag-name-expression-literal-suffix/__snapshots__/tag-name-expression-literal-suffix.expected.txt index 92e3d6f7..4387131b 100644 --- a/src/__tests__/fixtures/tag-name-expression-literal-suffix/__snapshots__/tag-name-expression-literal-suffix.expected.txt +++ b/src/__tests__/fixtures/tag-name-expression-literal-suffix/__snapshots__/tag-name-expression-literal-suffix.expected.txt @@ -1,5 +1,5 @@ 1╭─ <${foo}-bar> - │ │ │ ╰─ openTagEnd(${foo}-bar) + │ │ │ ╰─ openTagEnd │ │ ╰─ tagName.quasis[1] "bar" │ ├─ tagName.expressions[0] "${foo}" │ ├─ tagName.quasis[0] diff --git a/src/__tests__/fixtures/tag-name-expression-shorthand-id/__snapshots__/tag-name-expression-shorthand-id.expected.txt b/src/__tests__/fixtures/tag-name-expression-shorthand-id/__snapshots__/tag-name-expression-shorthand-id.expected.txt index 60ce6e78..1dd4e980 100644 --- a/src/__tests__/fixtures/tag-name-expression-shorthand-id/__snapshots__/tag-name-expression-shorthand-id.expected.txt +++ b/src/__tests__/fixtures/tag-name-expression-shorthand-id/__snapshots__/tag-name-expression-shorthand-id.expected.txt @@ -1,7 +1,7 @@ 1╭─ <${myTagName}#foo> │ │ ││ ││ ╰─ closeTag(${myTagName}).value │ │ ││ │╰─ closeTag(${myTagName}) "" - │ │ ││ ╰─ openTagEnd(${myTagName}) + │ │ ││ ╰─ openTagEnd │ │ │├─ tagShorthandId.quasis[0] "foo" │ │ │╰─ tagName.quasis[1] │ │ ╰─ tagShorthandId "#foo" diff --git a/src/__tests__/fixtures/tag-name-expression-simple-empty-close/__snapshots__/tag-name-expression-simple-empty-close.expected.txt b/src/__tests__/fixtures/tag-name-expression-simple-empty-close/__snapshots__/tag-name-expression-simple-empty-close.expected.txt index 7e6b3e61..1c7f5dfc 100644 --- a/src/__tests__/fixtures/tag-name-expression-simple-empty-close/__snapshots__/tag-name-expression-simple-empty-close.expected.txt +++ b/src/__tests__/fixtures/tag-name-expression-simple-empty-close/__snapshots__/tag-name-expression-simple-empty-close.expected.txt @@ -1,5 +1,5 @@ 1╭─ <${foo}> - │ │ ╰─ openTagEnd(${foo}) + │ │ ╰─ openTagEnd │ ├─ tagName.expressions[0] "${foo}" │ ├─ tagName.quasis[0] ╰─ ╰─ tagName "${foo}" diff --git a/src/__tests__/fixtures/tag-name-expression-simple/__snapshots__/tag-name-expression-simple.expected.txt b/src/__tests__/fixtures/tag-name-expression-simple/__snapshots__/tag-name-expression-simple.expected.txt index f94eccc7..8ea09e7d 100644 --- a/src/__tests__/fixtures/tag-name-expression-simple/__snapshots__/tag-name-expression-simple.expected.txt +++ b/src/__tests__/fixtures/tag-name-expression-simple/__snapshots__/tag-name-expression-simple.expected.txt @@ -1,5 +1,5 @@ 1╭─ <${foo}> - │ │ ╰─ openTagEnd(${foo}) + │ │ ╰─ openTagEnd │ ├─ tagName.expressions[0] "${foo}" │ ├─ tagName.quasis[0] ╰─ ╰─ tagName "${foo}" diff --git a/src/__tests__/fixtures/tag-var-declaration/__snapshots__/tag-var-declaration.expected.txt b/src/__tests__/fixtures/tag-var-declaration/__snapshots__/tag-var-declaration.expected.txt index 196c33ae..fef6fe1a 100644 --- a/src/__tests__/fixtures/tag-var-declaration/__snapshots__/tag-var-declaration.expected.txt +++ b/src/__tests__/fixtures/tag-var-declaration/__snapshots__/tag-var-declaration.expected.txt @@ -1,5 +1,5 @@ 1╭─ <${foo}/someVar> - │ │ ││ ╰─ openTagEnd(${foo}) + │ │ ││ ╰─ openTagEnd │ │ │├─ tagVar.value "someVar" │ │ │╰─ tagName.quasis[1] │ │ ╰─ tagVar "/someVar" @@ -12,46 +12,41 @@ ╰─ ╰─ closeTag(${foo}) "" 3├─ 4╭─ - │ │ ││ ╰─ openTagEnd(let) "/>" + │ │ ││ ╰─ openTagEnd:selfClosed "/>" │ │ │╰─ tagVar.value "foo" │ │ ╰─ tagVar "/foo" ╰─ ╰─ tagName "let" 5╭─ - │ ││ ││ ││╰─ openTagEnd(let) "/>" - │ ││ ││ │╰─ attrValue.value - │ ││ ││ ├─ attrValue "=1" - │ ││ ││ ╰─ attrName - │ ││ │╰─ tagVar.value "foo" - │ ││ ╰─ tagVar "/foo" - │ │╰─ tagName "let" - ╰─ ╰─ closeTag(let) + │ │ ││ ││╰─ openTagEnd:selfClosed "/>" + │ │ ││ │╰─ attrValue.value + │ │ ││ ├─ attrValue "=1" + │ │ ││ ╰─ attrName + │ │ │╰─ tagVar.value "foo" + │ │ ╰─ tagVar "/foo" + ╰─ ╰─ tagName "let" 6╭─ - │ ││ ││ │ │╰─ openTagEnd(let) "/>" - │ ││ ││ │ ╰─ attrValue.value - │ ││ ││ ├─ attrValue "= 1" - │ ││ ││ ╰─ attrName - │ ││ │╰─ tagVar.value "foo" - │ ││ ╰─ tagVar "/foo" - │ │╰─ tagName "let" - ╰─ ╰─ closeTag(let) + │ │ ││ │ │╰─ openTagEnd:selfClosed "/>" + │ │ ││ │ ╰─ attrValue.value + │ │ ││ ├─ attrValue "= 1" + │ │ ││ ╰─ attrName + │ │ │╰─ tagVar.value "foo" + │ │ ╰─ tagVar "/foo" + ╰─ ╰─ tagName "let" 7╭─ - │ ││ ││ │ │╰─ openTagEnd(let) "/>" - │ ││ ││ │ ╰─ attrName - │ ││ ││ ╰─ attrName - │ ││ │╰─ tagVar.value "foo" - │ ││ ╰─ tagVar "/foo" - │ │╰─ tagName "let" - ╰─ ╰─ closeTag(let) + │ │ ││ │ │╰─ openTagEnd:selfClosed "/>" + │ │ ││ │ ╰─ attrName + │ │ ││ ╰─ attrName + │ │ │╰─ tagVar.value "foo" + │ │ ╰─ tagVar "/foo" + ╰─ ╰─ tagName "let" 8╭─ - │ ││ ││ ╰─ openTagEnd(let) "/>" - │ ││ │╰─ tagVar.value "{ x, y }" - │ ││ ╰─ tagVar "/{ x, y }" - │ │╰─ tagName "let" - ╰─ ╰─ closeTag(let) -9╭─ - ╰─ ╰─ closeTag(let) + │ │ ││ ╰─ openTagEnd:selfClosed "/>" + │ │ │╰─ tagVar.value "{ x, y }" + │ │ ╰─ tagVar "/{ x, y }" + ╰─ ╰─ tagName "let" +9├─ 10╭─
  • " │ │ │╰─ text "Hello" - │ │ ╰─ openTagEnd(div) + │ │ ╰─ openTagEnd ╰─ ╰─ tagName "div" \ No newline at end of file diff --git a/src/__tests__/main.test.ts b/src/__tests__/main.test.ts index e0289af3..798b4f03 100644 --- a/src/__tests__/main.test.ts +++ b/src/__tests__/main.test.ts @@ -1,7 +1,7 @@ import fs from "fs"; import path from "path"; import snap from "mocha-snap"; -import { getLines } from "../internal"; +import { getLines, TagType } from "../internal"; import { createParser, Position, Ranges, Range } from ".."; const FIXTURES = path.join(__dirname, "fixtures"); @@ -74,8 +74,41 @@ for (const entry of fs.readdirSync(FIXTURES)) { addValueRange("comment", range); }, onTagName(range) { - tagStack.push(range); addTemplateRange("tagName", range); + + if (range.expressions.length === 0) { + switch (parser.read(range)) { + case "area": + case "base": + case "br": + case "col": + case "hr": + case "embed": + case "img": + case "input": + case "link": + case "meta": + case "param": + case "source": + case "track": + case "wbr": + return TagType.void; + case "script": + case "style": + case "textarea": + case "html-comment": + tagStack.push(range); + return TagType.text; + case "import": + case "export": + case "static": + case "class": + return TagType.statement; + } + } + + tagStack.push(range); + return TagType.html; }, onTagShorthandId(range) { addTemplateRange("tagShorthandId", range); @@ -110,7 +143,8 @@ for (const entry of fs.readdirSync(FIXTURES)) { addValueRange("attrSpread", range); }, onOpenTagEnd(range) { - addRange(`openTagEnd(${read(tagStack[tagStack.length - 1])})`, range); + if (range.selfClosed) tagStack.pop(); + addRange(`openTagEnd${range.selfClosed ? ":selfClosed" : ""}`, range); }, onCloseTag(range) { const label = `closeTag(${read(tagStack.pop()!)})`; diff --git a/src/core/Parser.ts b/src/core/Parser.ts index dafbcf3c..75863cd2 100644 --- a/src/core/Parser.ts +++ b/src/core/Parser.ts @@ -1,10 +1,10 @@ import { - BODY_MODE, + TagType, CODE, STATE, isWhitespaceCode, Range, - Handlers, + ParserOptions as Options, getLines, getLoc, getPos, @@ -44,8 +44,8 @@ export class Parser { public textPos!: number; // Used to buffer text that is found within the body of a tag public lines: undefined | number[]; // Keeps track of line indexes to provide line/column info. - constructor(public handlers: Handlers) { - this.handlers = handlers; + constructor(public options: Options) { + this.options = options; } read(range: Range) { @@ -146,7 +146,7 @@ export class Parser { endText() { const start = this.textPos; if (start !== -1) { - this.handlers.onText?.({ start, end: this.pos }); + this.options.onText?.({ start, end: this.pos }); this.textPos = -1; } } @@ -159,7 +159,7 @@ export class Parser { */ beginHtmlBlock(delimiter: string | undefined, singleLine: boolean) { const content = this.enterState( - this.activeTag?.bodyMode === BODY_MODE.PARSED_TEXT + this.activeTag?.type === TagType.text ? STATE.PARSED_TEXT_CONTENT : STATE.HTML_CONTENT ); @@ -179,7 +179,7 @@ export class Parser { end = range.end; } - this.handlers.onError?.({ + this.options.onError?.({ start, end, code, @@ -193,7 +193,7 @@ export class Parser { const { beginMixedMode, parentTag } = this.activeTag!; if (beginMixedMode) this.endingMixedModeAtEOL = true; this.activeTag = parentTag; - this.handlers.onCloseTag?.({ + this.options.onCloseTag?.({ start, end, value, diff --git a/src/index.ts b/src/index.ts index 3600e16d..824c398c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,7 +1,7 @@ -import { type Handlers, type Range, Parser } from "./internal"; +import { type ParserOptions, type Range, Parser } from "./internal"; export { - OpenTagEnding, - type Handlers, + TagType, + type ParserOptions as Handlers, type Position, type Location, type Ranges, @@ -11,7 +11,7 @@ export { /** * Creates a new Marko parser. */ -export function createParser(handlers: Handlers) { +export function createParser(handlers: ParserOptions) { // Expose a subset of the parser api. const parser = new Parser(handlers); diff --git a/src/states/ATTRIBUTE.ts b/src/states/ATTRIBUTE.ts index d1eca09b..f542b8b4 100644 --- a/src/states/ATTRIBUTE.ts +++ b/src/states/ATTRIBUTE.ts @@ -170,7 +170,7 @@ export const ATTRIBUTE: StateDefinition = { end: child.end, }; - this.handlers.onAttrName?.(attr.name); + this.options.onAttrName?.(attr.name); break; } case ATTR_STAGE.ARGUMENT: { @@ -198,7 +198,7 @@ export const ATTRIBUTE: StateDefinition = { }; } else { attr.args = true; - this.handlers.onAttrArgs?.({ + this.options.onAttrArgs?.({ start, end, value, @@ -211,7 +211,7 @@ export const ATTRIBUTE: StateDefinition = { const params = attr.args as Ranges.Value; const start = params.start; const end = ++this.pos; // include } - this.handlers.onAttrMethod?.({ + this.options.onAttrMethod?.({ start, end, params, @@ -238,7 +238,7 @@ export const ATTRIBUTE: StateDefinition = { } if (attr.spread) { - this.handlers.onAttrSpread?.({ + this.options.onAttrSpread?.({ start: attr.valueStart, end: child.end, value: { @@ -247,7 +247,7 @@ export const ATTRIBUTE: StateDefinition = { }, }); } else { - this.handlers.onAttrValue?.({ + this.options.onAttrValue?.({ start: attr.valueStart, end: child.end, bound: attr.bound, @@ -267,7 +267,7 @@ export const ATTRIBUTE: StateDefinition = { function ensureAttrName(parser: Parser, attr: AttrMeta) { if (!attr.name) { - parser.handlers.onAttrName?.({ + parser.options.onAttrName?.({ start: attr.start, end: attr.start, }); diff --git a/src/states/CDATA.ts b/src/states/CDATA.ts index 69269ff4..9326c85f 100644 --- a/src/states/CDATA.ts +++ b/src/states/CDATA.ts @@ -14,7 +14,7 @@ export const CDATA: StateDefinition = { }, exit(cdata) { - this.handlers.onCDATA?.({ + this.options.onCDATA?.({ start: cdata.start, end: cdata.end, value: { diff --git a/src/states/CONCISE_HTML_CONTENT.ts b/src/states/CONCISE_HTML_CONTENT.ts index 2d8d27c0..d3f0baac 100644 --- a/src/states/CONCISE_HTML_CONTENT.ts +++ b/src/states/CONCISE_HTML_CONTENT.ts @@ -3,8 +3,7 @@ import { STATE, isWhitespaceCode, StateDefinition, - BODY_MODE, - OpenTagEnding, + TagType, htmlEOF, } from "../internal"; @@ -48,19 +47,8 @@ export const CONCISE_HTML_CONTENT: StateDefinition = { } if (parentTag) { - if (parentTag.ending !== OpenTagEnding.tag) { - this.emitError( - this.pos, - "INVALID_BODY", - `The "${this.read( - parentTag.tagName - )}" tag does not allow nested body content` - ); - return; - } - if ( - parentTag.bodyMode === BODY_MODE.PARSED_TEXT && + parentTag.type === TagType.text && code !== CODE.HTML_BLOCK_DELIMITER ) { this.emitError( @@ -146,7 +134,7 @@ export const CONCISE_HTML_CONTENT: StateDefinition = { switch (child.state) { case STATE.JS_COMMENT_LINE: - this.handlers.onComment?.({ + this.options.onComment?.({ start: child.start, end: child.end, value: { @@ -156,7 +144,7 @@ export const CONCISE_HTML_CONTENT: StateDefinition = { }); break; case STATE.JS_COMMENT_BLOCK: { - this.handlers.onComment?.({ + this.options.onComment?.({ start: child.start, end: child.end, value: { diff --git a/src/states/DECLARATION.ts b/src/states/DECLARATION.ts index 723e65d7..ef9aeda8 100644 --- a/src/states/DECLARATION.ts +++ b/src/states/DECLARATION.ts @@ -49,7 +49,7 @@ function exitDeclaration( ) { parser.pos += closeOffset; parser.exitState(); - parser.handlers.onDeclaration?.({ + parser.options.onDeclaration?.({ start: declaration.start, end: declaration.end, value: { diff --git a/src/states/DTD.ts b/src/states/DTD.ts index c3d29a0e..e3197b5d 100644 --- a/src/states/DTD.ts +++ b/src/states/DTD.ts @@ -16,7 +16,7 @@ export const DTD: StateDefinition = { }, exit(documentType) { - this.handlers.onDoctype?.({ + this.options.onDoctype?.({ start: documentType.start, end: documentType.end, value: { diff --git a/src/states/HTML_COMMENT.ts b/src/states/HTML_COMMENT.ts index 3e2fce79..618448be 100644 --- a/src/states/HTML_COMMENT.ts +++ b/src/states/HTML_COMMENT.ts @@ -17,7 +17,7 @@ export const HTML_COMMENT: StateDefinition = { }, exit(comment) { - this.handlers.onComment?.({ + this.options.onComment?.({ start: comment.start, end: comment.end, value: { diff --git a/src/states/INLINE_SCRIPT.ts b/src/states/INLINE_SCRIPT.ts index 69d7b8ed..99cdbb0c 100644 --- a/src/states/INLINE_SCRIPT.ts +++ b/src/states/INLINE_SCRIPT.ts @@ -23,7 +23,7 @@ export const INLINE_SCRIPT: StateDefinition = { }, exit(inlineScript) { - this.handlers.onScriptlet?.({ + this.options.onScriptlet?.({ start: inlineScript.start, end: inlineScript.end, block: inlineScript.block, diff --git a/src/states/JS_COMMENT_LINE.ts b/src/states/JS_COMMENT_LINE.ts index 4dc346e9..9e8b3fd1 100644 --- a/src/states/JS_COMMENT_LINE.ts +++ b/src/states/JS_COMMENT_LINE.ts @@ -1,4 +1,4 @@ -import { BODY_MODE, CODE, STATE, StateDefinition } from "../internal"; +import { CODE, STATE, StateDefinition, TagType } from "../internal"; // We enter STATE.JS_COMMENT_LINE after we encounter a "//" sequence // when parsing JavaScript code. @@ -21,7 +21,7 @@ export const JS_COMMENT_LINE: StateDefinition = { if ( !this.isConcise && code === CODE.OPEN_ANGLE_BRACKET && - this.activeTag?.bodyMode === BODY_MODE.PARSED_TEXT + this.activeTag?.type === TagType.text ) { // First, see if we need to see if we reached the closing tag // eg: diff --git a/src/states/OPEN_TAG.ts b/src/states/OPEN_TAG.ts index 1424d514..2aed4065 100644 --- a/src/states/OPEN_TAG.ts +++ b/src/states/OPEN_TAG.ts @@ -3,10 +3,9 @@ import { STATE, isWhitespaceCode, StateDefinition, - BODY_MODE, - OpenTagEnding, Ranges, Meta, + TagType, } from "../internal"; const enum TAG_STAGE { @@ -18,7 +17,7 @@ const enum TAG_STAGE { } export interface OpenTagMeta extends Meta { - bodyMode: BODY_MODE; + type: TagType; stage: TAG_STAGE; concise: boolean; beginMixedMode?: boolean; @@ -27,12 +26,11 @@ export interface OpenTagMeta extends Meta { hasArgs: boolean; hasAttrs: boolean; hasShorthandId: boolean; - ending: OpenTagEnding; + selfClosed: boolean; indent: string; nestedIndent: string | undefined; parentTag: OpenTagMeta | undefined; } -const PARSED_TEXT_TAGS = ["script", "style", "textarea", "html-comment"]; const CONCISE_TAG_VAR_TERMINATORS = [ CODE.SEMICOLON, CODE.OPEN_PAREN, @@ -56,6 +54,7 @@ export const OPEN_TAG: StateDefinition = { enter(parent, start) { const tag = (this.activeTag = { state: OPEN_TAG as StateDefinition, + type: TagType.html, parent, start, end: start, @@ -66,11 +65,10 @@ export const OPEN_TAG: StateDefinition = { hasShorthandId: false, hasArgs: false, hasAttrs: false, + selfClosed: false, shorthandEnd: -1, tagName: undefined!, - ending: OpenTagEnding.tag, concise: this.isConcise, - bodyMode: BODY_MODE.HTML, beginMixedMode: this.beginMixedMode || this.endingMixedModeAtEOL, }); @@ -81,27 +79,29 @@ export const OPEN_TAG: StateDefinition = { }, exit(tag) { - const { tagName, ending } = tag; + const { selfClosed } = tag; - this.handlers.onOpenTagEnd?.({ - start: - this.pos - (this.isConcise ? 0 : ending & OpenTagEnding.self ? 2 : 1), + this.options.onOpenTagEnd?.({ + start: this.pos - (this.isConcise ? 0 : selfClosed ? 2 : 1), end: this.pos, - ending, + selfClosed, }); - if (!this.isConcise && ending !== OpenTagEnding.tag) { - this.closeTag(this.pos, this.pos, undefined); - } else if ( - tagName.expressions.length === 0 && - this.matchAnyAtPos(tagName, PARSED_TEXT_TAGS) - ) { - tag.bodyMode = BODY_MODE.PARSED_TEXT; - if (this.isConcise) { - this.enterState(STATE.CONCISE_HTML_CONTENT); - } else { - this.enterState(STATE.PARSED_TEXT_CONTENT); + switch (selfClosed ? TagType.void : tag.type) { + case TagType.void: + case TagType.statement: { + // Close the tag, but don't also emit the onCloseTag event. + if (tag.beginMixedMode) this.endingMixedModeAtEOL = true; + this.activeTag = tag.parentTag; + break; } + case TagType.text: + if (this.isConcise) { + this.enterState(STATE.CONCISE_HTML_CONTENT); + } else { + this.enterState(STATE.PARSED_TEXT_CONTENT); + } + break; } }, @@ -258,7 +258,7 @@ export const OPEN_TAG: StateDefinition = { code === CODE.FORWARD_SLASH && this.lookAtCharCodeAhead(1) === CODE.CLOSE_ANGLE_BRACKET ) { - tag.ending |= OpenTagEnding.self; + tag.selfClosed = true; this.pos += 2; // skip /> this.exitState(); return; @@ -349,7 +349,7 @@ export const OPEN_TAG: StateDefinition = { ); } - this.handlers.onTagVar?.({ + this.options.onTagVar?.({ start: child.start - 1, // include /, end: child.end, value: { @@ -375,7 +375,7 @@ export const OPEN_TAG: StateDefinition = { this.pos--; } else { tag.hasArgs = true; - this.handlers.onTagArgs?.({ + this.options.onTagArgs?.({ start, end, value, @@ -385,7 +385,7 @@ export const OPEN_TAG: StateDefinition = { } case TAG_STAGE.PARAMS: { const end = ++this.pos; // include closing | - this.handlers.onTagParams?.({ + this.options.onTagParams?.({ start: child.start - 1, // include leading | end, value: { diff --git a/src/states/PLACEHOLDER.ts b/src/states/PLACEHOLDER.ts index 3ac08dd7..9995f8af 100644 --- a/src/states/PLACEHOLDER.ts +++ b/src/states/PLACEHOLDER.ts @@ -17,7 +17,7 @@ export const PLACEHOLDER: StateDefinition = { }, exit(placeholder) { - this.handlers.onPlaceholder?.({ + this.options.onPlaceholder?.({ start: placeholder.start, end: placeholder.end, escape: placeholder.escape, diff --git a/src/states/TAG_NAME.ts b/src/states/TAG_NAME.ts index 09f4c726..ab5ef960 100644 --- a/src/states/TAG_NAME.ts +++ b/src/states/TAG_NAME.ts @@ -3,34 +3,15 @@ import { STATE, isWhitespaceCode, StateDefinition, - OpenTagEnding, Ranges, Meta, + TagType, } from "../internal"; export interface TagNameMeta extends Meta, Ranges.Template { shorthandCode?: CODE.NUMBER_SIGN | CODE.PERIOD; } -const VOID_TAGS = [ - "area", - "base", - "br", - "col", - "hr", - "embed", - "img", - "input", - "link", - "meta", - "param", - "source", - "track", - "wbr", -]; - -const CODE_TAGS = ["import", "export", "static", "class"]; - // We enter STATE.TAG_NAME after we encounter a "<" // followed by a non-special character export const TAG_NAME: StateDefinition = { @@ -63,7 +44,7 @@ export const TAG_NAME: StateDefinition = { } this.activeTag!.hasShorthandId = true; - this.handlers.onTagShorthandId?.({ + this.options.onTagShorthandId?.({ start, end, quasis, @@ -71,7 +52,7 @@ export const TAG_NAME: StateDefinition = { }); break; case CODE.PERIOD: - this.handlers.onTagShorthandClass?.({ + this.options.onTagShorthandClass?.({ start, end, quasis, @@ -80,12 +61,19 @@ export const TAG_NAME: StateDefinition = { break; default: { const tag = this.activeTag!; + const tagType = this.options.onTagName?.({ + start, + end, + quasis, + expressions, + concise: this.isConcise, + }); tag.tagName = tagName; - if (tagName.expressions.length === 0) { - if (this.matchAnyAtPos(tagName, VOID_TAGS)) { - tag.ending |= OpenTagEnding.void; - } else if (this.matchAnyAtPos(tagName, CODE_TAGS)) { + if (tagType) { + tag.type = tagType; + + if (tagType === TagType.statement) { if (!tag.concise) { return this.emitError( tagName, @@ -106,19 +94,10 @@ export const TAG_NAME: StateDefinition = { ); } - tag.ending |= OpenTagEnding.code; this.enterState(STATE.EXPRESSION).terminatedByEOL = true; } } - this.handlers.onTagName?.({ - start, - end, - quasis, - expressions, - concise: this.isConcise, - }); - break; } } diff --git a/src/util/constants.ts b/src/util/constants.ts index 40963112..a23b2d01 100644 --- a/src/util/constants.ts +++ b/src/util/constants.ts @@ -38,11 +38,6 @@ export const enum CODE { TAB = 9, } -export const enum BODY_MODE { - HTML, - PARSED_TEXT, // Body of a tag is treated as text, but placeholders will be parsed -} - // Same format as https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#position export interface Position { /** @@ -109,7 +104,7 @@ export namespace Ranges { } export interface OpenTagEnd extends Range { - ending: OpenTagEnding; + selfClosed: boolean; } export interface CloseTag extends Range { @@ -117,14 +112,14 @@ export namespace Ranges { } } -export const enum OpenTagEnding { - tag = 0, - self = 1 << 0, - void = 1 << 1, - code = 1 << 2, +export const enum TagType { + html, + text, + void, + statement, } -export interface Handlers { +export interface ParserOptions { onError?(data: Ranges.Error): void; onText?(data: Range): void; onComment?(data: Ranges.Value): void; @@ -133,7 +128,7 @@ export interface Handlers { onDoctype?(data: Ranges.Value): void; onScriptlet?(data: Ranges.Scriptlet): void; onPlaceholder?(data: Ranges.Placeholder): void; - onTagName?(data: Ranges.TagName): void; + onTagName?(data: Ranges.TagName): TagType | void; onTagShorthandId?(data: Ranges.Template): void; onTagShorthandClass?(data: Ranges.Template): void; onTagVar?(data: Ranges.Value): void;