diff --git a/.changeset/mighty-sheep-move.md b/.changeset/mighty-sheep-move.md new file mode 100644 index 00000000..df9ce53d --- /dev/null +++ b/.changeset/mighty-sheep-move.md @@ -0,0 +1,5 @@ +--- +"htmljs-parser": patch +--- + +Add support for `satisfies` 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 b896f48b..a3d07cb0 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 @@ -367,7 +367,15 @@ │ ├─ closeTagEnd(a) │ ├─ openTagEnd ╰─ ╰─ tagName -47╭─ a=x ++ + y a +47╭─ a=x satisfies y a + │ │││ ╰─ attrName + │ ││╰─ attrValue.value "x satisfies y" + │ │├─ attrValue "=x satisfies y" + │ │╰─ attrName + │ ├─ closeTagEnd(a) + │ ├─ openTagEnd + ╰─ ╰─ tagName +48╭─ a=x ++ + y a │ │││ ╰─ attrName │ ││╰─ attrValue.value "x ++ + y" │ │├─ attrValue "=x ++ + y" @@ -375,7 +383,7 @@ │ ├─ closeTagEnd(a) │ ├─ openTagEnd ╰─ ╰─ tagName -48╭─ a=x+ ++ y a +49╭─ a=x+ ++ y a │ │││ ╰─ attrName │ ││╰─ attrValue.value "x+ ++ y" │ │├─ attrValue "=x+ ++ y" @@ -383,7 +391,7 @@ │ ├─ closeTagEnd(a) │ ├─ openTagEnd ╰─ ╰─ tagName -49╭─ a=x ++ y a +50╭─ a=x ++ y a │ │││ │ ╰─ attrName │ │││ ╰─ attrName │ ││╰─ attrValue.value "x ++" @@ -392,7 +400,7 @@ │ ├─ closeTagEnd(a) │ ├─ openTagEnd ╰─ ╰─ tagName -50╭─ a=x > y a +51╭─ a=x > y a │ │││ ╰─ attrName │ ││╰─ attrValue.value "x > y" │ │├─ attrValue "=x > y" @@ -400,7 +408,7 @@ │ ├─ closeTagEnd(a) │ ├─ openTagEnd ╰─ ╰─ tagName -51╭─ a=x >> y a +52╭─ a=x >> y a │ │││ ╰─ attrName │ ││╰─ attrValue.value "x >> y" │ │├─ attrValue "=x >> y" @@ -408,7 +416,7 @@ │ ├─ closeTagEnd(a) │ ├─ openTagEnd ╰─ ╰─ tagName -52╭─ a=x >>> y a +53╭─ a=x >>> y a │ │││ ╰─ attrName │ ││╰─ attrValue.value "x >>> y" │ │├─ attrValue "=x >>> y" @@ -416,7 +424,7 @@ │ ├─ closeTagEnd(a) │ ├─ openTagEnd ╰─ ╰─ tagName -53╭─ a=x ( y ) a +54╭─ a=x ( y ) a │ │││ ╰─ attrName │ ││╰─ attrValue.value "x ( y )" │ │├─ attrValue "=x ( y )" @@ -424,7 +432,7 @@ │ ├─ closeTagEnd(a) │ ├─ openTagEnd ╰─ ╰─ tagName -54╭─ a=x { y } a +55╭─ a=x { y } a │ │││ ╰─ attrName │ ││╰─ attrValue.value "x { y }" │ │├─ attrValue "=x { y }" @@ -432,7 +440,7 @@ │ ├─ closeTagEnd(a) │ ├─ openTagEnd ╰─ ╰─ tagName -55╭─ a=x => y a +56╭─ a=x => y a │ │││ ╰─ attrName │ ││╰─ attrValue.value "x => y" │ │├─ attrValue "=x => y" @@ -440,7 +448,7 @@ │ ├─ closeTagEnd(a) │ ├─ openTagEnd ╰─ ╰─ tagName -56╭─ a=x => ( y ) a +57╭─ a=x => ( y ) a │ │││ ╰─ attrName │ ││╰─ attrValue.value "x => ( y )" │ │├─ attrValue "=x => ( y )" @@ -448,7 +456,7 @@ │ ├─ closeTagEnd(a) │ ├─ openTagEnd ╰─ ╰─ tagName -57╭─ a=x => { y } a +58╭─ a=x => { y } a │ │││ ╰─ attrName │ ││╰─ attrValue.value "x => { y }" │ │├─ attrValue "=x => { y }" @@ -456,7 +464,7 @@ │ ├─ closeTagEnd(a) │ ├─ openTagEnd ╰─ ╰─ tagName -58╭─ a=( x ) { y } a +59╭─ a=( x ) { y } a │ │││ ╰─ attrName │ ││╰─ attrValue.value "( x ) { y }" │ │├─ attrValue "=( x ) { y }" @@ -464,7 +472,7 @@ │ ├─ closeTagEnd(a) │ ├─ openTagEnd ╰─ ╰─ tagName -59╭─ a = (x) => { console.log("y") } a +60╭─ a = (x) => { console.log("y") } a │ │ │ │ ╰─ attrName │ │ │ ╰─ attrValue.value "(x) => { console.log(\"y\") }" │ │ ├─ attrValue "= (x) => { console.log(\"y\") }" @@ -472,7 +480,7 @@ │ ├─ closeTagEnd(a) │ ├─ openTagEnd ╰─ ╰─ tagName -60╭─ a = async x => { console.log("y") } a +61╭─ a = async x => { console.log("y") } a │ │ │ │ ╰─ attrName │ │ │ ╰─ attrValue.value "async x => { console.log(\"y\") }" │ │ ├─ attrValue "= async x => { console.log(\"y\") }" @@ -480,7 +488,7 @@ │ ├─ closeTagEnd(a) │ ├─ openTagEnd ╰─ ╰─ tagName -61╭─ a = function (x) { console.log("y") } a +62╭─ a = function (x) { console.log("y") } a │ │ │ │ ╰─ attrName │ │ │ ╰─ attrValue.value "function (x) { console.log(\"y\") }" │ │ ├─ attrValue "= function (x) { console.log(\"y\") }" @@ -488,7 +496,7 @@ │ ├─ closeTagEnd(a) │ ├─ openTagEnd ╰─ ╰─ tagName -62╭─ a = x => { console.log("y") } a +63╭─ a = x => { console.log("y") } a │ │ │ │ ╰─ attrName │ │ │ ╰─ attrValue.value "x => { console.log(\"y\") }" │ │ ├─ attrValue "= x => { console.log(\"y\") }" @@ -496,7 +504,7 @@ │ ├─ closeTagEnd(a) │ ├─ openTagEnd ╰─ ╰─ tagName -63╭─ a = async function (x) { console.log("y") } a +64╭─ a = async function (x) { console.log("y") } a │ │ │ │ ╰─ attrName │ │ │ ╰─ attrValue.value "async function (x) { console.log(\"y\") }" │ │ ├─ attrValue "= async function (x) { console.log(\"y\") }" @@ -504,9 +512,9 @@ │ ├─ closeTagEnd(a) │ ├─ openTagEnd ╰─ ╰─ tagName -64╭─ +65╭─ ╰─ ╰─ openTagEnd -65╭─ +66╭─ │ │││ │ │╰─ openTagEnd:selfClosed "/>" │ │││ │ ╰─ attrName │ │││ ╰─ attrValue.value "await y" @@ -515,7 +523,7 @@ │ │╰─ tagName │ ├─ closeTagEnd(a) ╰─ ╰─ openTagStart -66╭─ +67╭─ │ │││ │ │╰─ openTagEnd:selfClosed "/>" │ │││ │ ╰─ attrName │ │││ ╰─ attrValue.value "new y" @@ -523,7 +531,7 @@ │ ││╰─ attrName │ │╰─ tagName ╰─ ╰─ openTagStart -67╭─ +68╭─ │ │││ │ │╰─ openTagEnd:selfClosed "/>" │ │││ │ ╰─ attrName │ │││ ╰─ attrValue.value "void y" @@ -531,7 +539,7 @@ │ ││╰─ attrName │ │╰─ tagName ╰─ ╰─ openTagStart -68╭─ +69╭─ │ │││ │ │╰─ openTagEnd:selfClosed "/>" │ │││ │ ╰─ attrName │ │││ ╰─ attrValue.value "typeof y" @@ -539,7 +547,7 @@ │ ││╰─ attrName │ │╰─ tagName ╰─ ╰─ openTagStart -69╭─ +70╭─ │ │││ │ │╰─ openTagEnd:selfClosed "/>" │ │││ │ ╰─ attrName │ │││ ╰─ attrValue.value "class A extends Y {}" @@ -547,7 +555,7 @@ │ ││╰─ attrName │ │╰─ tagName ╰─ ╰─ openTagStart -70╭─ +71╭─ │ ││││ │╰─ openTagEnd:selfClosed "/>" │ ││││ ╰─ attrName │ │││╰─ attrValue.value "x . y" @@ -555,7 +563,7 @@ │ ││╰─ attrName │ │╰─ tagName ╰─ ╰─ openTagStart -71╭─ +72╭─ │ ││││ │╰─ openTagEnd:selfClosed "/>" │ ││││ ╰─ attrName │ │││╰─ attrValue.value "x ! y" @@ -563,7 +571,7 @@ │ ││╰─ attrName │ │╰─ tagName ╰─ ╰─ openTagStart -72╭─ +73╭─ │ ││││ │╰─ openTagEnd:selfClosed "/>" │ ││││ ╰─ attrName │ │││╰─ attrValue.value "x * y" @@ -571,7 +579,7 @@ │ ││╰─ attrName │ │╰─ tagName ╰─ ╰─ openTagStart -73╭─ +74╭─ │ ││││ │╰─ openTagEnd:selfClosed "/>" │ ││││ ╰─ attrName │ │││╰─ attrValue.value "x / y" @@ -579,7 +587,7 @@ │ ││╰─ attrName │ │╰─ tagName ╰─ ╰─ openTagStart -74╭─ +75╭─ │ ││││ │╰─ openTagEnd:selfClosed "/>" │ ││││ ╰─ attrName │ │││╰─ attrValue.value "x ** y" @@ -587,7 +595,7 @@ │ ││╰─ attrName │ │╰─ tagName ╰─ ╰─ openTagStart -75╭─ +76╭─ │ ││││ │╰─ openTagEnd:selfClosed "/>" │ ││││ ╰─ attrName │ │││╰─ attrValue.value "x % y" @@ -595,7 +603,7 @@ │ ││╰─ attrName │ │╰─ tagName ╰─ ╰─ openTagStart -76╭─ +77╭─ │ ││││ │╰─ openTagEnd:selfClosed "/>" │ ││││ ╰─ attrName │ │││╰─ attrValue.value "x & y" @@ -603,7 +611,7 @@ │ ││╰─ attrName │ │╰─ tagName ╰─ ╰─ openTagStart -77╭─ +78╭─ │ ││││ │╰─ openTagEnd:selfClosed "/>" │ ││││ ╰─ attrName │ │││╰─ attrValue.value "x && y" @@ -611,7 +619,7 @@ │ ││╰─ attrName │ │╰─ tagName ╰─ ╰─ openTagStart -78╭─ +79╭─ │ ││││ │╰─ openTagEnd:selfClosed "/>" │ ││││ ╰─ attrName │ │││╰─ attrValue.value "x ^ y" @@ -619,7 +627,7 @@ │ ││╰─ attrName │ │╰─ tagName ╰─ ╰─ openTagStart -79╭─ +80╭─ │ ││││ │╰─ openTagEnd:selfClosed "/>" │ ││││ ╰─ attrName │ │││╰─ attrValue.value "x ~ y" @@ -627,7 +635,7 @@ │ ││╰─ attrName │ │╰─ tagName ╰─ ╰─ openTagStart -80╭─ +81╭─ │ ││││ │╰─ openTagEnd:selfClosed "/>" │ ││││ ╰─ attrName │ │││╰─ attrValue.value "x | y" @@ -635,7 +643,7 @@ │ ││╰─ attrName │ │╰─ tagName ╰─ ╰─ openTagStart -81╭─ +82╭─ │ ││││ │╰─ openTagEnd:selfClosed "/>" │ ││││ ╰─ attrName │ │││╰─ attrValue.value "x || y" @@ -643,7 +651,7 @@ │ ││╰─ attrName │ │╰─ tagName ╰─ ╰─ openTagStart -82╭─ +83╭─ │ ││││ │╰─ openTagEnd:selfClosed "/>" │ ││││ ╰─ attrName │ │││╰─ attrValue.value "x ?? y" @@ -651,7 +659,7 @@ │ ││╰─ attrName │ │╰─ tagName ╰─ ╰─ openTagStart -83╭─ +84╭─ │ ││││ │╰─ openTagEnd:selfClosed "/>" │ ││││ ╰─ attrName │ │││╰─ attrValue.value "x ? y : z" @@ -659,7 +667,7 @@ │ ││╰─ attrName │ │╰─ tagName ╰─ ╰─ openTagStart -84╭─ +85╭─ │ ││││ │╰─ openTagEnd:selfClosed "/>" │ ││││ ╰─ attrName │ │││╰─ attrValue.value "x == y" @@ -667,7 +675,7 @@ │ ││╰─ attrName │ │╰─ tagName ╰─ ╰─ openTagStart -85╭─ +86╭─ │ ││││ │╰─ openTagEnd:selfClosed "/>" │ ││││ ╰─ attrName │ │││╰─ attrValue.value "x === y" @@ -675,7 +683,7 @@ │ ││╰─ attrName │ │╰─ tagName ╰─ ╰─ openTagStart -86╭─ +87╭─ │ ││││ │╰─ openTagEnd:selfClosed "/>" │ ││││ ╰─ attrName │ │││╰─ attrValue.value "x != y" @@ -683,7 +691,7 @@ │ ││╰─ attrName │ │╰─ tagName ╰─ ╰─ openTagStart -87╭─ +88╭─ │ ││││ │╰─ openTagEnd:selfClosed "/>" │ ││││ ╰─ attrName │ │││╰─ attrValue.value "x !== y" @@ -691,7 +699,7 @@ │ ││╰─ attrName │ │╰─ tagName ╰─ ╰─ openTagStart -88╭─ +89╭─ │ ││││ │╰─ openTagEnd:selfClosed "/>" │ ││││ ╰─ attrName │ │││╰─ attrValue.value "x <= y" @@ -699,7 +707,7 @@ │ ││╰─ attrName │ │╰─ tagName ╰─ ╰─ openTagStart -89╭─ = y +90╭─ = y │ ││││ ││ │ │╰─ closeTagEnd(a) │ ││││ ││ │ ╰─ closeTagName │ ││││ ││ ╰─ closeTagStart " +91╭─ │ ││││ │╰─ openTagEnd:selfClosed "/>" │ ││││ ╰─ attrName │ │││╰─ attrValue.value "x &= y" @@ -718,7 +726,7 @@ │ ││╰─ attrName │ │╰─ tagName ╰─ ╰─ openTagStart -91╭─ +92╭─ │ ││││ │╰─ openTagEnd:selfClosed "/>" │ ││││ ╰─ attrName │ │││╰─ attrValue.value "x &&= y" @@ -726,7 +734,7 @@ │ ││╰─ attrName │ │╰─ tagName ╰─ ╰─ openTagStart -92╭─ +93╭─ │ ││││ │╰─ openTagEnd:selfClosed "/>" │ ││││ ╰─ attrName │ │││╰─ attrValue.value "x |= y" @@ -734,7 +742,7 @@ │ ││╰─ attrName │ │╰─ tagName ╰─ ╰─ openTagStart -93╭─ +94╭─ │ ││││ │╰─ openTagEnd:selfClosed "/>" │ ││││ ╰─ attrName │ │││╰─ attrValue.value "x ||= y" @@ -742,7 +750,7 @@ │ ││╰─ attrName │ │╰─ tagName ╰─ ╰─ openTagStart -94╭─ +95╭─ │ ││││ │╰─ openTagEnd:selfClosed "/>" │ ││││ ╰─ attrName │ │││╰─ attrValue.value "x ^= y" @@ -750,7 +758,7 @@ │ ││╰─ attrName │ │╰─ tagName ╰─ ╰─ openTagStart -95╭─ +96╭─ │ ││││ │╰─ openTagEnd:selfClosed "/>" │ ││││ ╰─ attrName │ │││╰─ attrValue.value "x ~= y" @@ -758,7 +766,7 @@ │ ││╰─ attrName │ │╰─ tagName ╰─ ╰─ openTagStart -96╭─ >= y +97╭─ >= y │ ││││ ││ │ │╰─ closeTagEnd(a) │ ││││ ││ │ ╰─ closeTagName │ ││││ ││ ╰─ closeTagStart ">>= y +98╭─ >>= y │ ││││ ││ │ │╰─ closeTagEnd(a) │ ││││ ││ │ ╰─ closeTagName │ ││││ ││ ╰─ closeTagStart " +99╭─ │ ││││ │╰─ openTagEnd:selfClosed "/>" │ ││││ ╰─ attrName │ │││╰─ attrValue.value "x -= y" @@ -788,15 +796,15 @@ │ ││╰─ attrName │ │╰─ tagName ╰─ ╰─ openTagStart -99╭─ - │ ││││ │╰─ openTagEnd:selfClosed "/>" - │ ││││ ╰─ attrName - │ │││╰─ attrValue.value "x /= y" - │ ││├─ attrValue "=x /= y" - │ ││╰─ attrName - │ │╰─ tagName - ╰─ ╰─ openTagStart -100╭─ +100╭─ + │ ││││ │╰─ openTagEnd:selfClosed "/>" + │ ││││ ╰─ attrName + │ │││╰─ attrValue.value "x /= y" + │ ││├─ attrValue "=x /= y" + │ ││╰─ attrName + │ │╰─ tagName + ╰─ ╰─ openTagStart +101╭─ │ ││││ │╰─ openTagEnd:selfClosed "/>" │ ││││ ╰─ attrName │ │││╰─ attrValue.value "x *= y" @@ -804,7 +812,7 @@ │ ││╰─ attrName │ │╰─ tagName ╰─ ╰─ openTagStart -101╭─ +102╭─ │ ││││ │╰─ openTagEnd:selfClosed "/>" │ ││││ ╰─ attrName │ │││╰─ attrValue.value "x **= y" @@ -812,7 +820,7 @@ │ ││╰─ attrName │ │╰─ tagName ╰─ ╰─ openTagStart -102╭─ +103╭─ │ ││││ │╰─ openTagEnd:selfClosed "/>" │ ││││ ╰─ attrName │ │││╰─ attrValue.value "x %= y" @@ -820,7 +828,7 @@ │ ││╰─ attrName │ │╰─ tagName ╰─ ╰─ openTagStart -103╭─ +104╭─ │ ││││ │╰─ openTagEnd:selfClosed "/>" │ ││││ ╰─ attrName │ │││╰─ attrValue.value "x += y" @@ -828,7 +836,7 @@ │ ││╰─ attrName │ │╰─ tagName ╰─ ╰─ openTagStart -104╭─ +105╭─ │ ││││ │ ╰─ openTagEnd:selfClosed "/>" │ ││││ ╰─ attrName "in;" │ │││╰─ attrValue.value @@ -836,7 +844,7 @@ │ ││╰─ attrName │ │╰─ tagName ╰─ ╰─ openTagStart -105╭─ +106╭─ │ ││││ │╰─ openTagEnd:selfClosed "/>" │ ││││ ╰─ attrName │ │││╰─ attrValue.value "x in y" @@ -844,7 +852,7 @@ │ ││╰─ attrName │ │╰─ tagName ╰─ ╰─ openTagStart -106╭─ +107╭─ │ ││││ │ ││╰─ openTagEnd:selfClosed "/>" │ ││││ │ │╰─ attrValue.value │ ││││ │ ╰─ attrValue "=y" @@ -854,7 +862,7 @@ │ ││╰─ attrName │ │╰─ tagName ╰─ ╰─ openTagStart -107╭─ +108╭─ │ ││││ │ │╰─ openTagEnd:selfClosed "/>" │ ││││ │ ╰─ attrName │ ││││ ╰─ attrName "in" @@ -863,7 +871,7 @@ │ ││╰─ attrName │ │╰─ tagName ╰─ ╰─ openTagStart -108╭─ +109╭─ │ ││││ │╰─ openTagEnd:selfClosed "/>" │ ││││ ╰─ attrName │ │││╰─ attrValue.value "x instanceof y" @@ -871,7 +879,15 @@ │ ││╰─ attrName │ │╰─ tagName ╰─ ╰─ openTagStart -109╭─ +110╭─ + │ ││││ │╰─ openTagEnd:selfClosed "/>" + │ ││││ ╰─ attrName + │ │││╰─ attrValue.value "x satisfies y" + │ ││├─ attrValue "=x satisfies y" + │ ││╰─ attrName + │ │╰─ tagName + ╰─ ╰─ openTagStart +111╭─ │ ││││ │╰─ openTagEnd:selfClosed "/>" │ ││││ ╰─ attrName │ │││╰─ attrValue.value "x ++ + y" @@ -879,7 +895,7 @@ │ ││╰─ attrName │ │╰─ tagName ╰─ ╰─ openTagStart -110╭─ +112╭─ │ ││││ │╰─ openTagEnd:selfClosed "/>" │ ││││ ╰─ attrName │ │││╰─ attrValue.value "x + ++ y" @@ -887,7 +903,7 @@ │ ││╰─ attrName │ │╰─ tagName ╰─ ╰─ openTagStart -111╭─ +113╭─ │ ││││ │╰─ openTagEnd:selfClosed "/>" │ ││││ ╰─ attrName │ │││╰─ attrValue.value "typeof ++ y" @@ -895,7 +911,7 @@ │ ││╰─ attrName │ │╰─ tagName ╰─ ╰─ openTagStart -112╭─ +114╭─ │ ││││ │╰─ openTagEnd:selfClosed "/>" │ ││││ ╰─ attrName │ │││╰─ attrValue.value "typeof y ++" @@ -903,7 +919,7 @@ │ ││╰─ attrName │ │╰─ tagName ╰─ ╰─ openTagStart -113╭─ +115╭─ │ ││││ │ │╰─ openTagEnd:selfClosed "/>" │ ││││ │ ╰─ attrName │ ││││ ╰─ attrName @@ -912,7 +928,7 @@ │ ││╰─ attrName │ │╰─ tagName ╰─ ╰─ openTagStart -114╭─ y +116╭─ y │ ││││ ││ │ │╰─ closeTagEnd(a) │ ││││ ││ │ ╰─ closeTagName │ ││││ ││ ╰─ closeTagStart "> y +117╭─ > y │ ││││ ││ │ │╰─ closeTagEnd(a) │ ││││ ││ │ ╰─ closeTagName │ ││││ ││ ╰─ closeTagStart ">> y +118╭─ >> y │ ││││ ││ │ │╰─ closeTagEnd(a) │ ││││ ││ │ ╰─ closeTagName │ ││││ ││ ╰─ closeTagStart " +119╭─ │ ││││ │╰─ openTagEnd:selfClosed "/>" │ ││││ ╰─ attrName │ │││╰─ attrValue.value "x ( y )" @@ -953,7 +969,7 @@ │ ││╰─ attrName │ │╰─ tagName ╰─ ╰─ openTagStart -118╭─ +120╭─ │ ││││ │╰─ openTagEnd:selfClosed "/>" │ ││││ ╰─ attrName │ │││╰─ attrValue.value "x { y }" @@ -961,7 +977,7 @@ │ ││╰─ attrName │ │╰─ tagName ╰─ ╰─ openTagStart -119╭─ y a/> +121╭─ y a/> │ ││││ │╰─ openTagEnd:selfClosed "/>" │ ││││ ╰─ attrName │ │││╰─ attrValue.value "x => y" @@ -969,7 +985,7 @@ │ ││╰─ attrName │ │╰─ tagName ╰─ ╰─ openTagStart -120╭─ ( y ) a/> +122╭─ ( y ) a/> │ ││││ │╰─ openTagEnd:selfClosed "/>" │ ││││ ╰─ attrName │ │││╰─ attrValue.value "x => ( y )" @@ -977,7 +993,7 @@ │ ││╰─ attrName │ │╰─ tagName ╰─ ╰─ openTagStart -121╭─ { y } a/> +123╭─ { y } a/> │ ││││ │╰─ openTagEnd:selfClosed "/>" │ ││││ ╰─ attrName │ │││╰─ attrValue.value "x => { y }" @@ -985,7 +1001,7 @@ │ ││╰─ attrName │ │╰─ tagName ╰─ ╰─ openTagStart -122╭─ +124╭─ │ ││││ │╰─ openTagEnd:selfClosed "/>" │ ││││ ╰─ attrName │ │││╰─ attrValue.value "( x ) { y }" @@ -993,7 +1009,7 @@ │ ││╰─ attrName │ │╰─ tagName ╰─ ╰─ openTagStart -123╭─ { console.log("y") } a/> +125╭─ { console.log("y") } a/> │ │││ │ │╰─ openTagEnd:selfClosed "/>" │ │││ │ ╰─ attrName │ │││ ╰─ attrValue.value "(x) => { console.log(\"y\") }" @@ -1001,7 +1017,7 @@ │ ││╰─ attrName │ │╰─ tagName ╰─ ╰─ openTagStart -124╭─ { console.log("y") } a/> +126╭─ { console.log("y") } a/> │ │││ │ │╰─ openTagEnd:selfClosed "/>" │ │││ │ ╰─ attrName │ │││ ╰─ attrValue.value "async x => { console.log(\"y\") }" @@ -1009,7 +1025,7 @@ │ ││╰─ attrName │ │╰─ tagName ╰─ ╰─ openTagStart -125╭─ +127╭─ │ │││ │ │╰─ openTagEnd:selfClosed "/>" │ │││ │ ╰─ attrName │ │││ ╰─ attrValue.value "function (x) { console.log(\"y\") }" @@ -1017,7 +1033,7 @@ │ ││╰─ attrName │ │╰─ tagName ╰─ ╰─ openTagStart -126╭─ { console.log("y") } a/> +128╭─ { console.log("y") } a/> │ │││ │ │╰─ openTagEnd:selfClosed "/>" │ │││ │ ╰─ attrName │ │││ ╰─ attrValue.value "x => { console.log(\"y\") }" @@ -1025,7 +1041,7 @@ │ ││╰─ attrName │ │╰─ tagName ╰─ ╰─ openTagStart -127╭─ +129╭─ │ │││ │ │╰─ openTagEnd:selfClosed "/>" │ │││ │ ╰─ attrName │ │││ ╰─ attrValue.value "async function (x) { console.log(\"y\") }" @@ -1033,7 +1049,7 @@ │ ││╰─ attrName │ │╰─ tagName ╰─ ╰─ openTagStart -128╭─ +130╭─ │ │││ │ ╰─ openTagEnd:selfClosed "/>" │ │││ ╰─ attrValue.value "x / (y[z])" │ ││├─ attrValue "= x / (y[z])" diff --git a/src/__tests__/fixtures/attr-operators-space-between/input.marko b/src/__tests__/fixtures/attr-operators-space-between/input.marko index 178a17c6..7242fec4 100644 --- a/src/__tests__/fixtures/attr-operators-space-between/input.marko +++ b/src/__tests__/fixtures/attr-operators-space-between/input.marko @@ -44,6 +44,7 @@ a=x in y a a=x in=y a=x in, y a=x instanceof y a +a=x satisfies y a a=x ++ + y a a=x+ ++ y a a=x ++ y a @@ -106,6 +107,7 @@ a = async function (x) { console.log("y") } a + diff --git a/src/states/EXPRESSION.ts b/src/states/EXPRESSION.ts index 5347968a..399ecc2a 100644 --- a/src/states/EXPRESSION.ts +++ b/src/states/EXPRESSION.ts @@ -30,7 +30,13 @@ const unaryKeywords = [ "void", ] as const; -const binaryKeywords = ["instanceof", "in", "as", "extends"] as const; +const binaryKeywords = [ + "instanceof", + "in", + "as", + "extends", + "satisfies", +] as const; export const EXPRESSION: StateDefinition = { name: "EXPRESSION",