From 8d929c9482b9d831d9f6a3ddf3501168b619a52c Mon Sep 17 00:00:00 2001 From: "alexander.akait" Date: Fri, 2 Dec 2022 16:19:06 +0300 Subject: [PATCH 01/42] perf(css/parser): reduce bad url token size --- crates/swc_css_ast/src/token.rs | 4 - crates/swc_css_parser/src/lexer/mod.rs | 3 - .../bad-url-token/double-quotes/output.json | 1 - .../double-quotes/span.swc-stderr | 2 +- .../recovery/bad-url-token/escaped/input.css | 3 + .../bad-url-token/escaped/output.json | 129 ++++++++++++++++ .../bad-url-token/escaped/output.swc-stderr | 8 + .../bad-url-token/escaped/span.swc-stderr | 140 ++++++++++++++++++ .../bad-url-token/invalid-escape/output.json | 1 - .../invalid-escape/span.swc-stderr | 2 +- .../left-parenthesis/output.json | 1 - .../left-parenthesis/span.swc-stderr | 2 +- .../bad-url-token/single-quotes/output.json | 1 - .../single-quotes/span.swc-stderr | 2 +- .../whitespace-in-middle/output.json | 1 - .../whitespace-in-middle/span.swc-stderr | 2 +- .../bad-url-token/whitespace/output.json | 1 - .../bad-url-token/whitespace/span.swc-stderr | 2 +- .../declaration/bad-value/output.json | 1 - .../declaration/bad-value/span.swc-stderr | 2 +- .../function/bad-comment-2/output.json | 1 - .../function/bad-comment-2/span.swc-stderr | 2 +- .../recovery/function/bad-comment/output.json | 1 - .../function/bad-comment/span.swc-stderr | 2 +- .../recovery/value/url/basic/output.json | 2 - .../recovery/value/url/basic/span.swc-stderr | 4 +- .../value/url/parenthesis/output.json | 1 - .../value/url/parenthesis/span.swc-stderr | 2 +- 28 files changed, 292 insertions(+), 31 deletions(-) create mode 100644 crates/swc_css_parser/tests/recovery/bad-url-token/escaped/input.css create mode 100644 crates/swc_css_parser/tests/recovery/bad-url-token/escaped/output.json create mode 100644 crates/swc_css_parser/tests/recovery/bad-url-token/escaped/output.swc-stderr create mode 100644 crates/swc_css_parser/tests/recovery/bad-url-token/escaped/span.swc-stderr diff --git a/crates/swc_css_ast/src/token.rs b/crates/swc_css_ast/src/token.rs index fad76ed6f68f..5f9a5cc23d91 100644 --- a/crates/swc_css_ast/src/token.rs +++ b/crates/swc_css_ast/src/token.rs @@ -97,8 +97,6 @@ pub enum Token { }, BadUrl { - #[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))] - name: JsWord, raw_name: Atom, raw_value: Atom, }, @@ -214,11 +212,9 @@ impl Hash for Token { raw_value.hash(state); } Token::BadUrl { - name, raw_name, raw_value, } => { - name.hash(state); raw_name.hash(state); raw_value.hash(state); } diff --git a/crates/swc_css_parser/src/lexer/mod.rs b/crates/swc_css_parser/src/lexer/mod.rs index 132485d08b8f..dc7a4f7865c8 100644 --- a/crates/swc_css_parser/src/lexer/mod.rs +++ b/crates/swc_css_parser/src/lexer/mod.rs @@ -885,7 +885,6 @@ where raw.push_str(&remnants.1); return Ok(Token::BadUrl { - name: name.0, raw_name: name.1, raw_value: (&**raw).into(), }); @@ -908,7 +907,6 @@ where raw.push_str(&remnants.1); return Ok(Token::BadUrl { - name: name.0, raw_name: name.1, raw_value: (&**raw).into(), }); @@ -939,7 +937,6 @@ where raw.push_str(&remnants.1); return Ok(Token::BadUrl { - name: name.0, raw_name: name.1, raw_value: (&**raw).into(), }); diff --git a/crates/swc_css_parser/tests/recovery/bad-url-token/double-quotes/output.json b/crates/swc_css_parser/tests/recovery/bad-url-token/double-quotes/output.json index 16f777bb37f6..2ce86242506d 100644 --- a/crates/swc_css_parser/tests/recovery/bad-url-token/double-quotes/output.json +++ b/crates/swc_css_parser/tests/recovery/bad-url-token/double-quotes/output.json @@ -114,7 +114,6 @@ }, "token": { "BadUrl": { - "name": "url", "raw_name": "url", "raw_value": "image\".png" } diff --git a/crates/swc_css_parser/tests/recovery/bad-url-token/double-quotes/span.swc-stderr b/crates/swc_css_parser/tests/recovery/bad-url-token/double-quotes/span.swc-stderr index 3578e8893ff3..636a1a12cde2 100644 --- a/crates/swc_css_parser/tests/recovery/bad-url-token/double-quotes/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/bad-url-token/double-quotes/span.swc-stderr @@ -135,7 +135,7 @@ 3 | color: red; `---- - x BadUrl { name: Atom('url' type=static), raw_name: "url", raw_value: "image\".png" } + x BadUrl { raw_name: "url", raw_value: "image\".png" } ,-[$DIR/tests/recovery/bad-url-token/double-quotes/input.css:1:1] 1 | div { 2 | background: url(image".png); diff --git a/crates/swc_css_parser/tests/recovery/bad-url-token/escaped/input.css b/crates/swc_css_parser/tests/recovery/bad-url-token/escaped/input.css new file mode 100644 index 000000000000..527bc55f35f3 --- /dev/null +++ b/crates/swc_css_parser/tests/recovery/bad-url-token/escaped/input.css @@ -0,0 +1,3 @@ +a { + background: \url(te st); +} \ No newline at end of file diff --git a/crates/swc_css_parser/tests/recovery/bad-url-token/escaped/output.json b/crates/swc_css_parser/tests/recovery/bad-url-token/escaped/output.json new file mode 100644 index 000000000000..edcc03f86f75 --- /dev/null +++ b/crates/swc_css_parser/tests/recovery/bad-url-token/escaped/output.json @@ -0,0 +1,129 @@ +{ + "type": "Stylesheet", + "span": { + "start": 1, + "end": 35, + "ctxt": 0 + }, + "rules": [ + { + "type": "QualifiedRule", + "span": { + "start": 1, + "end": 35, + "ctxt": 0 + }, + "prelude": { + "type": "SelectorList", + "span": { + "start": 1, + "end": 2, + "ctxt": 0 + }, + "children": [ + { + "type": "ComplexSelector", + "span": { + "start": 1, + "end": 2, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", + "span": { + "start": 1, + "end": 2, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": { + "type": "TagNameSelector", + "span": { + "start": 1, + "end": 2, + "ctxt": 0 + }, + "name": { + "type": "WqName", + "span": { + "start": 1, + "end": 2, + "ctxt": 0 + }, + "prefix": null, + "value": { + "type": "Ident", + "span": { + "start": 1, + "end": 2, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } + } + }, + "subclassSelectors": [] + } + ] + } + ] + }, + "block": { + "type": "SimpleBlock", + "span": { + "start": 3, + "end": 35, + "ctxt": 0 + }, + "name": { + "type": "PreservedToken", + "span": { + "start": 3, + "end": 4, + "ctxt": 0 + }, + "token": "LBrace" + }, + "value": [ + { + "type": "Declaration", + "span": { + "start": 9, + "end": 32, + "ctxt": 0 + }, + "name": { + "type": "Ident", + "span": { + "start": 9, + "end": 19, + "ctxt": 0 + }, + "value": "background", + "raw": "background" + }, + "value": [ + { + "type": "PreservedToken", + "span": { + "start": 21, + "end": 32, + "ctxt": 0 + }, + "token": { + "BadUrl": { + "raw_name": "\\url", + "raw_value": "te st" + } + } + } + ], + "important": null + } + ] + } + } + ] +} diff --git a/crates/swc_css_parser/tests/recovery/bad-url-token/escaped/output.swc-stderr b/crates/swc_css_parser/tests/recovery/bad-url-token/escaped/output.swc-stderr new file mode 100644 index 000000000000..3c53dd0086a5 --- /dev/null +++ b/crates/swc_css_parser/tests/recovery/bad-url-token/escaped/output.swc-stderr @@ -0,0 +1,8 @@ + + x Unexpected bad url in declaration value + ,-[$DIR/tests/recovery/bad-url-token/escaped/input.css:1:1] + 1 | a { + 2 | background: \url(te st); + : ^^^^^^^^^^^ + 3 | } + `---- diff --git a/crates/swc_css_parser/tests/recovery/bad-url-token/escaped/span.swc-stderr b/crates/swc_css_parser/tests/recovery/bad-url-token/escaped/span.swc-stderr new file mode 100644 index 000000000000..7a029f3f879d --- /dev/null +++ b/crates/swc_css_parser/tests/recovery/bad-url-token/escaped/span.swc-stderr @@ -0,0 +1,140 @@ + + x Stylesheet + ,-[$DIR/tests/recovery/bad-url-token/escaped/input.css:1:1] + 1 | ,-> a { + 2 | | background: \url(te st); + 3 | `-> } + `---- + + x Rule + ,-[$DIR/tests/recovery/bad-url-token/escaped/input.css:1:1] + 1 | ,-> a { + 2 | | background: \url(te st); + 3 | `-> } + `---- + + x QualifiedRule + ,-[$DIR/tests/recovery/bad-url-token/escaped/input.css:1:1] + 1 | ,-> a { + 2 | | background: \url(te st); + 3 | `-> } + `---- + + x SelectorList + ,-[$DIR/tests/recovery/bad-url-token/escaped/input.css:1:1] + 1 | a { + : ^ + 2 | background: \url(te st); + `---- + + x ComplexSelector + ,-[$DIR/tests/recovery/bad-url-token/escaped/input.css:1:1] + 1 | a { + : ^ + 2 | background: \url(te st); + `---- + + x CompoundSelector + ,-[$DIR/tests/recovery/bad-url-token/escaped/input.css:1:1] + 1 | a { + : ^ + 2 | background: \url(te st); + `---- + + x TypeSelector + ,-[$DIR/tests/recovery/bad-url-token/escaped/input.css:1:1] + 1 | a { + : ^ + 2 | background: \url(te st); + `---- + + x TagNameSelector + ,-[$DIR/tests/recovery/bad-url-token/escaped/input.css:1:1] + 1 | a { + : ^ + 2 | background: \url(te st); + `---- + + x WqName + ,-[$DIR/tests/recovery/bad-url-token/escaped/input.css:1:1] + 1 | a { + : ^ + 2 | background: \url(te st); + `---- + + x Ident + ,-[$DIR/tests/recovery/bad-url-token/escaped/input.css:1:1] + 1 | a { + : ^ + 2 | background: \url(te st); + `---- + + x SimpleBlock + ,-[$DIR/tests/recovery/bad-url-token/escaped/input.css:1:1] + 1 | ,-> a { + 2 | | background: \url(te st); + 3 | `-> } + `---- + + x LBrace + ,-[$DIR/tests/recovery/bad-url-token/escaped/input.css:1:1] + 1 | a { + : ^ + 2 | background: \url(te st); + `---- + + x ComponentValue + ,-[$DIR/tests/recovery/bad-url-token/escaped/input.css:1:1] + 1 | a { + 2 | background: \url(te st); + : ^^^^^^^^^^^^^^^^^^^^^^^ + 3 | } + `---- + + x StyleBlock + ,-[$DIR/tests/recovery/bad-url-token/escaped/input.css:1:1] + 1 | a { + 2 | background: \url(te st); + : ^^^^^^^^^^^^^^^^^^^^^^^ + 3 | } + `---- + + x Declaration + ,-[$DIR/tests/recovery/bad-url-token/escaped/input.css:1:1] + 1 | a { + 2 | background: \url(te st); + : ^^^^^^^^^^^^^^^^^^^^^^^ + 3 | } + `---- + + x DeclarationName + ,-[$DIR/tests/recovery/bad-url-token/escaped/input.css:1:1] + 1 | a { + 2 | background: \url(te st); + : ^^^^^^^^^^ + 3 | } + `---- + + x Ident + ,-[$DIR/tests/recovery/bad-url-token/escaped/input.css:1:1] + 1 | a { + 2 | background: \url(te st); + : ^^^^^^^^^^ + 3 | } + `---- + + x ComponentValue + ,-[$DIR/tests/recovery/bad-url-token/escaped/input.css:1:1] + 1 | a { + 2 | background: \url(te st); + : ^^^^^^^^^^^ + 3 | } + `---- + + x BadUrl { raw_name: "\\url", raw_value: "te st" } + ,-[$DIR/tests/recovery/bad-url-token/escaped/input.css:1:1] + 1 | a { + 2 | background: \url(te st); + : ^^^^^^^^^^^ + 3 | } + `---- diff --git a/crates/swc_css_parser/tests/recovery/bad-url-token/invalid-escape/output.json b/crates/swc_css_parser/tests/recovery/bad-url-token/invalid-escape/output.json index cacec20971c3..8c2ec1aa3663 100644 --- a/crates/swc_css_parser/tests/recovery/bad-url-token/invalid-escape/output.json +++ b/crates/swc_css_parser/tests/recovery/bad-url-token/invalid-escape/output.json @@ -114,7 +114,6 @@ }, "token": { "BadUrl": { - "name": "url", "raw_name": "url", "raw_value": "image.png\\\n " } diff --git a/crates/swc_css_parser/tests/recovery/bad-url-token/invalid-escape/span.swc-stderr b/crates/swc_css_parser/tests/recovery/bad-url-token/invalid-escape/span.swc-stderr index 59ee5e2f3dd9..3333d65ffa70 100644 --- a/crates/swc_css_parser/tests/recovery/bad-url-token/invalid-escape/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/bad-url-token/invalid-escape/span.swc-stderr @@ -135,7 +135,7 @@ 4 | } `---- - x BadUrl { name: Atom('url' type=static), raw_name: "url", raw_value: "image.png\\\n " } + x BadUrl { raw_name: "url", raw_value: "image.png\\\n " } ,-[$DIR/tests/recovery/bad-url-token/invalid-escape/input.css:1:1] 1 | div { 2 | ,-> background: url(image.png\ diff --git a/crates/swc_css_parser/tests/recovery/bad-url-token/left-parenthesis/output.json b/crates/swc_css_parser/tests/recovery/bad-url-token/left-parenthesis/output.json index 42e54f48eb4b..3539e355abc4 100644 --- a/crates/swc_css_parser/tests/recovery/bad-url-token/left-parenthesis/output.json +++ b/crates/swc_css_parser/tests/recovery/bad-url-token/left-parenthesis/output.json @@ -114,7 +114,6 @@ }, "token": { "BadUrl": { - "name": "url", "raw_name": "url", "raw_value": "image(.png" } diff --git a/crates/swc_css_parser/tests/recovery/bad-url-token/left-parenthesis/span.swc-stderr b/crates/swc_css_parser/tests/recovery/bad-url-token/left-parenthesis/span.swc-stderr index 3c4aa4d3884b..54efed47ec80 100644 --- a/crates/swc_css_parser/tests/recovery/bad-url-token/left-parenthesis/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/bad-url-token/left-parenthesis/span.swc-stderr @@ -135,7 +135,7 @@ 3 | color: red; `---- - x BadUrl { name: Atom('url' type=static), raw_name: "url", raw_value: "image(.png" } + x BadUrl { raw_name: "url", raw_value: "image(.png" } ,-[$DIR/tests/recovery/bad-url-token/left-parenthesis/input.css:1:1] 1 | div { 2 | background: url(image(.png); diff --git a/crates/swc_css_parser/tests/recovery/bad-url-token/single-quotes/output.json b/crates/swc_css_parser/tests/recovery/bad-url-token/single-quotes/output.json index 3205f7476f8e..f5985085d5e3 100644 --- a/crates/swc_css_parser/tests/recovery/bad-url-token/single-quotes/output.json +++ b/crates/swc_css_parser/tests/recovery/bad-url-token/single-quotes/output.json @@ -114,7 +114,6 @@ }, "token": { "BadUrl": { - "name": "url", "raw_name": "url", "raw_value": "image'.png" } diff --git a/crates/swc_css_parser/tests/recovery/bad-url-token/single-quotes/span.swc-stderr b/crates/swc_css_parser/tests/recovery/bad-url-token/single-quotes/span.swc-stderr index cbca903d9c8b..bff481cf86e5 100644 --- a/crates/swc_css_parser/tests/recovery/bad-url-token/single-quotes/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/bad-url-token/single-quotes/span.swc-stderr @@ -135,7 +135,7 @@ 3 | color: red; `---- - x BadUrl { name: Atom('url' type=static), raw_name: "url", raw_value: "image'.png" } + x BadUrl { raw_name: "url", raw_value: "image'.png" } ,-[$DIR/tests/recovery/bad-url-token/single-quotes/input.css:1:1] 1 | div { 2 | background: url(image'.png); diff --git a/crates/swc_css_parser/tests/recovery/bad-url-token/whitespace-in-middle/output.json b/crates/swc_css_parser/tests/recovery/bad-url-token/whitespace-in-middle/output.json index c21c2da11bb7..44c087d8e8cd 100644 --- a/crates/swc_css_parser/tests/recovery/bad-url-token/whitespace-in-middle/output.json +++ b/crates/swc_css_parser/tests/recovery/bad-url-token/whitespace-in-middle/output.json @@ -114,7 +114,6 @@ }, "token": { "BadUrl": { - "name": "url", "raw_name": "url", "raw_value": " ./image.jpg a " } diff --git a/crates/swc_css_parser/tests/recovery/bad-url-token/whitespace-in-middle/span.swc-stderr b/crates/swc_css_parser/tests/recovery/bad-url-token/whitespace-in-middle/span.swc-stderr index 7395de24269a..816a52087d0f 100644 --- a/crates/swc_css_parser/tests/recovery/bad-url-token/whitespace-in-middle/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/bad-url-token/whitespace-in-middle/span.swc-stderr @@ -131,7 +131,7 @@ 3 | } `---- - x BadUrl { name: Atom('url' type=static), raw_name: "url", raw_value: " ./image.jpg a " } + x BadUrl { raw_name: "url", raw_value: " ./image.jpg a " } ,-[$DIR/tests/recovery/bad-url-token/whitespace-in-middle/input.css:1:1] 1 | a { 2 | background-image: url( ./image.jpg a ); diff --git a/crates/swc_css_parser/tests/recovery/bad-url-token/whitespace/output.json b/crates/swc_css_parser/tests/recovery/bad-url-token/whitespace/output.json index 7e58c723fbe2..8bfbcc1b86ca 100644 --- a/crates/swc_css_parser/tests/recovery/bad-url-token/whitespace/output.json +++ b/crates/swc_css_parser/tests/recovery/bad-url-token/whitespace/output.json @@ -114,7 +114,6 @@ }, "token": { "BadUrl": { - "name": "url", "raw_name": "url", "raw_value": "image.\n png" } diff --git a/crates/swc_css_parser/tests/recovery/bad-url-token/whitespace/span.swc-stderr b/crates/swc_css_parser/tests/recovery/bad-url-token/whitespace/span.swc-stderr index 063cd4465856..3ff8ae850a22 100644 --- a/crates/swc_css_parser/tests/recovery/bad-url-token/whitespace/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/bad-url-token/whitespace/span.swc-stderr @@ -139,7 +139,7 @@ 4 | color: red; `---- - x BadUrl { name: Atom('url' type=static), raw_name: "url", raw_value: "image.\n png" } + x BadUrl { raw_name: "url", raw_value: "image.\n png" } ,-[$DIR/tests/recovery/bad-url-token/whitespace/input.css:1:1] 1 | div { 2 | ,-> background: url(image. diff --git a/crates/swc_css_parser/tests/recovery/declaration/bad-value/output.json b/crates/swc_css_parser/tests/recovery/declaration/bad-value/output.json index 4483d20d3f50..376f57cc342e 100644 --- a/crates/swc_css_parser/tests/recovery/declaration/bad-value/output.json +++ b/crates/swc_css_parser/tests/recovery/declaration/bad-value/output.json @@ -174,7 +174,6 @@ }, "token": { "BadUrl": { - "name": "url", "raw_name": "url", "raw_value": "test test" } diff --git a/crates/swc_css_parser/tests/recovery/declaration/bad-value/span.swc-stderr b/crates/swc_css_parser/tests/recovery/declaration/bad-value/span.swc-stderr index 93085d94aace..cd7586be00df 100644 --- a/crates/swc_css_parser/tests/recovery/declaration/bad-value/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/declaration/bad-value/span.swc-stderr @@ -287,7 +287,7 @@ 5 | --foo: !; `---- - x BadUrl { name: Atom('url' type=static), raw_name: "url", raw_value: "test test" } + x BadUrl { raw_name: "url", raw_value: "test test" } ,-[$DIR/tests/recovery/declaration/bad-value/input.css:3:1] 3 | value: ]; 4 | value: url(test test); diff --git a/crates/swc_css_parser/tests/recovery/function/bad-comment-2/output.json b/crates/swc_css_parser/tests/recovery/function/bad-comment-2/output.json index 95232e7864f1..8a3b6825d255 100644 --- a/crates/swc_css_parser/tests/recovery/function/bad-comment-2/output.json +++ b/crates/swc_css_parser/tests/recovery/function/bad-comment-2/output.json @@ -114,7 +114,6 @@ }, "token": { "BadUrl": { - "name": "url", "raw_name": "url", "raw_value": "\n /* test */\n \"test.png\"\n " } diff --git a/crates/swc_css_parser/tests/recovery/function/bad-comment-2/span.swc-stderr b/crates/swc_css_parser/tests/recovery/function/bad-comment-2/span.swc-stderr index 2233bbed56a6..a659daab63d1 100644 --- a/crates/swc_css_parser/tests/recovery/function/bad-comment-2/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/function/bad-comment-2/span.swc-stderr @@ -151,7 +151,7 @@ 6 | } `---- - x BadUrl { name: Atom('url' type=static), raw_name: "url", raw_value: "\n /* test */\n \"test.png\"\n " } + x BadUrl { raw_name: "url", raw_value: "\n /* test */\n \"test.png\"\n " } ,-[$DIR/tests/recovery/function/bad-comment-2/input.css:1:1] 1 | a { 2 | ,-> background: url( diff --git a/crates/swc_css_parser/tests/recovery/function/bad-comment/output.json b/crates/swc_css_parser/tests/recovery/function/bad-comment/output.json index 0336f83f2cdf..bceaf0e7b51e 100644 --- a/crates/swc_css_parser/tests/recovery/function/bad-comment/output.json +++ b/crates/swc_css_parser/tests/recovery/function/bad-comment/output.json @@ -114,7 +114,6 @@ }, "token": { "BadUrl": { - "name": "url", "raw_name": "url", "raw_value": "\n /* test */\n test.png\n " } diff --git a/crates/swc_css_parser/tests/recovery/function/bad-comment/span.swc-stderr b/crates/swc_css_parser/tests/recovery/function/bad-comment/span.swc-stderr index b97ea238bfc4..b323b9a8f3ef 100644 --- a/crates/swc_css_parser/tests/recovery/function/bad-comment/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/function/bad-comment/span.swc-stderr @@ -151,7 +151,7 @@ 6 | } `---- - x BadUrl { name: Atom('url' type=static), raw_name: "url", raw_value: "\n /* test */\n test.png\n " } + x BadUrl { raw_name: "url", raw_value: "\n /* test */\n test.png\n " } ,-[$DIR/tests/recovery/function/bad-comment/input.css:1:1] 1 | a { 2 | ,-> background: url( diff --git a/crates/swc_css_parser/tests/recovery/value/url/basic/output.json b/crates/swc_css_parser/tests/recovery/value/url/basic/output.json index 48ea67f98d25..5eb4ef658213 100644 --- a/crates/swc_css_parser/tests/recovery/value/url/basic/output.json +++ b/crates/swc_css_parser/tests/recovery/value/url/basic/output.json @@ -149,7 +149,6 @@ }, "token": { "BadUrl": { - "name": "url", "raw_name": "url", "raw_value": "var(--foo" } @@ -552,7 +551,6 @@ }, "token": { "BadUrl": { - "name": "url", "raw_name": "url", "raw_value": "image.png param(var(--url" } diff --git a/crates/swc_css_parser/tests/recovery/value/url/basic/span.swc-stderr b/crates/swc_css_parser/tests/recovery/value/url/basic/span.swc-stderr index a77fb944811e..8a456844f393 100644 --- a/crates/swc_css_parser/tests/recovery/value/url/basic/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/value/url/basic/span.swc-stderr @@ -223,7 +223,7 @@ 4 | background: url(image.png\999999); `---- - x BadUrl { name: Atom('url' type=static), raw_name: "url", raw_value: "var(--foo" } + x BadUrl { raw_name: "url", raw_value: "var(--foo" } ,-[$DIR/tests/recovery/value/url/basic/input.css:2:1] 2 | --foo: "http://www.example.com/pinkish.gif"; 3 | background: url(var(--foo)); @@ -831,7 +831,7 @@ 14 | } `---- - x BadUrl { name: Atom('url' type=static), raw_name: "url", raw_value: "image.png param(var(--url" } + x BadUrl { raw_name: "url", raw_value: "image.png param(var(--url" } ,-[$DIR/tests/recovery/value/url/basic/input.css:12:1] 12 | .foo { 13 | background: url(image.png param(var(--url))); diff --git a/crates/swc_css_parser/tests/recovery/value/url/parenthesis/output.json b/crates/swc_css_parser/tests/recovery/value/url/parenthesis/output.json index e6241c5aa5ce..ed4353ffb5d6 100644 --- a/crates/swc_css_parser/tests/recovery/value/url/parenthesis/output.json +++ b/crates/swc_css_parser/tests/recovery/value/url/parenthesis/output.json @@ -114,7 +114,6 @@ }, "token": { "BadUrl": { - "name": "url", "raw_name": "url", "raw_value": "test\\);\n}" } diff --git a/crates/swc_css_parser/tests/recovery/value/url/parenthesis/span.swc-stderr b/crates/swc_css_parser/tests/recovery/value/url/parenthesis/span.swc-stderr index 1f6ae721f169..5cb1cd03bd5e 100644 --- a/crates/swc_css_parser/tests/recovery/value/url/parenthesis/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/value/url/parenthesis/span.swc-stderr @@ -127,7 +127,7 @@ 3 | `-> } `---- - x BadUrl { name: Atom('url' type=static), raw_name: "url", raw_value: "test\\);\n}" } + x BadUrl { raw_name: "url", raw_value: "test\\);\n}" } ,-[$DIR/tests/recovery/value/url/parenthesis/input.css:1:1] 1 | a { 2 | ,-> background: url(test\); From efecfbb58c9b7c8f3a328acf4e6ff4440622f445 Mon Sep 17 00:00:00 2001 From: "alexander.akait" Date: Fri, 2 Dec 2022 16:49:20 +0300 Subject: [PATCH 02/42] perf(css/parser): reduce token size --- crates/swc_css_ast/src/token.rs | 32 +++++++------------ crates/swc_css_parser/src/lexer/mod.rs | 23 +++++-------- .../src/parser/values_and_units/mod.rs | 13 +++----- .../selector/pseudo-class/unknown/output.json | 6 ++-- .../pseudo-class/unknown/span.swc-stderr | 2 +- .../pseudo-element/unknown/output.json | 6 ++-- .../pseudo-element/unknown/span.swc-stderr | 2 +- .../bad-url-token/double-quotes/output.json | 6 ++-- .../double-quotes/span.swc-stderr | 2 +- .../bad-url-token/escaped/output.json | 6 ++-- .../bad-url-token/escaped/span.swc-stderr | 2 +- .../bad-url-token/invalid-escape/output.json | 6 ++-- .../invalid-escape/span.swc-stderr | 2 +- .../left-parenthesis/output.json | 6 ++-- .../left-parenthesis/span.swc-stderr | 2 +- .../bad-url-token/single-quotes/output.json | 6 ++-- .../single-quotes/span.swc-stderr | 2 +- .../whitespace-in-middle/output.json | 6 ++-- .../whitespace-in-middle/span.swc-stderr | 2 +- .../bad-url-token/whitespace/output.json | 6 ++-- .../bad-url-token/whitespace/span.swc-stderr | 2 +- .../declaration/bad-value/output.json | 6 ++-- .../declaration/bad-value/span.swc-stderr | 2 +- .../function/bad-comment-2/output.json | 6 ++-- .../function/bad-comment-2/span.swc-stderr | 2 +- .../recovery/function/bad-comment/output.json | 6 ++-- .../function/bad-comment/span.swc-stderr | 2 +- .../tests/recovery/value/quotes/output.json | 4 +-- .../recovery/value/quotes/span.swc-stderr | 4 +-- .../recovery/value/string/newline/output.json | 2 +- .../value/string/newline/span.swc-stderr | 2 +- .../recovery/value/url/basic/output.json | 12 ++++--- .../recovery/value/url/basic/span.swc-stderr | 4 +-- .../value/url/parenthesis/output.json | 6 ++-- .../value/url/parenthesis/span.swc-stderr | 2 +- 35 files changed, 104 insertions(+), 96 deletions(-) diff --git a/crates/swc_css_ast/src/token.rs b/crates/swc_css_ast/src/token.rs index 5f9a5cc23d91..0ddd3ab30fc6 100644 --- a/crates/swc_css_ast/src/token.rs +++ b/crates/swc_css_ast/src/token.rs @@ -83,22 +83,22 @@ pub enum Token { }, BadString { - raw_value: Atom, + raw: Atom, }, /// `url(value)` Url { #[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))] name: JsWord, - raw_name: Atom, #[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))] value: JsWord, - raw_value: Atom, + /// Name and value + raw: Box<(Atom, Atom)>, }, BadUrl { - raw_name: Atom, - raw_value: Atom, + /// Name and value + raw: Box<(Atom, Atom)>, }, Delim { @@ -192,31 +192,21 @@ impl Hash for Token { value.hash(state); raw.hash(state); } - Token::BadString { raw_value } => { - raw_value.hash(state); + Token::BadString { raw } => { + raw.hash(state); } Token::Hash { value, raw, is_id } => { value.hash(state); raw.hash(state); is_id.hash(state); } - Token::Url { - name, - raw_name, - value, - raw_value, - } => { + Token::Url { name, value, raw } => { name.hash(state); - raw_name.hash(state); value.hash(state); - raw_value.hash(state); + raw.hash(state); } - Token::BadUrl { - raw_name, - raw_value, - } => { - raw_name.hash(state); - raw_value.hash(state); + Token::BadUrl { raw } => { + raw.hash(state); } Token::Delim { value } => { value.hash(state); diff --git a/crates/swc_css_parser/src/lexer/mod.rs b/crates/swc_css_parser/src/lexer/mod.rs index dc7a4f7865c8..f42faf30eb0b 100644 --- a/crates/swc_css_parser/src/lexer/mod.rs +++ b/crates/swc_css_parser/src/lexer/mod.rs @@ -730,7 +730,7 @@ where l.reconsume(); return Ok(Token::BadString { - raw_value: (&**raw).into(), + raw: (&**raw).into(), }); } @@ -805,9 +805,8 @@ where Some(')') => { return Ok(Token::Url { name: name.0, - raw_name: name.1, value: (&**out).into(), - raw_value: (&**raw).into(), + raw: Box::new((name.1, (&**raw).into())), }); } @@ -818,9 +817,8 @@ where return Ok(Token::Url { name: name.0, - raw_name: name.1, value: (&**out).into(), - raw_value: (&**raw).into(), + raw: Box::new((name.1, (&**raw).into())), }); } @@ -854,9 +852,8 @@ where return Ok(Token::Url { name: name.0, - raw_name: name.1, value: (&**out).into(), - raw_value: (&**raw).into(), + raw: Box::new((name.1, (&**raw).into())), }); } None => { @@ -866,9 +863,8 @@ where return Ok(Token::Url { name: name.0, - raw_name: name.1, value: (&**out).into(), - raw_value: (&**raw).into(), + raw: Box::new((name.1, (&**raw).into())), }); } _ => {} @@ -885,8 +881,7 @@ where raw.push_str(&remnants.1); return Ok(Token::BadUrl { - raw_name: name.1, - raw_value: (&**raw).into(), + raw: Box::new((name.1, (&**raw).into())), }); } @@ -907,8 +902,7 @@ where raw.push_str(&remnants.1); return Ok(Token::BadUrl { - raw_name: name.1, - raw_value: (&**raw).into(), + raw: Box::new((name.1, (&**raw).into())), }); } @@ -937,8 +931,7 @@ where raw.push_str(&remnants.1); return Ok(Token::BadUrl { - raw_name: name.1, - raw_value: (&**raw).into(), + raw: Box::new((name.1, (&**raw).into())), }); } } diff --git a/crates/swc_css_parser/src/parser/values_and_units/mod.rs b/crates/swc_css_parser/src/parser/values_and_units/mod.rs index 823a72744724..cc52b86b18ae 100644 --- a/crates/swc_css_parser/src/parser/values_and_units/mod.rs +++ b/crates/swc_css_parser/src/parser/values_and_units/mod.rs @@ -2535,17 +2535,12 @@ where } match bump!(self) { - Token::Url { - name, - raw_name, - value, - raw_value, - } => { - let name_length = raw_name.len() as u32; + Token::Url { name, value, raw } => { + let name_length = raw.0.len() as u32; let name = Ident { span: Span::new(span.lo, span.lo + BytePos(name_length), Default::default()), value: name, - raw: Some(raw_name), + raw: Some(raw.0), }; let value = Some(Box::new(UrlValue::Raw(UrlValueRaw { span: Span::new( @@ -2554,7 +2549,7 @@ where Default::default(), ), value, - raw: Some(raw_value), + raw: Some(raw.1), }))); Ok(Url { diff --git a/crates/swc_css_parser/tests/fixture/selector/pseudo-class/unknown/output.json b/crates/swc_css_parser/tests/fixture/selector/pseudo-class/unknown/output.json index 531f1c88f2ce..e3850f5b6ff0 100644 --- a/crates/swc_css_parser/tests/fixture/selector/pseudo-class/unknown/output.json +++ b/crates/swc_css_parser/tests/fixture/selector/pseudo-class/unknown/output.json @@ -1770,9 +1770,11 @@ "token": { "Url": { "name": "url", - "raw_name": "url", "value": "foo.png", - "raw_value": "foo.png" + "raw": [ + "url", + "foo.png" + ] } } } diff --git a/crates/swc_css_parser/tests/fixture/selector/pseudo-class/unknown/span.swc-stderr b/crates/swc_css_parser/tests/fixture/selector/pseudo-class/unknown/span.swc-stderr index b5c6be92f01a..b8f299187f2f 100644 --- a/crates/swc_css_parser/tests/fixture/selector/pseudo-class/unknown/span.swc-stderr +++ b/crates/swc_css_parser/tests/fixture/selector/pseudo-class/unknown/span.swc-stderr @@ -2037,7 +2037,7 @@ 16 | :unknown({!}) {} `---- - x Url { name: Atom('url' type=static), raw_name: "url", value: Atom('foo.png' type=inline), raw_value: "foo.png" } + x Url { name: Atom('url' type=static), value: Atom('foo.png' type=inline), raw: ("url", "foo.png") } ,-[$DIR/tests/fixture/selector/pseudo-class/unknown/input.css:14:1] 14 | :unknown('string') {} 15 | :unknown(url(foo.png)) {} diff --git a/crates/swc_css_parser/tests/fixture/selector/pseudo-element/unknown/output.json b/crates/swc_css_parser/tests/fixture/selector/pseudo-element/unknown/output.json index 46d3f3756c15..70438cc9d916 100644 --- a/crates/swc_css_parser/tests/fixture/selector/pseudo-element/unknown/output.json +++ b/crates/swc_css_parser/tests/fixture/selector/pseudo-element/unknown/output.json @@ -1770,9 +1770,11 @@ "token": { "Url": { "name": "url", - "raw_name": "url", "value": "foo.png", - "raw_value": "foo.png" + "raw": [ + "url", + "foo.png" + ] } } } diff --git a/crates/swc_css_parser/tests/fixture/selector/pseudo-element/unknown/span.swc-stderr b/crates/swc_css_parser/tests/fixture/selector/pseudo-element/unknown/span.swc-stderr index 8430db1bf489..13126af02330 100644 --- a/crates/swc_css_parser/tests/fixture/selector/pseudo-element/unknown/span.swc-stderr +++ b/crates/swc_css_parser/tests/fixture/selector/pseudo-element/unknown/span.swc-stderr @@ -2036,7 +2036,7 @@ 16 | ::unknown({!}) {} `---- - x Url { name: Atom('url' type=static), raw_name: "url", value: Atom('foo.png' type=inline), raw_value: "foo.png" } + x Url { name: Atom('url' type=static), value: Atom('foo.png' type=inline), raw: ("url", "foo.png") } ,-[$DIR/tests/fixture/selector/pseudo-element/unknown/input.css:14:1] 14 | ::unknown('string') {} 15 | ::unknown(url(foo.png)) {} diff --git a/crates/swc_css_parser/tests/recovery/bad-url-token/double-quotes/output.json b/crates/swc_css_parser/tests/recovery/bad-url-token/double-quotes/output.json index 2ce86242506d..9f039e1f7385 100644 --- a/crates/swc_css_parser/tests/recovery/bad-url-token/double-quotes/output.json +++ b/crates/swc_css_parser/tests/recovery/bad-url-token/double-quotes/output.json @@ -114,8 +114,10 @@ }, "token": { "BadUrl": { - "raw_name": "url", - "raw_value": "image\".png" + "raw": [ + "url", + "image\".png" + ] } } } diff --git a/crates/swc_css_parser/tests/recovery/bad-url-token/double-quotes/span.swc-stderr b/crates/swc_css_parser/tests/recovery/bad-url-token/double-quotes/span.swc-stderr index 636a1a12cde2..2bce68a0dca2 100644 --- a/crates/swc_css_parser/tests/recovery/bad-url-token/double-quotes/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/bad-url-token/double-quotes/span.swc-stderr @@ -135,7 +135,7 @@ 3 | color: red; `---- - x BadUrl { raw_name: "url", raw_value: "image\".png" } + x BadUrl { raw: ("url", "image\".png") } ,-[$DIR/tests/recovery/bad-url-token/double-quotes/input.css:1:1] 1 | div { 2 | background: url(image".png); diff --git a/crates/swc_css_parser/tests/recovery/bad-url-token/escaped/output.json b/crates/swc_css_parser/tests/recovery/bad-url-token/escaped/output.json index edcc03f86f75..28d4b083c84e 100644 --- a/crates/swc_css_parser/tests/recovery/bad-url-token/escaped/output.json +++ b/crates/swc_css_parser/tests/recovery/bad-url-token/escaped/output.json @@ -114,8 +114,10 @@ }, "token": { "BadUrl": { - "raw_name": "\\url", - "raw_value": "te st" + "raw": [ + "\\url", + "te st" + ] } } } diff --git a/crates/swc_css_parser/tests/recovery/bad-url-token/escaped/span.swc-stderr b/crates/swc_css_parser/tests/recovery/bad-url-token/escaped/span.swc-stderr index 7a029f3f879d..b1575b0dc1c3 100644 --- a/crates/swc_css_parser/tests/recovery/bad-url-token/escaped/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/bad-url-token/escaped/span.swc-stderr @@ -131,7 +131,7 @@ 3 | } `---- - x BadUrl { raw_name: "\\url", raw_value: "te st" } + x BadUrl { raw: ("\\url", "te st") } ,-[$DIR/tests/recovery/bad-url-token/escaped/input.css:1:1] 1 | a { 2 | background: \url(te st); diff --git a/crates/swc_css_parser/tests/recovery/bad-url-token/invalid-escape/output.json b/crates/swc_css_parser/tests/recovery/bad-url-token/invalid-escape/output.json index 8c2ec1aa3663..84ff8c412bc3 100644 --- a/crates/swc_css_parser/tests/recovery/bad-url-token/invalid-escape/output.json +++ b/crates/swc_css_parser/tests/recovery/bad-url-token/invalid-escape/output.json @@ -114,8 +114,10 @@ }, "token": { "BadUrl": { - "raw_name": "url", - "raw_value": "image.png\\\n " + "raw": [ + "url", + "image.png\\\n " + ] } } } diff --git a/crates/swc_css_parser/tests/recovery/bad-url-token/invalid-escape/span.swc-stderr b/crates/swc_css_parser/tests/recovery/bad-url-token/invalid-escape/span.swc-stderr index 3333d65ffa70..b9c173a85d47 100644 --- a/crates/swc_css_parser/tests/recovery/bad-url-token/invalid-escape/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/bad-url-token/invalid-escape/span.swc-stderr @@ -135,7 +135,7 @@ 4 | } `---- - x BadUrl { raw_name: "url", raw_value: "image.png\\\n " } + x BadUrl { raw: ("url", "image.png\\\n ") } ,-[$DIR/tests/recovery/bad-url-token/invalid-escape/input.css:1:1] 1 | div { 2 | ,-> background: url(image.png\ diff --git a/crates/swc_css_parser/tests/recovery/bad-url-token/left-parenthesis/output.json b/crates/swc_css_parser/tests/recovery/bad-url-token/left-parenthesis/output.json index 3539e355abc4..98f7ececc3eb 100644 --- a/crates/swc_css_parser/tests/recovery/bad-url-token/left-parenthesis/output.json +++ b/crates/swc_css_parser/tests/recovery/bad-url-token/left-parenthesis/output.json @@ -114,8 +114,10 @@ }, "token": { "BadUrl": { - "raw_name": "url", - "raw_value": "image(.png" + "raw": [ + "url", + "image(.png" + ] } } } diff --git a/crates/swc_css_parser/tests/recovery/bad-url-token/left-parenthesis/span.swc-stderr b/crates/swc_css_parser/tests/recovery/bad-url-token/left-parenthesis/span.swc-stderr index 54efed47ec80..a122cc30c14c 100644 --- a/crates/swc_css_parser/tests/recovery/bad-url-token/left-parenthesis/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/bad-url-token/left-parenthesis/span.swc-stderr @@ -135,7 +135,7 @@ 3 | color: red; `---- - x BadUrl { raw_name: "url", raw_value: "image(.png" } + x BadUrl { raw: ("url", "image(.png") } ,-[$DIR/tests/recovery/bad-url-token/left-parenthesis/input.css:1:1] 1 | div { 2 | background: url(image(.png); diff --git a/crates/swc_css_parser/tests/recovery/bad-url-token/single-quotes/output.json b/crates/swc_css_parser/tests/recovery/bad-url-token/single-quotes/output.json index f5985085d5e3..b61fd8957dd3 100644 --- a/crates/swc_css_parser/tests/recovery/bad-url-token/single-quotes/output.json +++ b/crates/swc_css_parser/tests/recovery/bad-url-token/single-quotes/output.json @@ -114,8 +114,10 @@ }, "token": { "BadUrl": { - "raw_name": "url", - "raw_value": "image'.png" + "raw": [ + "url", + "image'.png" + ] } } } diff --git a/crates/swc_css_parser/tests/recovery/bad-url-token/single-quotes/span.swc-stderr b/crates/swc_css_parser/tests/recovery/bad-url-token/single-quotes/span.swc-stderr index bff481cf86e5..9de9bb2d0a9c 100644 --- a/crates/swc_css_parser/tests/recovery/bad-url-token/single-quotes/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/bad-url-token/single-quotes/span.swc-stderr @@ -135,7 +135,7 @@ 3 | color: red; `---- - x BadUrl { raw_name: "url", raw_value: "image'.png" } + x BadUrl { raw: ("url", "image'.png") } ,-[$DIR/tests/recovery/bad-url-token/single-quotes/input.css:1:1] 1 | div { 2 | background: url(image'.png); diff --git a/crates/swc_css_parser/tests/recovery/bad-url-token/whitespace-in-middle/output.json b/crates/swc_css_parser/tests/recovery/bad-url-token/whitespace-in-middle/output.json index 44c087d8e8cd..2ef725b75a2b 100644 --- a/crates/swc_css_parser/tests/recovery/bad-url-token/whitespace-in-middle/output.json +++ b/crates/swc_css_parser/tests/recovery/bad-url-token/whitespace-in-middle/output.json @@ -114,8 +114,10 @@ }, "token": { "BadUrl": { - "raw_name": "url", - "raw_value": " ./image.jpg a " + "raw": [ + "url", + " ./image.jpg a " + ] } } } diff --git a/crates/swc_css_parser/tests/recovery/bad-url-token/whitespace-in-middle/span.swc-stderr b/crates/swc_css_parser/tests/recovery/bad-url-token/whitespace-in-middle/span.swc-stderr index 816a52087d0f..b8028d995c80 100644 --- a/crates/swc_css_parser/tests/recovery/bad-url-token/whitespace-in-middle/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/bad-url-token/whitespace-in-middle/span.swc-stderr @@ -131,7 +131,7 @@ 3 | } `---- - x BadUrl { raw_name: "url", raw_value: " ./image.jpg a " } + x BadUrl { raw: ("url", " ./image.jpg a ") } ,-[$DIR/tests/recovery/bad-url-token/whitespace-in-middle/input.css:1:1] 1 | a { 2 | background-image: url( ./image.jpg a ); diff --git a/crates/swc_css_parser/tests/recovery/bad-url-token/whitespace/output.json b/crates/swc_css_parser/tests/recovery/bad-url-token/whitespace/output.json index 8bfbcc1b86ca..7c8f4fc0b07b 100644 --- a/crates/swc_css_parser/tests/recovery/bad-url-token/whitespace/output.json +++ b/crates/swc_css_parser/tests/recovery/bad-url-token/whitespace/output.json @@ -114,8 +114,10 @@ }, "token": { "BadUrl": { - "raw_name": "url", - "raw_value": "image.\n png" + "raw": [ + "url", + "image.\n png" + ] } } } diff --git a/crates/swc_css_parser/tests/recovery/bad-url-token/whitespace/span.swc-stderr b/crates/swc_css_parser/tests/recovery/bad-url-token/whitespace/span.swc-stderr index 3ff8ae850a22..e2f00c674c48 100644 --- a/crates/swc_css_parser/tests/recovery/bad-url-token/whitespace/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/bad-url-token/whitespace/span.swc-stderr @@ -139,7 +139,7 @@ 4 | color: red; `---- - x BadUrl { raw_name: "url", raw_value: "image.\n png" } + x BadUrl { raw: ("url", "image.\n png") } ,-[$DIR/tests/recovery/bad-url-token/whitespace/input.css:1:1] 1 | div { 2 | ,-> background: url(image. diff --git a/crates/swc_css_parser/tests/recovery/declaration/bad-value/output.json b/crates/swc_css_parser/tests/recovery/declaration/bad-value/output.json index 376f57cc342e..29d7873d2ab2 100644 --- a/crates/swc_css_parser/tests/recovery/declaration/bad-value/output.json +++ b/crates/swc_css_parser/tests/recovery/declaration/bad-value/output.json @@ -174,8 +174,10 @@ }, "token": { "BadUrl": { - "raw_name": "url", - "raw_value": "test test" + "raw": [ + "url", + "test test" + ] } } } diff --git a/crates/swc_css_parser/tests/recovery/declaration/bad-value/span.swc-stderr b/crates/swc_css_parser/tests/recovery/declaration/bad-value/span.swc-stderr index cd7586be00df..15e5f454ac22 100644 --- a/crates/swc_css_parser/tests/recovery/declaration/bad-value/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/declaration/bad-value/span.swc-stderr @@ -287,7 +287,7 @@ 5 | --foo: !; `---- - x BadUrl { raw_name: "url", raw_value: "test test" } + x BadUrl { raw: ("url", "test test") } ,-[$DIR/tests/recovery/declaration/bad-value/input.css:3:1] 3 | value: ]; 4 | value: url(test test); diff --git a/crates/swc_css_parser/tests/recovery/function/bad-comment-2/output.json b/crates/swc_css_parser/tests/recovery/function/bad-comment-2/output.json index 8a3b6825d255..37a5d152c1b3 100644 --- a/crates/swc_css_parser/tests/recovery/function/bad-comment-2/output.json +++ b/crates/swc_css_parser/tests/recovery/function/bad-comment-2/output.json @@ -114,8 +114,10 @@ }, "token": { "BadUrl": { - "raw_name": "url", - "raw_value": "\n /* test */\n \"test.png\"\n " + "raw": [ + "url", + "\n /* test */\n \"test.png\"\n " + ] } } } diff --git a/crates/swc_css_parser/tests/recovery/function/bad-comment-2/span.swc-stderr b/crates/swc_css_parser/tests/recovery/function/bad-comment-2/span.swc-stderr index a659daab63d1..3f6c7277c931 100644 --- a/crates/swc_css_parser/tests/recovery/function/bad-comment-2/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/function/bad-comment-2/span.swc-stderr @@ -151,7 +151,7 @@ 6 | } `---- - x BadUrl { raw_name: "url", raw_value: "\n /* test */\n \"test.png\"\n " } + x BadUrl { raw: ("url", "\n /* test */\n \"test.png\"\n ") } ,-[$DIR/tests/recovery/function/bad-comment-2/input.css:1:1] 1 | a { 2 | ,-> background: url( diff --git a/crates/swc_css_parser/tests/recovery/function/bad-comment/output.json b/crates/swc_css_parser/tests/recovery/function/bad-comment/output.json index bceaf0e7b51e..bffc9da4d234 100644 --- a/crates/swc_css_parser/tests/recovery/function/bad-comment/output.json +++ b/crates/swc_css_parser/tests/recovery/function/bad-comment/output.json @@ -114,8 +114,10 @@ }, "token": { "BadUrl": { - "raw_name": "url", - "raw_value": "\n /* test */\n test.png\n " + "raw": [ + "url", + "\n /* test */\n test.png\n " + ] } } } diff --git a/crates/swc_css_parser/tests/recovery/function/bad-comment/span.swc-stderr b/crates/swc_css_parser/tests/recovery/function/bad-comment/span.swc-stderr index b323b9a8f3ef..1fe352ff235d 100644 --- a/crates/swc_css_parser/tests/recovery/function/bad-comment/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/function/bad-comment/span.swc-stderr @@ -151,7 +151,7 @@ 6 | } `---- - x BadUrl { raw_name: "url", raw_value: "\n /* test */\n test.png\n " } + x BadUrl { raw: ("url", "\n /* test */\n test.png\n ") } ,-[$DIR/tests/recovery/function/bad-comment/input.css:1:1] 1 | a { 2 | ,-> background: url( diff --git a/crates/swc_css_parser/tests/recovery/value/quotes/output.json b/crates/swc_css_parser/tests/recovery/value/quotes/output.json index 739ae033f81c..d1d0c650f8ef 100644 --- a/crates/swc_css_parser/tests/recovery/value/quotes/output.json +++ b/crates/swc_css_parser/tests/recovery/value/quotes/output.json @@ -134,7 +134,7 @@ }, "token": { "BadString": { - "raw_value": "\"tes" + "raw": "\"tes" } } }, @@ -174,7 +174,7 @@ }, "token": { "BadString": { - "raw_value": "\";" + "raw": "\";" } } } diff --git a/crates/swc_css_parser/tests/recovery/value/quotes/span.swc-stderr b/crates/swc_css_parser/tests/recovery/value/quotes/span.swc-stderr index 0ce0a3d5cc90..cf33f6bda8e0 100644 --- a/crates/swc_css_parser/tests/recovery/value/quotes/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/value/quotes/span.swc-stderr @@ -156,7 +156,7 @@ 3 | t"; `---- - x BadString { raw_value: "\"tes" } + x BadString { raw: "\"tes" } ,-[$DIR/tests/recovery/value/quotes/input.css:1:1] 1 | p::before { 2 | content: "tes @@ -204,7 +204,7 @@ 4 | } `---- - x BadString { raw_value: "\";" } + x BadString { raw: "\";" } ,-[$DIR/tests/recovery/value/quotes/input.css:2:1] 2 | content: "tes 3 | t"; diff --git a/crates/swc_css_parser/tests/recovery/value/string/newline/output.json b/crates/swc_css_parser/tests/recovery/value/string/newline/output.json index 1607251647d5..52d2e7ee37cc 100644 --- a/crates/swc_css_parser/tests/recovery/value/string/newline/output.json +++ b/crates/swc_css_parser/tests/recovery/value/string/newline/output.json @@ -114,7 +114,7 @@ }, "token": { "BadString": { - "raw_value": "\"" + "raw": "\"" } } } diff --git a/crates/swc_css_parser/tests/recovery/value/string/newline/span.swc-stderr b/crates/swc_css_parser/tests/recovery/value/string/newline/span.swc-stderr index dec255cfe8cd..892a68ceb02e 100644 --- a/crates/swc_css_parser/tests/recovery/value/string/newline/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/value/string/newline/span.swc-stderr @@ -121,7 +121,7 @@ : ^ `---- - x BadString { raw_value: "\"" } + x BadString { raw: "\"" } ,-[$DIR/tests/recovery/value/string/newline/input.css:1:1] 1 | a { 2 | prop: " diff --git a/crates/swc_css_parser/tests/recovery/value/url/basic/output.json b/crates/swc_css_parser/tests/recovery/value/url/basic/output.json index 5eb4ef658213..ec468c20ec20 100644 --- a/crates/swc_css_parser/tests/recovery/value/url/basic/output.json +++ b/crates/swc_css_parser/tests/recovery/value/url/basic/output.json @@ -149,8 +149,10 @@ }, "token": { "BadUrl": { - "raw_name": "url", - "raw_value": "var(--foo" + "raw": [ + "url", + "var(--foo" + ] } } }, @@ -551,8 +553,10 @@ }, "token": { "BadUrl": { - "raw_name": "url", - "raw_value": "image.png param(var(--url" + "raw": [ + "url", + "image.png param(var(--url" + ] } } }, diff --git a/crates/swc_css_parser/tests/recovery/value/url/basic/span.swc-stderr b/crates/swc_css_parser/tests/recovery/value/url/basic/span.swc-stderr index 8a456844f393..652dc6aab765 100644 --- a/crates/swc_css_parser/tests/recovery/value/url/basic/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/value/url/basic/span.swc-stderr @@ -223,7 +223,7 @@ 4 | background: url(image.png\999999); `---- - x BadUrl { raw_name: "url", raw_value: "var(--foo" } + x BadUrl { raw: ("url", "var(--foo") } ,-[$DIR/tests/recovery/value/url/basic/input.css:2:1] 2 | --foo: "http://www.example.com/pinkish.gif"; 3 | background: url(var(--foo)); @@ -831,7 +831,7 @@ 14 | } `---- - x BadUrl { raw_name: "url", raw_value: "image.png param(var(--url" } + x BadUrl { raw: ("url", "image.png param(var(--url") } ,-[$DIR/tests/recovery/value/url/basic/input.css:12:1] 12 | .foo { 13 | background: url(image.png param(var(--url))); diff --git a/crates/swc_css_parser/tests/recovery/value/url/parenthesis/output.json b/crates/swc_css_parser/tests/recovery/value/url/parenthesis/output.json index ed4353ffb5d6..811ca5724a67 100644 --- a/crates/swc_css_parser/tests/recovery/value/url/parenthesis/output.json +++ b/crates/swc_css_parser/tests/recovery/value/url/parenthesis/output.json @@ -114,8 +114,10 @@ }, "token": { "BadUrl": { - "raw_name": "url", - "raw_value": "test\\);\n}" + "raw": [ + "url", + "test\\);\n}" + ] } } } diff --git a/crates/swc_css_parser/tests/recovery/value/url/parenthesis/span.swc-stderr b/crates/swc_css_parser/tests/recovery/value/url/parenthesis/span.swc-stderr index 5cb1cd03bd5e..e871257cf39f 100644 --- a/crates/swc_css_parser/tests/recovery/value/url/parenthesis/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/value/url/parenthesis/span.swc-stderr @@ -127,7 +127,7 @@ 3 | `-> } `---- - x BadUrl { raw_name: "url", raw_value: "test\\);\n}" } + x BadUrl { raw: ("url", "test\\);\n}") } ,-[$DIR/tests/recovery/value/url/parenthesis/input.css:1:1] 1 | a { 2 | ,-> background: url(test\); From b59240fb6d77a3a1b2c1f66d109ad97cc8c7c66f Mon Sep 17 00:00:00 2001 From: "alexander.akait" Date: Fri, 2 Dec 2022 16:58:39 +0300 Subject: [PATCH 03/42] perf(css/parser): no extra creation --- crates/swc_css_parser/src/lexer/mod.rs | 27 +++++++------------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/crates/swc_css_parser/src/lexer/mod.rs b/crates/swc_css_parser/src/lexer/mod.rs index f42faf30eb0b..821111a4b471 100644 --- a/crates/swc_css_parser/src/lexer/mod.rs +++ b/crates/swc_css_parser/src/lexer/mod.rs @@ -555,33 +555,20 @@ where // If the next 3 input code points would start an identifier, then: if self.would_start_ident(next_first, next_second, next_third)? { + // Swap logic to avoid create empty strings, because it doesn't make sense + // + // Consume a name. Set the ’s unit to the returned value. + let ident_sequence = self.read_ident_sequence()?; // Create a with the same value and type flag as number, and a // unit set initially to the empty string. - let mut token = Token::Dimension { + let token = Token::Dimension { value: number.0, raw_value: number.1, - unit: js_word!(""), - raw_unit: "".into(), + unit: ident_sequence.0, + raw_unit: ident_sequence.1, type_flag: number.2, }; - // Consume a name. Set the ’s unit to the returned value. - let ident_sequence = self.read_ident_sequence()?; - - match token { - Token::Dimension { - ref mut unit, - ref mut raw_unit, - .. - } => { - *unit = ident_sequence.0; - *raw_unit = ident_sequence.1; - } - _ => { - unreachable!(); - } - } - // Return the . return Ok(token); } From 645edde39718636e00adff5f90cd71c1a2f81ba0 Mon Sep 17 00:00:00 2001 From: "alexander.akait" Date: Fri, 2 Dec 2022 17:13:45 +0300 Subject: [PATCH 04/42] perf(css/parser): reduce token sized to 32 bytes --- crates/swc_css_ast/src/token.rs | 10 +- crates/swc_css_codegen/src/lib.rs | 40 +++---- crates/swc_css_parser/src/lexer/mod.rs | 3 +- .../src/parser/selectors/mod.rs | 4 +- .../src/parser/values_and_units/mod.rs | 108 ++++++------------ .../tests/fixture/at-rule/media/output.json | 32 ++++-- .../fixture/at-rule/media/span.swc-stderr | 8 +- .../tests/fixture/function/calc/output.json | 8 +- .../fixture/function/calc/span.swc-stderr | 2 +- .../tests/fixture/style-block/output.json | 24 ++-- .../tests/fixture/style-block/span.swc-stderr | 6 +- .../fixture/value/custom-property/output.json | 24 ++-- .../value/custom-property/span.swc-stderr | 6 +- .../vendor/rome/custom-properties/output.json | 16 ++- .../rome/custom-properties/span.swc-stderr | 4 +- .../fixture/vendor/rome/functions/output.json | 8 +- .../vendor/rome/functions/span.swc-stderr | 2 +- .../media/condition-and-or/output.json | 16 ++- .../media/condition-and-or/span.swc-stderr | 4 +- .../at-rule/media/feature-name-1/output.json | 16 ++- .../media/feature-name-1/span.swc-stderr | 4 +- .../at-rule/media/feature-name/output.json | 8 +- .../media/feature-name/span.swc-stderr | 2 +- .../at-rule/media/feature-range-2/output.json | 16 ++- .../media/feature-range-2/span.swc-stderr | 4 +- .../at-rule/media/feature-range-3/output.json | 16 ++- .../media/feature-range-3/span.swc-stderr | 4 +- .../at-rule/media/feature-range-4/output.json | 16 ++- .../media/feature-range-4/span.swc-stderr | 4 +- .../at-rule/media/feature-range-5/output.json | 16 ++- .../media/feature-range-5/span.swc-stderr | 4 +- .../at-rule/media/feature-range-6/output.json | 16 ++- .../media/feature-range-6/span.swc-stderr | 4 +- .../at-rule/media/invalid-nesting/output.json | 8 +- .../media/invalid-nesting/span.swc-stderr | 2 +- .../at-rule/supports/wrong-or-and/output.json | 8 +- .../supports/wrong-or-and/span.swc-stderr | 2 +- .../declaration/wrong-name-3/output.json | 8 +- .../declaration/wrong-name-3/span.swc-stderr | 2 +- .../recovery/function/calc/space/output.json | 16 ++- .../function/calc/space/span.swc-stderr | 4 +- .../recovery/function/unclosed-2/output.json | 8 +- .../function/unclosed-2/span.swc-stderr | 2 +- .../recovery/function/unclosed/output.json | 8 +- .../function/unclosed/span.swc-stderr | 2 +- .../tests/recovery/number/output.json | 16 ++- .../tests/recovery/number/span.swc-stderr | 4 +- .../invalid-nested-1/output.json | 8 +- .../invalid-nested-1/span.swc-stderr | 2 +- .../tests/recovery/unicode-range/output.json | 16 ++- .../recovery/unicode-range/span.swc-stderr | 4 +- .../tests/recovery/vercel/004/output.json | 8 +- .../tests/recovery/vercel/004/span.swc-stderr | 2 +- .../tests/recovery/vercel/005/output.json | 8 +- .../tests/recovery/vercel/005/span.swc-stderr | 2 +- 55 files changed, 315 insertions(+), 280 deletions(-) diff --git a/crates/swc_css_ast/src/token.rs b/crates/swc_css_ast/src/token.rs index 0ddd3ab30fc6..86bd1a20b16d 100644 --- a/crates/swc_css_ast/src/token.rs +++ b/crates/swc_css_ast/src/token.rs @@ -119,12 +119,12 @@ pub enum Token { Dimension { value: f64, - raw_value: Atom, #[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))] unit: JsWord, - raw_unit: Atom, #[serde(rename = "type")] type_flag: NumberType, + /// Value and unit + raw: Box<(Atom, Atom)>, }, /// One or more whitespace. @@ -226,16 +226,14 @@ impl Hash for Token { } Token::Dimension { value, - raw_value, unit, - raw_unit, type_flag, + raw, } => { integer_decode(*value).hash(state); - raw_value.hash(state); unit.hash(state); - raw_unit.hash(state); type_flag.hash(state); + raw.hash(state); } Token::WhiteSpace { value } => { value.hash(state); diff --git a/crates/swc_css_codegen/src/lib.rs b/crates/swc_css_codegen/src/lib.rs index d4782526aea3..e6c11cb3cfb0 100644 --- a/crates/swc_css_codegen/src/lib.rs +++ b/crates/swc_css_codegen/src/lib.rs @@ -1955,15 +1955,11 @@ where write_raw!(self, span, &percentage); } - Token::Dimension { - raw_value, - raw_unit, - .. - } => { - let mut dimension = String::with_capacity(raw_value.len() + raw_unit.len()); + Token::Dimension { raw, .. } => { + let mut dimension = String::with_capacity(raw.0.len() + raw.1.len()); - dimension.push_str(raw_value); - dimension.push_str(raw_unit); + dimension.push_str(&raw.0); + dimension.push_str(&raw.1); write_raw!(self, span, &dimension); } @@ -1978,36 +1974,28 @@ where write_raw!(self, span, &function); } - Token::BadString { raw_value } => { - write_str!(self, span, raw_value); + Token::BadString { raw } => { + write_str!(self, span, raw); } Token::String { raw, .. } => { write_str!(self, span, raw); } - Token::Url { - raw_name, - raw_value, - .. - } => { - let mut url = String::with_capacity(raw_name.len() + raw_value.len() + 2); + Token::Url { raw, .. } => { + let mut url = String::with_capacity(raw.0.len() + raw.1.len() + 2); - url.push_str(raw_name); + url.push_str(&raw.0); url.push('('); - url.push_str(raw_value); + url.push_str(&raw.1); url.push(')'); write_str!(self, span, &url); } - Token::BadUrl { - raw_name, - raw_value, - .. - } => { - let mut bad_url = String::with_capacity(raw_value.len() + 2); + Token::BadUrl { raw, .. } => { + let mut bad_url = String::with_capacity(raw.0.len() + raw.1.len() + 2); - bad_url.push_str(raw_name); + bad_url.push_str(&raw.0); bad_url.push('('); - bad_url.push_str(raw_value); + bad_url.push_str(&raw.1); bad_url.push(')'); write_str!(self, span, &bad_url); diff --git a/crates/swc_css_parser/src/lexer/mod.rs b/crates/swc_css_parser/src/lexer/mod.rs index 821111a4b471..f029f8aa902d 100644 --- a/crates/swc_css_parser/src/lexer/mod.rs +++ b/crates/swc_css_parser/src/lexer/mod.rs @@ -563,10 +563,9 @@ where // unit set initially to the empty string. let token = Token::Dimension { value: number.0, - raw_value: number.1, unit: ident_sequence.0, - raw_unit: ident_sequence.1, type_flag: number.2, + raw: Box::new((number.1, ident_sequence.1)), }; // Return the . diff --git a/crates/swc_css_parser/src/parser/selectors/mod.rs b/crates/swc_css_parser/src/parser/selectors/mod.rs index 2ec9a1ea0e98..a93ffef6e936 100644 --- a/crates/swc_css_parser/src/parser/selectors/mod.rs +++ b/crates/swc_css_parser/src/parser/selectors/mod.rs @@ -1266,7 +1266,7 @@ where } tok!("dimension") => { let dimension = match bump!(self) { - Token::Dimension { value, raw_value, unit, .. } => (value, raw_value, unit), + Token::Dimension { value, raw, unit, .. } => (value, raw, unit), _ => { unreachable!(); } @@ -1282,7 +1282,7 @@ where } a = Some(dimension.0 as i32); - a_raw = Some(dimension.1); + a_raw = Some(dimension.1.0); n_value = (*dimension.2).to_string(); } diff --git a/crates/swc_css_parser/src/parser/values_and_units/mod.rs b/crates/swc_css_parser/src/parser/values_and_units/mod.rs index cc52b86b18ae..665a1aabcbe7 100644 --- a/crates/swc_css_parser/src/parser/values_and_units/mod.rs +++ b/crates/swc_css_parser/src/parser/values_and_units/mod.rs @@ -1981,27 +1981,23 @@ where match bump!(self) { Token::Dimension { - value, - raw_value, - unit, - raw_unit, - .. + value, unit, raw, .. } => { // TODO validate - let unit_len = raw_unit.len() as u32; + let unit_len = raw.1.len() as u32; Ok(Length { span, value: Number { span: Span::new(span.lo, span.hi - BytePos(unit_len), Default::default()), value, - raw: Some(raw_value), + raw: Some(raw.0), }, unit: Ident { span: Span::new(span.hi - BytePos(unit_len), span.hi, Default::default()), value: unit, - raw: Some(raw_unit), + raw: Some(raw.1), }, }) } @@ -2025,11 +2021,7 @@ where match bump!(self) { Token::Dimension { - value, - raw_value, - unit, - raw_unit, - .. + value, unit, raw, .. } => { if !is_angle_unit(&unit) { return Err(Error::new( @@ -2038,19 +2030,19 @@ where )); } - let unit_len = raw_unit.len() as u32; + let unit_len = raw.1.len() as u32; Ok(Angle { span, value: Number { span: Span::new(span.lo, span.hi - BytePos(unit_len), Default::default()), value, - raw: Some(raw_value), + raw: Some(raw.0), }, unit: Ident { span: Span::new(span.hi - BytePos(unit_len), span.hi, Default::default()), value: unit, - raw: Some(raw_unit), + raw: Some(raw.1), }, }) } @@ -2074,29 +2066,25 @@ where match bump!(self) { Token::Dimension { - value, - raw_value, - unit, - raw_unit, - .. + value, unit, raw, .. } => { if !is_time_unit(&unit) { return Err(Error::new(span, ErrorKind::Expected("'s' or 'ms' units"))); } - let unit_len = raw_unit.len() as u32; + let unit_len = raw.1.len() as u32; Ok(Time { span, value: Number { span: Span::new(span.lo, span.hi - BytePos(unit_len), Default::default()), value, - raw: Some(raw_value), + raw: Some(raw.0), }, unit: Ident { span: Span::new(span.hi - BytePos(unit_len), span.hi, Default::default()), value: unit, - raw: Some(raw_unit), + raw: Some(raw.1), }, }) } @@ -2120,29 +2108,25 @@ where match bump!(self) { Token::Dimension { - value, - raw_value, - unit, - raw_unit, - .. + value, unit, raw, .. } => { if !is_frequency_unit(&unit) { return Err(Error::new(span, ErrorKind::Expected("'Hz' or 'kHz' units"))); } - let unit_len = raw_unit.len() as u32; + let unit_len = raw.1.len() as u32; Ok(Frequency { span, value: Number { span: Span::new(span.lo, span.hi - BytePos(unit_len), Default::default()), value, - raw: Some(raw_value), + raw: Some(raw.0), }, unit: Ident { span: Span::new(span.hi - BytePos(unit_len), span.hi, Default::default()), value: unit, - raw: Some(raw_unit), + raw: Some(raw.1), }, }) } @@ -2166,11 +2150,7 @@ where match bump!(self) { Token::Dimension { - value, - raw_value, - unit, - raw_unit, - .. + value, unit, raw, .. } => { if !is_resolution_unit(&unit) { return Err(Error::new( @@ -2179,19 +2159,19 @@ where )); } - let unit_len = raw_unit.len() as u32; + let unit_len = raw.1.len() as u32; Ok(Resolution { span, value: Number { span: Span::new(span.lo, span.hi - BytePos(unit_len), Default::default()), value, - raw: Some(raw_value), + raw: Some(raw.0), }, unit: Ident { span: Span::new(span.hi - BytePos(unit_len), span.hi, Default::default()), value: unit, - raw: Some(raw_unit), + raw: Some(raw.1), }, }) } @@ -2215,29 +2195,25 @@ where match bump!(self) { Token::Dimension { - value, - raw_value, - unit, - raw_unit, - .. + value, unit, raw, .. } => { if !is_flex_unit(&unit) { return Err(Error::new(span, ErrorKind::Expected("'fr' unit"))); } - let unit_len = raw_unit.len() as u32; + let unit_len = raw.1.len() as u32; Ok(Flex { span, value: Number { span: Span::new(span.lo, span.hi - BytePos(unit_len), Default::default()), value, - raw: Some(raw_value), + raw: Some(raw.0), }, unit: Ident { span: Span::new(span.hi - BytePos(unit_len), span.hi, Default::default()), value: unit, - raw: Some(raw_unit), + raw: Some(raw.1), }, }) } @@ -2261,25 +2237,21 @@ where match bump!(self) { Token::Dimension { - value, - raw_value, - unit, - raw_unit, - .. + value, unit, raw, .. } => { - let unit_len = raw_unit.len() as u32; + let unit_len = raw.1.len() as u32; Ok(UnknownDimension { span, value: Number { span: Span::new(span.lo, span.hi - BytePos(unit_len), Default::default()), value, - raw: Some(raw_value), + raw: Some(raw.0), }, unit: Ident { span: Span::new(span.hi - BytePos(unit_len), span.hi, Default::default()), value: unit, - raw: Some(raw_unit), + raw: Some(raw.1), }, }) } @@ -2763,19 +2735,15 @@ where } } tok!("dimension") => { - let dimension = match bump!(self) { - Token::Dimension { - raw_value, - raw_unit, - .. - } => (raw_value, raw_unit), + let raw = match bump!(self) { + Token::Dimension { raw, .. } => raw, _ => { unreachable!(); } }; - unicode_range.push_str(&dimension.0); - unicode_range.push_str(&dimension.1); + unicode_range.push_str(&raw.0); + unicode_range.push_str(&raw.1); } tok!("number") => { let number = match bump!(self) { @@ -2793,19 +2761,15 @@ where } // u '?'* tok!("dimension") => { - let dimension = match bump!(self) { - Token::Dimension { - raw_value, - raw_unit, - .. - } => (raw_value, raw_unit), + let raw = match bump!(self) { + Token::Dimension { raw, .. } => raw, _ => { unreachable!(); } }; - unicode_range.push_str(&dimension.0); - unicode_range.push_str(&dimension.1); + unicode_range.push_str(&raw.0); + unicode_range.push_str(&raw.1); loop { if !is!(self, "?") { diff --git a/crates/swc_css_parser/tests/fixture/at-rule/media/output.json b/crates/swc_css_parser/tests/fixture/at-rule/media/output.json index b8e8bbc881a4..fdc8d1649fa1 100644 --- a/crates/swc_css_parser/tests/fixture/at-rule/media/output.json +++ b/crates/swc_css_parser/tests/fixture/at-rule/media/output.json @@ -15242,10 +15242,12 @@ "token": { "Dimension": { "value": 600.0, - "raw_value": "600", "unit": "px", - "raw_unit": "px", - "type": "integer" + "type": "integer", + "raw": [ + "600", + "px" + ] } } } @@ -15699,10 +15701,12 @@ "token": { "Dimension": { "value": 600.0, - "raw_value": "600", "unit": "px", - "raw_unit": "px", - "type": "integer" + "type": "integer", + "raw": [ + "600", + "px" + ] } } } @@ -16093,10 +16097,12 @@ "token": { "Dimension": { "value": 100.0, - "raw_value": "100", "unit": "px", - "raw_unit": "px", - "type": "integer" + "type": "integer", + "raw": [ + "100", + "px" + ] } } } @@ -16215,10 +16221,12 @@ "token": { "Dimension": { "value": 100.0, - "raw_value": "100", "unit": "px", - "raw_unit": "px", - "type": "integer" + "type": "integer", + "raw": [ + "100", + "px" + ] } } } diff --git a/crates/swc_css_parser/tests/fixture/at-rule/media/span.swc-stderr b/crates/swc_css_parser/tests/fixture/at-rule/media/span.swc-stderr index c56a06090fd2..73d967be2cd4 100644 --- a/crates/swc_css_parser/tests/fixture/at-rule/media/span.swc-stderr +++ b/crates/swc_css_parser/tests/fixture/at-rule/media/span.swc-stderr @@ -21443,7 +21443,7 @@ 143 | @media (height foo bar) {} `---- - x Dimension { value: 600.0, raw_value: "600", unit: Atom('px' type=static), raw_unit: "px", type_flag: Integer } + x Dimension { value: 600.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("600", "px") } ,-[$DIR/tests/fixture/at-rule/media/input.css:141:1] 141 | 142 | @media (height << 600px) {} @@ -21987,7 +21987,7 @@ 146 | @media screen and (min-width: ) {} `---- - x Dimension { value: 600.0, raw_value: "600", unit: Atom('px' type=static), raw_unit: "px", type_flag: Integer } + x Dimension { value: 600.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("600", "px") } ,-[$DIR/tests/fixture/at-rule/media/input.css:144:1] 144 | @media (height foo("bar")) {} 145 | @media (height + 600px) {} @@ -22467,7 +22467,7 @@ 149 | @media screen and func(100px) {} `---- - x Dimension { value: 100.0, raw_value: "100", unit: Atom('px' type=static), raw_unit: "px", type_flag: Integer } + x Dimension { value: 100.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("100", "px") } ,-[$DIR/tests/fixture/at-rule/media/input.css:147:1] 147 | @media (aspect-ratio: 12/) {} 148 | @media func(100px) {} @@ -22611,7 +22611,7 @@ 150 | @media(min-width:calc(10px + 10px)) {} `---- - x Dimension { value: 100.0, raw_value: "100", unit: Atom('px' type=static), raw_unit: "px", type_flag: Integer } + x Dimension { value: 100.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("100", "px") } ,-[$DIR/tests/fixture/at-rule/media/input.css:148:1] 148 | @media func(100px) {} 149 | @media screen and func(100px) {} diff --git a/crates/swc_css_parser/tests/fixture/function/calc/output.json b/crates/swc_css_parser/tests/fixture/function/calc/output.json index 620195d6a2d8..064003be736c 100644 --- a/crates/swc_css_parser/tests/fixture/function/calc/output.json +++ b/crates/swc_css_parser/tests/fixture/function/calc/output.json @@ -372,10 +372,12 @@ "token": { "Dimension": { "value": 30.0, - "raw_value": "30", "unit": "px", - "raw_unit": "px", - "type": "integer" + "type": "integer", + "raw": [ + "30", + "px" + ] } } } diff --git a/crates/swc_css_parser/tests/fixture/function/calc/span.swc-stderr b/crates/swc_css_parser/tests/fixture/function/calc/span.swc-stderr index 5fb133277016..eb1358f42fdb 100644 --- a/crates/swc_css_parser/tests/fixture/function/calc/span.swc-stderr +++ b/crates/swc_css_parser/tests/fixture/function/calc/span.swc-stderr @@ -685,7 +685,7 @@ : ^^^^ `---- - x Dimension { value: 30.0, raw_value: "30", unit: Atom('px' type=static), raw_unit: "px", type_flag: Integer } + x Dimension { value: 30.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("30", "px") } ,-[$DIR/tests/fixture/function/calc/input.css:5:1] 5 | div { 6 | --width: calc(10% + 30px); diff --git a/crates/swc_css_parser/tests/fixture/style-block/output.json b/crates/swc_css_parser/tests/fixture/style-block/output.json index f09f84066081..5ea670864037 100644 --- a/crates/swc_css_parser/tests/fixture/style-block/output.json +++ b/crates/swc_css_parser/tests/fixture/style-block/output.json @@ -3459,10 +3459,12 @@ "token": { "Dimension": { "value": 100.0, - "raw_value": "100", "unit": "px", - "raw_unit": "px", - "type": "integer" + "type": "integer", + "raw": [ + "100", + "px" + ] } } }, @@ -4380,10 +4382,12 @@ "token": { "Dimension": { "value": 16.0, - "raw_value": "16", "unit": "px", - "raw_unit": "px", - "type": "integer" + "type": "integer", + "raw": [ + "16", + "px" + ] } } }, @@ -4455,10 +4459,12 @@ "token": { "Dimension": { "value": 16.0, - "raw_value": "16", "unit": "px", - "raw_unit": "px", - "type": "integer" + "type": "integer", + "raw": [ + "16", + "px" + ] } } }, diff --git a/crates/swc_css_parser/tests/fixture/style-block/span.swc-stderr b/crates/swc_css_parser/tests/fixture/style-block/span.swc-stderr index 49453217bc5c..95342ca87d37 100644 --- a/crates/swc_css_parser/tests/fixture/style-block/span.swc-stderr +++ b/crates/swc_css_parser/tests/fixture/style-block/span.swc-stderr @@ -4843,7 +4843,7 @@ 93 | } `---- - x Dimension { value: 100.0, raw_value: "100", unit: Atom('px' type=static), raw_unit: "px", type_flag: Integer } + x Dimension { value: 100.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("100", "px") } ,-[$DIR/tests/fixture/style-block/input.css:91:1] 91 | @mixin mobile { 92 | height: 100px; @@ -5950,7 +5950,7 @@ 112 | height: 16px; `---- - x Dimension { value: 16.0, raw_value: "16", unit: Atom('px' type=static), raw_unit: "px", type_flag: Integer } + x Dimension { value: 16.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("16", "px") } ,-[$DIR/tests/fixture/style-block/input.css:110:1] 110 | --small-icon: { 111 | width: 16px; @@ -6046,7 +6046,7 @@ 113 | } `---- - x Dimension { value: 16.0, raw_value: "16", unit: Atom('px' type=static), raw_unit: "px", type_flag: Integer } + x Dimension { value: 16.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("16", "px") } ,-[$DIR/tests/fixture/style-block/input.css:111:1] 111 | width: 16px; 112 | height: 16px; diff --git a/crates/swc_css_parser/tests/fixture/value/custom-property/output.json b/crates/swc_css_parser/tests/fixture/value/custom-property/output.json index b95052817214..74d11fdb9e94 100644 --- a/crates/swc_css_parser/tests/fixture/value/custom-property/output.json +++ b/crates/swc_css_parser/tests/fixture/value/custom-property/output.json @@ -630,10 +630,12 @@ "token": { "Dimension": { "value": 100.0, - "raw_value": "100", "unit": "vw", - "raw_unit": "vw", - "type": "integer" + "type": "integer", + "raw": [ + "100", + "vw" + ] } } } @@ -2809,10 +2811,12 @@ "token": { "Dimension": { "value": 16.0, - "raw_value": "16", "unit": "px", - "raw_unit": "px", - "type": "integer" + "type": "integer", + "raw": [ + "16", + "px" + ] } } }, @@ -2884,10 +2888,12 @@ "token": { "Dimension": { "value": 16.0, - "raw_value": "16", "unit": "px", - "raw_unit": "px", - "type": "integer" + "type": "integer", + "raw": [ + "16", + "px" + ] } } }, diff --git a/crates/swc_css_parser/tests/fixture/value/custom-property/span.swc-stderr b/crates/swc_css_parser/tests/fixture/value/custom-property/span.swc-stderr index 344e38f4b57d..f3d8cb953c8a 100644 --- a/crates/swc_css_parser/tests/fixture/value/custom-property/span.swc-stderr +++ b/crates/swc_css_parser/tests/fixture/value/custom-property/span.swc-stderr @@ -1110,7 +1110,7 @@ 19 | --color: #06c; `---- - x Dimension { value: 100.0, raw_value: "100", unit: Atom('vw' type=static), raw_unit: "vw", type_flag: Integer } + x Dimension { value: 100.0, unit: Atom('vw' type=static), type_flag: Integer, raw: ("100", "vw") } ,-[$DIR/tests/fixture/value/custom-property/input.css:17:1] 17 | --number: 1; 18 | --unit: 100vw; @@ -4154,7 +4154,7 @@ 54 | height: 16px; `---- - x Dimension { value: 16.0, raw_value: "16", unit: Atom('px' type=static), raw_unit: "px", type_flag: Integer } + x Dimension { value: 16.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("16", "px") } ,-[$DIR/tests/fixture/value/custom-property/input.css:52:1] 52 | --small-icon: { 53 | width: 16px; @@ -4250,7 +4250,7 @@ 55 | } `---- - x Dimension { value: 16.0, raw_value: "16", unit: Atom('px' type=static), raw_unit: "px", type_flag: Integer } + x Dimension { value: 16.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("16", "px") } ,-[$DIR/tests/fixture/value/custom-property/input.css:53:1] 53 | width: 16px; 54 | height: 16px; diff --git a/crates/swc_css_parser/tests/fixture/vendor/rome/custom-properties/output.json b/crates/swc_css_parser/tests/fixture/vendor/rome/custom-properties/output.json index 1f7fc4cae200..bb139bc7f426 100644 --- a/crates/swc_css_parser/tests/fixture/vendor/rome/custom-properties/output.json +++ b/crates/swc_css_parser/tests/fixture/vendor/rome/custom-properties/output.json @@ -320,10 +320,12 @@ "token": { "Dimension": { "value": 12.0, - "raw_value": "12", "unit": "em", - "raw_unit": "em", - "type": "integer" + "type": "integer", + "raw": [ + "12", + "em" + ] } } } @@ -358,10 +360,12 @@ "token": { "Dimension": { "value": 75.0, - "raw_value": "75", "unit": "ms", - "raw_unit": "ms", - "type": "integer" + "type": "integer", + "raw": [ + "75", + "ms" + ] } } } diff --git a/crates/swc_css_parser/tests/fixture/vendor/rome/custom-properties/span.swc-stderr b/crates/swc_css_parser/tests/fixture/vendor/rome/custom-properties/span.swc-stderr index 82fd3d17afb5..a11662143780 100644 --- a/crates/swc_css_parser/tests/fixture/vendor/rome/custom-properties/span.swc-stderr +++ b/crates/swc_css_parser/tests/fixture/vendor/rome/custom-properties/span.swc-stderr @@ -540,7 +540,7 @@ 9 | --time: 75ms; `---- - x Dimension { value: 12.0, raw_value: "12", unit: Atom('em' type=static), raw_unit: "em", type_flag: Integer } + x Dimension { value: 12.0, unit: Atom('em' type=static), type_flag: Integer, raw: ("12", "em") } ,-[$DIR/tests/fixture/vendor/rome/custom-properties/input.css:7:1] 7 | --number: 37; 8 | --length: 12em; @@ -596,7 +596,7 @@ 10 | --function: foo(); `---- - x Dimension { value: 75.0, raw_value: "75", unit: Atom('ms' type=static), raw_unit: "ms", type_flag: Integer } + x Dimension { value: 75.0, unit: Atom('ms' type=static), type_flag: Integer, raw: ("75", "ms") } ,-[$DIR/tests/fixture/vendor/rome/custom-properties/input.css:8:1] 8 | --length: 12em; 9 | --time: 75ms; diff --git a/crates/swc_css_parser/tests/fixture/vendor/rome/functions/output.json b/crates/swc_css_parser/tests/fixture/vendor/rome/functions/output.json index 84b131fd9f96..48c85b23b014 100644 --- a/crates/swc_css_parser/tests/fixture/vendor/rome/functions/output.json +++ b/crates/swc_css_parser/tests/fixture/vendor/rome/functions/output.json @@ -108,10 +108,12 @@ "token": { "Dimension": { "value": 2.0, - "raw_value": "2", "unit": "px", - "raw_unit": "px", - "type": "integer" + "type": "integer", + "raw": [ + "2", + "px" + ] } } } diff --git a/crates/swc_css_parser/tests/fixture/vendor/rome/functions/span.swc-stderr b/crates/swc_css_parser/tests/fixture/vendor/rome/functions/span.swc-stderr index 0abbc539504a..4d329d9eb59a 100644 --- a/crates/swc_css_parser/tests/fixture/vendor/rome/functions/span.swc-stderr +++ b/crates/swc_css_parser/tests/fixture/vendor/rome/functions/span.swc-stderr @@ -144,7 +144,7 @@ 3 | border: var(--fancy); `---- - x Dimension { value: 2.0, raw_value: "2", unit: Atom('px' type=static), raw_unit: "px", type_flag: Integer } + x Dimension { value: 2.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("2", "px") } ,-[$DIR/tests/fixture/vendor/rome/functions/input.css:1:1] 1 | .style { 2 | --fancy: 2px; diff --git a/crates/swc_css_parser/tests/recovery/at-rule/media/condition-and-or/output.json b/crates/swc_css_parser/tests/recovery/at-rule/media/condition-and-or/output.json index d9e2a7bbcee8..26a69d0a7194 100644 --- a/crates/swc_css_parser/tests/recovery/at-rule/media/condition-and-or/output.json +++ b/crates/swc_css_parser/tests/recovery/at-rule/media/condition-and-or/output.json @@ -161,10 +161,12 @@ "token": { "Dimension": { "value": 900.0, - "raw_value": "900", "unit": "px", - "raw_unit": "px", - "type": "integer" + "type": "integer", + "raw": [ + "900", + "px" + ] } } } @@ -273,10 +275,12 @@ "token": { "Dimension": { "value": 1200.0, - "raw_value": "1200", "unit": "px", - "raw_unit": "px", - "type": "integer" + "type": "integer", + "raw": [ + "1200", + "px" + ] } } } diff --git a/crates/swc_css_parser/tests/recovery/at-rule/media/condition-and-or/span.swc-stderr b/crates/swc_css_parser/tests/recovery/at-rule/media/condition-and-or/span.swc-stderr index 51a080481c35..0de040915149 100644 --- a/crates/swc_css_parser/tests/recovery/at-rule/media/condition-and-or/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/at-rule/media/condition-and-or/span.swc-stderr @@ -149,7 +149,7 @@ : ^^^^^ `---- - x Dimension { value: 900.0, raw_value: "900", unit: Atom('px' type=static), raw_unit: "px", type_flag: Integer } + x Dimension { value: 900.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("900", "px") } ,-[$DIR/tests/recovery/at-rule/media/condition-and-or/input.css:1:1] 1 | @media screen and (min-width: 900px) or (min-width: 1200px) {} : ^^^^^ @@ -251,7 +251,7 @@ : ^^^^^^ `---- - x Dimension { value: 1200.0, raw_value: "1200", unit: Atom('px' type=static), raw_unit: "px", type_flag: Integer } + x Dimension { value: 1200.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("1200", "px") } ,-[$DIR/tests/recovery/at-rule/media/condition-and-or/input.css:1:1] 1 | @media screen and (min-width: 900px) or (min-width: 1200px) {} : ^^^^^^ diff --git a/crates/swc_css_parser/tests/recovery/at-rule/media/feature-name-1/output.json b/crates/swc_css_parser/tests/recovery/at-rule/media/feature-name-1/output.json index 7ecfa37e4b24..c7a4a96badfd 100644 --- a/crates/swc_css_parser/tests/recovery/at-rule/media/feature-name-1/output.json +++ b/crates/swc_css_parser/tests/recovery/at-rule/media/feature-name-1/output.json @@ -71,10 +71,12 @@ "token": { "Dimension": { "value": 20.0, - "raw_value": "20", "unit": "px", - "raw_unit": "px", - "type": "integer" + "type": "integer", + "raw": [ + "20", + "px" + ] } } }, @@ -110,10 +112,12 @@ "token": { "Dimension": { "value": 20.0, - "raw_value": "20", "unit": "px", - "raw_unit": "px", - "type": "integer" + "type": "integer", + "raw": [ + "20", + "px" + ] } } } diff --git a/crates/swc_css_parser/tests/recovery/at-rule/media/feature-name-1/span.swc-stderr b/crates/swc_css_parser/tests/recovery/at-rule/media/feature-name-1/span.swc-stderr index 5f79ee167c1e..4ddd3f54ab25 100644 --- a/crates/swc_css_parser/tests/recovery/at-rule/media/feature-name-1/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/at-rule/media/feature-name-1/span.swc-stderr @@ -65,7 +65,7 @@ : ^^^^ `---- - x Dimension { value: 20.0, raw_value: "20", unit: Atom('px' type=static), raw_unit: "px", type_flag: Integer } + x Dimension { value: 20.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("20", "px") } ,-[$DIR/tests/recovery/at-rule/media/feature-name-1/input.css:1:1] 1 | @media (20px: 20px) {} : ^^^^ @@ -101,7 +101,7 @@ : ^^^^ `---- - x Dimension { value: 20.0, raw_value: "20", unit: Atom('px' type=static), raw_unit: "px", type_flag: Integer } + x Dimension { value: 20.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("20", "px") } ,-[$DIR/tests/recovery/at-rule/media/feature-name-1/input.css:1:1] 1 | @media (20px: 20px) {} : ^^^^ diff --git a/crates/swc_css_parser/tests/recovery/at-rule/media/feature-name/output.json b/crates/swc_css_parser/tests/recovery/at-rule/media/feature-name/output.json index f53122a49a9f..d40ea2c7704e 100644 --- a/crates/swc_css_parser/tests/recovery/at-rule/media/feature-name/output.json +++ b/crates/swc_css_parser/tests/recovery/at-rule/media/feature-name/output.json @@ -107,10 +107,12 @@ "token": { "Dimension": { "value": 20.0, - "raw_value": "20", "unit": "px", - "raw_unit": "px", - "type": "integer" + "type": "integer", + "raw": [ + "20", + "px" + ] } } } diff --git a/crates/swc_css_parser/tests/recovery/at-rule/media/feature-name/span.swc-stderr b/crates/swc_css_parser/tests/recovery/at-rule/media/feature-name/span.swc-stderr index bc4558018adf..c0aa5e8a9a8f 100644 --- a/crates/swc_css_parser/tests/recovery/at-rule/media/feature-name/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/at-rule/media/feature-name/span.swc-stderr @@ -101,7 +101,7 @@ : ^^^^ `---- - x Dimension { value: 20.0, raw_value: "20", unit: Atom('px' type=static), raw_unit: "px", type_flag: Integer } + x Dimension { value: 20.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("20", "px") } ,-[$DIR/tests/recovery/at-rule/media/feature-name/input.css:1:1] 1 | @media ("min-width": 20px) {} : ^^^^ diff --git a/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-2/output.json b/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-2/output.json index 57392c3f68a7..eb82625f8c18 100644 --- a/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-2/output.json +++ b/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-2/output.json @@ -71,10 +71,12 @@ "token": { "Dimension": { "value": 400.0, - "raw_value": "400", "unit": "px", - "raw_unit": "px", - "type": "integer" + "type": "integer", + "raw": [ + "400", + "px" + ] } } }, @@ -180,10 +182,12 @@ "token": { "Dimension": { "value": 700.0, - "raw_value": "700", "unit": "px", - "raw_unit": "px", - "type": "integer" + "type": "integer", + "raw": [ + "700", + "px" + ] } } } diff --git a/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-2/span.swc-stderr b/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-2/span.swc-stderr index 5880eb3048f5..30e03961f591 100644 --- a/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-2/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-2/span.swc-stderr @@ -65,7 +65,7 @@ : ^^^^^ `---- - x Dimension { value: 400.0, raw_value: "400", unit: Atom('px' type=static), raw_unit: "px", type_flag: Integer } + x Dimension { value: 400.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("400", "px") } ,-[$DIR/tests/recovery/at-rule/media/feature-range-2/input.css:1:1] 1 | @media (400px > "width" > 700px) {} : ^^^^^ @@ -161,7 +161,7 @@ : ^^^^^ `---- - x Dimension { value: 700.0, raw_value: "700", unit: Atom('px' type=static), raw_unit: "px", type_flag: Integer } + x Dimension { value: 700.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("700", "px") } ,-[$DIR/tests/recovery/at-rule/media/feature-range-2/input.css:1:1] 1 | @media (400px > "width" > 700px) {} : ^^^^^ diff --git a/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-3/output.json b/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-3/output.json index d8b94af14edc..1c1ff3e4379d 100644 --- a/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-3/output.json +++ b/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-3/output.json @@ -71,10 +71,12 @@ "token": { "Dimension": { "value": 400.0, - "raw_value": "400", "unit": "px", - "raw_unit": "px", - "type": "integer" + "type": "integer", + "raw": [ + "400", + "px" + ] } } }, @@ -232,10 +234,12 @@ "token": { "Dimension": { "value": 700.0, - "raw_value": "700", "unit": "px", - "raw_unit": "px", - "type": "integer" + "type": "integer", + "raw": [ + "700", + "px" + ] } } } diff --git a/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-3/span.swc-stderr b/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-3/span.swc-stderr index b7ed8d453866..be41988221d0 100644 --- a/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-3/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-3/span.swc-stderr @@ -65,7 +65,7 @@ : ^^^^^ `---- - x Dimension { value: 400.0, raw_value: "400", unit: Atom('px' type=static), raw_unit: "px", type_flag: Integer } + x Dimension { value: 400.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("400", "px") } ,-[$DIR/tests/recovery/at-rule/media/feature-range-3/input.css:1:1] 1 | @media (400px > = width > = 700px) {} : ^^^^^ @@ -209,7 +209,7 @@ : ^^^^^ `---- - x Dimension { value: 700.0, raw_value: "700", unit: Atom('px' type=static), raw_unit: "px", type_flag: Integer } + x Dimension { value: 700.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("700", "px") } ,-[$DIR/tests/recovery/at-rule/media/feature-range-3/input.css:1:1] 1 | @media (400px > = width > = 700px) {} : ^^^^^ diff --git a/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-4/output.json b/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-4/output.json index ca3cb63c644f..a80e590d80cb 100644 --- a/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-4/output.json +++ b/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-4/output.json @@ -71,10 +71,12 @@ "token": { "Dimension": { "value": 400.0, - "raw_value": "400", "unit": "px", - "raw_unit": "px", - "type": "integer" + "type": "integer", + "raw": [ + "400", + "px" + ] } } }, @@ -193,10 +195,12 @@ "token": { "Dimension": { "value": 700.0, - "raw_value": "700", "unit": "px", - "raw_unit": "px", - "type": "integer" + "type": "integer", + "raw": [ + "700", + "px" + ] } } } diff --git a/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-4/span.swc-stderr b/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-4/span.swc-stderr index 076be557cd5c..305516458cfa 100644 --- a/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-4/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-4/span.swc-stderr @@ -65,7 +65,7 @@ : ^^^^^ `---- - x Dimension { value: 400.0, raw_value: "400", unit: Atom('px' type=static), raw_unit: "px", type_flag: Integer } + x Dimension { value: 400.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("400", "px") } ,-[$DIR/tests/recovery/at-rule/media/feature-range-4/input.css:1:1] 1 | @media (400px >= width ! 700px) {} : ^^^^^ @@ -173,7 +173,7 @@ : ^^^^^ `---- - x Dimension { value: 700.0, raw_value: "700", unit: Atom('px' type=static), raw_unit: "px", type_flag: Integer } + x Dimension { value: 700.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("700", "px") } ,-[$DIR/tests/recovery/at-rule/media/feature-range-4/input.css:1:1] 1 | @media (400px >= width ! 700px) {} : ^^^^^ diff --git a/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-5/output.json b/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-5/output.json index e836aed452ae..68c5ba1ba485 100644 --- a/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-5/output.json +++ b/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-5/output.json @@ -71,10 +71,12 @@ "token": { "Dimension": { "value": 400.0, - "raw_value": "400", "unit": "px", - "raw_unit": "px", - "type": "integer" + "type": "integer", + "raw": [ + "400", + "px" + ] } } }, @@ -206,10 +208,12 @@ "token": { "Dimension": { "value": 700.0, - "raw_value": "700", "unit": "px", - "raw_unit": "px", - "type": "integer" + "type": "integer", + "raw": [ + "700", + "px" + ] } } } diff --git a/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-5/span.swc-stderr b/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-5/span.swc-stderr index b956cd317d8e..134538c14b19 100644 --- a/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-5/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-5/span.swc-stderr @@ -65,7 +65,7 @@ : ^^^^^ `---- - x Dimension { value: 400.0, raw_value: "400", unit: Atom('px' type=static), raw_unit: "px", type_flag: Integer } + x Dimension { value: 400.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("400", "px") } ,-[$DIR/tests/recovery/at-rule/media/feature-range-5/input.css:1:1] 1 | @media (400px <= width >= 700px) {} : ^^^^^ @@ -185,7 +185,7 @@ : ^^^^^ `---- - x Dimension { value: 700.0, raw_value: "700", unit: Atom('px' type=static), raw_unit: "px", type_flag: Integer } + x Dimension { value: 700.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("700", "px") } ,-[$DIR/tests/recovery/at-rule/media/feature-range-5/input.css:1:1] 1 | @media (400px <= width >= 700px) {} : ^^^^^ diff --git a/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-6/output.json b/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-6/output.json index b30bbb9507a2..e3b93d489d37 100644 --- a/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-6/output.json +++ b/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-6/output.json @@ -71,10 +71,12 @@ "token": { "Dimension": { "value": 400.0, - "raw_value": "400", "unit": "px", - "raw_unit": "px", - "type": "integer" + "type": "integer", + "raw": [ + "400", + "px" + ] } } }, @@ -206,10 +208,12 @@ "token": { "Dimension": { "value": 700.0, - "raw_value": "700", "unit": "px", - "raw_unit": "px", - "type": "integer" + "type": "integer", + "raw": [ + "700", + "px" + ] } } } diff --git a/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-6/span.swc-stderr b/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-6/span.swc-stderr index a89d8d7683a0..b611cfaec5ec 100644 --- a/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-6/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-6/span.swc-stderr @@ -65,7 +65,7 @@ : ^^^^^ `---- - x Dimension { value: 400.0, raw_value: "400", unit: Atom('px' type=static), raw_unit: "px", type_flag: Integer } + x Dimension { value: 400.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("400", "px") } ,-[$DIR/tests/recovery/at-rule/media/feature-range-6/input.css:1:1] 1 | @media (400px >= width <= 700px) {} : ^^^^^ @@ -185,7 +185,7 @@ : ^^^^^ `---- - x Dimension { value: 700.0, raw_value: "700", unit: Atom('px' type=static), raw_unit: "px", type_flag: Integer } + x Dimension { value: 700.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("700", "px") } ,-[$DIR/tests/recovery/at-rule/media/feature-range-6/input.css:1:1] 1 | @media (400px >= width <= 700px) {} : ^^^^^ diff --git a/crates/swc_css_parser/tests/recovery/at-rule/media/invalid-nesting/output.json b/crates/swc_css_parser/tests/recovery/at-rule/media/invalid-nesting/output.json index 3bd845d4d2b1..2292830b1a8f 100644 --- a/crates/swc_css_parser/tests/recovery/at-rule/media/invalid-nesting/output.json +++ b/crates/swc_css_parser/tests/recovery/at-rule/media/invalid-nesting/output.json @@ -171,10 +171,12 @@ "token": { "Dimension": { "value": 1024.0, - "raw_value": "1024", "unit": "px", - "raw_unit": "px", - "type": "integer" + "type": "integer", + "raw": [ + "1024", + "px" + ] } } }, diff --git a/crates/swc_css_parser/tests/recovery/at-rule/media/invalid-nesting/span.swc-stderr b/crates/swc_css_parser/tests/recovery/at-rule/media/invalid-nesting/span.swc-stderr index 3225a4788edd..4b561ce694c2 100644 --- a/crates/swc_css_parser/tests/recovery/at-rule/media/invalid-nesting/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/at-rule/media/invalid-nesting/span.swc-stderr @@ -218,7 +218,7 @@ 3 | } `---- - x Dimension { value: 1024.0, raw_value: "1024", unit: Atom('px' type=static), raw_unit: "px", type_flag: Integer } + x Dimension { value: 1024.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("1024", "px") } ,-[$DIR/tests/recovery/at-rule/media/invalid-nesting/input.css:1:1] 1 | @media (min-width: 480px) { 2 | max-inline-size: 1024px; diff --git a/crates/swc_css_parser/tests/recovery/at-rule/supports/wrong-or-and/output.json b/crates/swc_css_parser/tests/recovery/at-rule/supports/wrong-or-and/output.json index a5b9b95669cf..0ccd958b2cc0 100644 --- a/crates/swc_css_parser/tests/recovery/at-rule/supports/wrong-or-and/output.json +++ b/crates/swc_css_parser/tests/recovery/at-rule/supports/wrong-or-and/output.json @@ -343,10 +343,12 @@ "token": { "Dimension": { "value": 10.0, - "raw_value": "10", "unit": "deg", - "raw_unit": "deg", - "type": "integer" + "type": "integer", + "raw": [ + "10", + "deg" + ] } } } diff --git a/crates/swc_css_parser/tests/recovery/at-rule/supports/wrong-or-and/span.swc-stderr b/crates/swc_css_parser/tests/recovery/at-rule/supports/wrong-or-and/span.swc-stderr index 3da55b45b3d1..2935583360d6 100644 --- a/crates/swc_css_parser/tests/recovery/at-rule/supports/wrong-or-and/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/at-rule/supports/wrong-or-and/span.swc-stderr @@ -323,7 +323,7 @@ : ^^^^^ `---- - x Dimension { value: 10.0, raw_value: "10", unit: Atom('deg' type=static), raw_unit: "deg", type_flag: Integer } + x Dimension { value: 10.0, unit: Atom('deg' type=static), type_flag: Integer, raw: ("10", "deg") } ,-[$DIR/tests/recovery/at-rule/supports/wrong-or-and/input.css:1:1] 1 | @supports (transition-property: color) or (animation-name: foo) and (transform: rotate(10deg)) {} : ^^^^^ diff --git a/crates/swc_css_parser/tests/recovery/declaration/wrong-name-3/output.json b/crates/swc_css_parser/tests/recovery/declaration/wrong-name-3/output.json index 1cae0d8ee427..6668d38dd39b 100644 --- a/crates/swc_css_parser/tests/recovery/declaration/wrong-name-3/output.json +++ b/crates/swc_css_parser/tests/recovery/declaration/wrong-name-3/output.json @@ -123,10 +123,12 @@ "token": { "Dimension": { "value": 20.0, - "raw_value": "20", "unit": "px", - "raw_unit": "px", - "type": "integer" + "type": "integer", + "raw": [ + "20", + "px" + ] } } } diff --git a/crates/swc_css_parser/tests/recovery/declaration/wrong-name-3/span.swc-stderr b/crates/swc_css_parser/tests/recovery/declaration/wrong-name-3/span.swc-stderr index 14617f43498c..4c971af23813 100644 --- a/crates/swc_css_parser/tests/recovery/declaration/wrong-name-3/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/declaration/wrong-name-3/span.swc-stderr @@ -131,7 +131,7 @@ 3 | } `---- - x Dimension { value: 20.0, raw_value: "20", unit: Atom('px' type=static), raw_unit: "px", type_flag: Integer } + x Dimension { value: 20.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("20", "px") } ,-[$DIR/tests/recovery/declaration/wrong-name-3/input.css:1:1] 1 | a { 2 | func(20px); diff --git a/crates/swc_css_parser/tests/recovery/function/calc/space/output.json b/crates/swc_css_parser/tests/recovery/function/calc/space/output.json index a23543142d39..4a1eb7d2acb6 100644 --- a/crates/swc_css_parser/tests/recovery/function/calc/space/output.json +++ b/crates/swc_css_parser/tests/recovery/function/calc/space/output.json @@ -126,10 +126,12 @@ "token": { "Dimension": { "value": 2.0, - "raw_value": "2", "unit": "px", - "raw_unit": "px", - "type": "integer" + "type": "integer", + "raw": [ + "2", + "px" + ] } } }, @@ -143,10 +145,12 @@ "token": { "Dimension": { "value": 1.0, - "raw_value": "+1", "unit": "px", - "raw_unit": "px", - "type": "integer" + "type": "integer", + "raw": [ + "+1", + "px" + ] } } } diff --git a/crates/swc_css_parser/tests/recovery/function/calc/space/span.swc-stderr b/crates/swc_css_parser/tests/recovery/function/calc/space/span.swc-stderr index ed18eb93a4ab..db174fda5032 100644 --- a/crates/swc_css_parser/tests/recovery/function/calc/space/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/function/calc/space/span.swc-stderr @@ -148,7 +148,7 @@ 3 | } `---- - x Dimension { value: 2.0, raw_value: "2", unit: Atom('px' type=static), raw_unit: "px", type_flag: Integer } + x Dimension { value: 2.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("2", "px") } ,-[$DIR/tests/recovery/function/calc/space/input.css:1:1] 1 | .style { 2 | width: calc(2px+1px); @@ -164,7 +164,7 @@ 3 | } `---- - x Dimension { value: 1.0, raw_value: "+1", unit: Atom('px' type=static), raw_unit: "px", type_flag: Integer } + x Dimension { value: 1.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("+1", "px") } ,-[$DIR/tests/recovery/function/calc/space/input.css:1:1] 1 | .style { 2 | width: calc(2px+1px); diff --git a/crates/swc_css_parser/tests/recovery/function/unclosed-2/output.json b/crates/swc_css_parser/tests/recovery/function/unclosed-2/output.json index d2a125ca7487..fd24e6194461 100644 --- a/crates/swc_css_parser/tests/recovery/function/unclosed-2/output.json +++ b/crates/swc_css_parser/tests/recovery/function/unclosed-2/output.json @@ -209,10 +209,12 @@ "token": { "Dimension": { "value": 12.0, - "raw_value": "12", "unit": "px", - "raw_unit": "px", - "type": "integer" + "type": "integer", + "raw": [ + "12", + "px" + ] } } }, diff --git a/crates/swc_css_parser/tests/recovery/function/unclosed-2/span.swc-stderr b/crates/swc_css_parser/tests/recovery/function/unclosed-2/span.swc-stderr index 70f85a2f95b8..20312a25ce32 100644 --- a/crates/swc_css_parser/tests/recovery/function/unclosed-2/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/function/unclosed-2/span.swc-stderr @@ -247,7 +247,7 @@ 3 | } `---- - x Dimension { value: 12.0, raw_value: "12", unit: Atom('px' type=static), raw_unit: "px", type_flag: Integer } + x Dimension { value: 12.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("12", "px") } ,-[$DIR/tests/recovery/function/unclosed-2/input.css:1:1] 1 | .style { 2 | grid-template-columns: repeat(4, [col-start] 12px diff --git a/crates/swc_css_parser/tests/recovery/function/unclosed/output.json b/crates/swc_css_parser/tests/recovery/function/unclosed/output.json index de11c9f5373c..8b7b54e6f9cb 100644 --- a/crates/swc_css_parser/tests/recovery/function/unclosed/output.json +++ b/crates/swc_css_parser/tests/recovery/function/unclosed/output.json @@ -126,10 +126,12 @@ "token": { "Dimension": { "value": 500.0, - "raw_value": "500", "unit": "px", - "raw_unit": "px", - "type": "integer" + "type": "integer", + "raw": [ + "500", + "px" + ] } } }, diff --git a/crates/swc_css_parser/tests/recovery/function/unclosed/span.swc-stderr b/crates/swc_css_parser/tests/recovery/function/unclosed/span.swc-stderr index 659b574c0450..f6cea90ebde1 100644 --- a/crates/swc_css_parser/tests/recovery/function/unclosed/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/function/unclosed/span.swc-stderr @@ -143,7 +143,7 @@ 3 | } `---- - x Dimension { value: 500.0, raw_value: "500", unit: Atom('px' type=static), raw_unit: "px", type_flag: Integer } + x Dimension { value: 500.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("500", "px") } ,-[$DIR/tests/recovery/function/unclosed/input.css:1:1] 1 | .style { 2 | width: min(500px; diff --git a/crates/swc_css_parser/tests/recovery/number/output.json b/crates/swc_css_parser/tests/recovery/number/output.json index 5ba5cefc6179..d8a88bf60d37 100644 --- a/crates/swc_css_parser/tests/recovery/number/output.json +++ b/crates/swc_css_parser/tests/recovery/number/output.json @@ -115,10 +115,12 @@ "token": { "Dimension": { "value": 10.1, - "raw_value": "10.10", "unit": "px", - "raw_unit": "px", - "type": "number" + "type": "number", + "raw": [ + "10.10", + "px" + ] } } }, @@ -181,10 +183,12 @@ "token": { "Dimension": { "value": 10.0, - "raw_value": "10", "unit": "px", - "raw_unit": "px", - "type": "integer" + "type": "integer", + "raw": [ + "10", + "px" + ] } } }, diff --git a/crates/swc_css_parser/tests/recovery/number/span.swc-stderr b/crates/swc_css_parser/tests/recovery/number/span.swc-stderr index 6dcaabed6380..373479969816 100644 --- a/crates/swc_css_parser/tests/recovery/number/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/number/span.swc-stderr @@ -149,7 +149,7 @@ 3 | prop1: 10px `---- - x Dimension { value: 10.1, raw_value: "10.10", unit: Atom('px' type=static), raw_unit: "px", type_flag: Number } + x Dimension { value: 10.1, unit: Atom('px' type=static), type_flag: Number, raw: ("10.10", "px") } ,-[$DIR/tests/recovery/number/input.css:1:1] 1 | a { 2 | prop: 10.10px @@ -229,7 +229,7 @@ 4 | prop2: 10 `---- - x Dimension { value: 10.0, raw_value: "10", unit: Atom('px' type=static), raw_unit: "px", type_flag: Integer } + x Dimension { value: 10.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("10", "px") } ,-[$DIR/tests/recovery/number/input.css:2:1] 2 | prop: 10.10px 3 | prop1: 10px diff --git a/crates/swc_css_parser/tests/recovery/style-blocks-contents/invalid-nested-1/output.json b/crates/swc_css_parser/tests/recovery/style-blocks-contents/invalid-nested-1/output.json index a5dc7d99d4b9..6b73dfd2f8c9 100644 --- a/crates/swc_css_parser/tests/recovery/style-blocks-contents/invalid-nested-1/output.json +++ b/crates/swc_css_parser/tests/recovery/style-blocks-contents/invalid-nested-1/output.json @@ -229,10 +229,12 @@ "token": { "Dimension": { "value": 1.0, - "raw_value": "1", "unit": "em", - "raw_unit": "em", - "type": "integer" + "type": "integer", + "raw": [ + "1", + "em" + ] } } }, diff --git a/crates/swc_css_parser/tests/recovery/style-blocks-contents/invalid-nested-1/span.swc-stderr b/crates/swc_css_parser/tests/recovery/style-blocks-contents/invalid-nested-1/span.swc-stderr index 8b8e1ed0799b..1c55ba818e36 100644 --- a/crates/swc_css_parser/tests/recovery/style-blocks-contents/invalid-nested-1/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/style-blocks-contents/invalid-nested-1/span.swc-stderr @@ -296,7 +296,7 @@ 6 | } `---- - x Dimension { value: 1.0, raw_value: "1", unit: Atom('em' type=static), raw_unit: "em", type_flag: Integer } + x Dimension { value: 1.0, unit: Atom('em' type=static), type_flag: Integer, raw: ("1", "em") } ,-[$DIR/tests/recovery/style-blocks-contents/invalid-nested-1/input.css:4:1] 4 | input { 5 | margin: 1em; diff --git a/crates/swc_css_parser/tests/recovery/unicode-range/output.json b/crates/swc_css_parser/tests/recovery/unicode-range/output.json index 339fc3cd6eac..1ca2e4deec7e 100644 --- a/crates/swc_css_parser/tests/recovery/unicode-range/output.json +++ b/crates/swc_css_parser/tests/recovery/unicode-range/output.json @@ -122,10 +122,12 @@ "token": { "Dimension": { "value": 1.0, - "raw_value": "+1", "unit": "Z1ee1-FFFFFF", - "raw_unit": "Z1ee1-FFFFFF", - "type": "integer" + "type": "integer", + "raw": [ + "+1", + "Z1ee1-FFFFFF" + ] } } } @@ -174,10 +176,12 @@ "token": { "Dimension": { "value": 10.0, - "raw_value": "+1e1", "unit": "ee1-FFZFFF", - "raw_unit": "ee1-FFZFFF", - "type": "number" + "type": "number", + "raw": [ + "+1e1", + "ee1-FFZFFF" + ] } } } diff --git a/crates/swc_css_parser/tests/recovery/unicode-range/span.swc-stderr b/crates/swc_css_parser/tests/recovery/unicode-range/span.swc-stderr index 54f85a408413..1cd2d236b8f2 100644 --- a/crates/swc_css_parser/tests/recovery/unicode-range/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/unicode-range/span.swc-stderr @@ -144,7 +144,7 @@ 3 | unicode-range: U+1e1ee1-FFZFFF; `---- - x Dimension { value: 1.0, raw_value: "+1", unit: Atom('Z1ee1-FFFFFF' type=dynamic), raw_unit: "Z1ee1-FFFFFF", type_flag: Integer } + x Dimension { value: 1.0, unit: Atom('Z1ee1-FFFFFF' type=dynamic), type_flag: Integer, raw: ("+1", "Z1ee1-FFFFFF") } ,-[$DIR/tests/recovery/unicode-range/input.css:1:1] 1 | .class { 2 | unicode-range: U+1Z1ee1-FFFFFF; @@ -216,7 +216,7 @@ 4 | } `---- - x Dimension { value: 10.0, raw_value: "+1e1", unit: Atom('ee1-FFZFFF' type=dynamic), raw_unit: "ee1-FFZFFF", type_flag: Number } + x Dimension { value: 10.0, unit: Atom('ee1-FFZFFF' type=dynamic), type_flag: Number, raw: ("+1e1", "ee1-FFZFFF") } ,-[$DIR/tests/recovery/unicode-range/input.css:2:1] 2 | unicode-range: U+1Z1ee1-FFFFFF; 3 | unicode-range: U+1e1ee1-FFZFFF; diff --git a/crates/swc_css_parser/tests/recovery/vercel/004/output.json b/crates/swc_css_parser/tests/recovery/vercel/004/output.json index fe0ff6b3dce1..f4de07deb0b5 100644 --- a/crates/swc_css_parser/tests/recovery/vercel/004/output.json +++ b/crates/swc_css_parser/tests/recovery/vercel/004/output.json @@ -218,10 +218,12 @@ "token": { "Dimension": { "value": 7.0, - "raw_value": "7", "unit": "px", - "raw_unit": "px", - "type": "integer" + "type": "integer", + "raw": [ + "7", + "px" + ] } } }, diff --git a/crates/swc_css_parser/tests/recovery/vercel/004/span.swc-stderr b/crates/swc_css_parser/tests/recovery/vercel/004/span.swc-stderr index 7030a1a9597c..806fdfa216e0 100644 --- a/crates/swc_css_parser/tests/recovery/vercel/004/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/vercel/004/span.swc-stderr @@ -288,7 +288,7 @@ 5 | color: white; `---- - x Dimension { value: 7.0, raw_value: "7", unit: Atom('px' type=static), raw_unit: "px", type_flag: Integer } + x Dimension { value: 7.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("7", "px") } ,-[$DIR/tests/recovery/vercel/004/input.css:3:1] 3 | __ident__ 4 | border-radius: 7px; diff --git a/crates/swc_css_parser/tests/recovery/vercel/005/output.json b/crates/swc_css_parser/tests/recovery/vercel/005/output.json index a7c3ca49c95c..26a089aadf08 100644 --- a/crates/swc_css_parser/tests/recovery/vercel/005/output.json +++ b/crates/swc_css_parser/tests/recovery/vercel/005/output.json @@ -153,10 +153,12 @@ "token": { "Dimension": { "value": 7.0, - "raw_value": "7", "unit": "px", - "raw_unit": "px", - "type": "integer" + "type": "integer", + "raw": [ + "7", + "px" + ] } } }, diff --git a/crates/swc_css_parser/tests/recovery/vercel/005/span.swc-stderr b/crates/swc_css_parser/tests/recovery/vercel/005/span.swc-stderr index ddeecefd9fff..412df528d8f9 100644 --- a/crates/swc_css_parser/tests/recovery/vercel/005/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/vercel/005/span.swc-stderr @@ -216,7 +216,7 @@ 5 | color: white; `---- - x Dimension { value: 7.0, raw_value: "7", unit: Atom('px' type=static), raw_unit: "px", type_flag: Integer } + x Dimension { value: 7.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("7", "px") } ,-[$DIR/tests/recovery/vercel/005/input.css:3:1] 3 | __ident__ 4 | border-radius: 7px; From 1902acde10b093c49c531c736173bf4c47ece925 Mon Sep 17 00:00:00 2001 From: "alexander.akait" Date: Fri, 2 Dec 2022 17:30:50 +0300 Subject: [PATCH 05/42] fix: bug --- crates/swc_css_minifier/src/compressor/mod.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/crates/swc_css_minifier/src/compressor/mod.rs b/crates/swc_css_minifier/src/compressor/mod.rs index 6c8e31e9fd87..2515c775ec2a 100644 --- a/crates/swc_css_minifier/src/compressor/mod.rs +++ b/crates/swc_css_minifier/src/compressor/mod.rs @@ -405,12 +405,10 @@ impl VisitMut for Compressor { { self.need_utf8_at_rule = true; } - Token::BadString { - raw_value: value, .. + Token::BadString { raw: value, .. } if !contains_only_ascii_characters(value) => { + self.need_utf8_at_rule = true; } - | Token::BadUrl { - raw_value: value, .. - } if !contains_only_ascii_characters(value) => { + Token::BadUrl { raw: value, .. } if !contains_only_ascii_characters(&value.1) => { self.need_utf8_at_rule = true; } Token::Dimension { unit: value, .. } if !contains_only_ascii_characters(value) => { From f36b18a15414dd4c3e34ba0ac840d5659e0b0d86 Mon Sep 17 00:00:00 2001 From: "alexander.akait" Date: Fri, 2 Dec 2022 18:54:04 +0300 Subject: [PATCH 06/42] perf(css/parser): reduce component value size --- crates/swc_css_ast/src/base.rs | 4 ++-- crates/swc_css_parser/src/parser/at_rules/mod.rs | 4 ++-- crates/swc_css_visit/src/lib.rs | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/swc_css_ast/src/base.rs b/crates/swc_css_ast/src/base.rs index 41483f89dc24..42bf1ab5c8e1 100644 --- a/crates/swc_css_ast/src/base.rs +++ b/crates/swc_css_ast/src/base.rs @@ -102,7 +102,7 @@ pub enum ComponentValue { #[tag("StyleBlock")] StyleBlock(StyleBlock), #[tag("KeyframeBlock")] - KeyframeBlock(KeyframeBlock), + KeyframeBlock(Box), // Arbitrary Contents grammar #[tag("Ident")] @@ -146,7 +146,7 @@ pub enum ComponentValue { #[tag("SupportsCondition")] SupportsCondition(SupportsCondition), #[tag("Declaration")] - Declaration(Declaration), + Declaration(Box), } #[ast_node] diff --git a/crates/swc_css_parser/src/parser/at_rules/mod.rs b/crates/swc_css_parser/src/parser/at_rules/mod.rs index 226a3fc78544..d527ae3e0dee 100644 --- a/crates/swc_css_parser/src/parser/at_rules/mod.rs +++ b/crates/swc_css_parser/src/parser/at_rules/mod.rs @@ -606,11 +606,11 @@ where Ok(keyframes_selectors) }) { Ok(keyframes_selectors) => { - ComponentValue::KeyframeBlock(KeyframeBlock { + ComponentValue::KeyframeBlock(Box::new(KeyframeBlock { span: qualified_rule.span, prelude: keyframes_selectors, block: qualified_rule.block, - }) + })) } Err(err) => { self.errors.push(err); diff --git a/crates/swc_css_visit/src/lib.rs b/crates/swc_css_visit/src/lib.rs index dfedd13584a5..acec41ac110c 100644 --- a/crates/swc_css_visit/src/lib.rs +++ b/crates/swc_css_visit/src/lib.rs @@ -30,7 +30,7 @@ define!({ DeclarationOrAtRule(DeclarationOrAtRule), Rule(Rule), StyleBlock(StyleBlock), - KeyframeBlock(KeyframeBlock), + KeyframeBlock(Box), Ident(Ident), DashedIdent(DashedIdent), @@ -52,7 +52,7 @@ define!({ ComplexSelector(ComplexSelector), LayerName(LayerName), SupportsCondition(SupportsCondition), - Declaration(Declaration), + Declaration(Box), } pub struct Ident { From 61726eacfe6dbc8f9f60aaacab316baf33c868c2 Mon Sep 17 00:00:00 2001 From: "alexander.akait" Date: Fri, 2 Dec 2022 18:58:55 +0300 Subject: [PATCH 07/42] perf(css/parser): reduce component value size --- crates/swc_css_ast/src/base.rs | 2 +- crates/swc_css_parser/src/parser/values_and_units/mod.rs | 2 +- crates/swc_css_visit/src/lib.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/swc_css_ast/src/base.rs b/crates/swc_css_ast/src/base.rs index 42bf1ab5c8e1..e922bc895af0 100644 --- a/crates/swc_css_ast/src/base.rs +++ b/crates/swc_css_ast/src/base.rs @@ -92,7 +92,7 @@ pub enum ComponentValue { #[tag("Function")] Function(Function), #[tag("SimpleBlock")] - SimpleBlock(SimpleBlock), + SimpleBlock(Box), // Block Contents grammar #[tag("DeclarationOrAtRule")] diff --git a/crates/swc_css_parser/src/parser/values_and_units/mod.rs b/crates/swc_css_parser/src/parser/values_and_units/mod.rs index 665a1aabcbe7..fac1f21ae8d5 100644 --- a/crates/swc_css_parser/src/parser/values_and_units/mod.rs +++ b/crates/swc_css_parser/src/parser/values_and_units/mod.rs @@ -103,7 +103,7 @@ where } }; - return Ok(ComponentValue::SimpleBlock(block)); + return Ok(ComponentValue::SimpleBlock(Box::new(block))); } tok!("#") => { diff --git a/crates/swc_css_visit/src/lib.rs b/crates/swc_css_visit/src/lib.rs index acec41ac110c..e5142ac096f7 100644 --- a/crates/swc_css_visit/src/lib.rs +++ b/crates/swc_css_visit/src/lib.rs @@ -25,7 +25,7 @@ define!({ pub enum ComponentValue { PreservedToken(TokenAndSpan), Function(Function), - SimpleBlock(SimpleBlock), + SimpleBlock(Box), DeclarationOrAtRule(DeclarationOrAtRule), Rule(Rule), From bef5337653af95d1d8e64702f316c2b4f1fc31a8 Mon Sep 17 00:00:00 2001 From: "alexander.akait" Date: Fri, 2 Dec 2022 19:04:21 +0300 Subject: [PATCH 08/42] perf(css/parser): reduce component value size --- crates/swc_css_ast/src/base.rs | 12 ++++++------ crates/swc_css_visit/src/lib.rs | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/crates/swc_css_ast/src/base.rs b/crates/swc_css_ast/src/base.rs index e922bc895af0..6d0ef0dc2758 100644 --- a/crates/swc_css_ast/src/base.rs +++ b/crates/swc_css_ast/src/base.rs @@ -112,7 +112,7 @@ pub enum ComponentValue { #[tag("String")] Str(Str), #[tag("Url")] - Url(Url), + Url(Box), #[tag("Integer")] Integer(Integer), #[tag("Number")] @@ -120,19 +120,19 @@ pub enum ComponentValue { #[tag("Percentage")] Percentage(Percentage), #[tag("Dimension")] - Dimension(Dimension), + Dimension(Box), #[tag("Ratio")] - Ratio(Ratio), + Ratio(Box), #[tag("UnicodeRange")] UnicodeRange(UnicodeRange), #[tag("Color")] - Color(Color), + Color(Box), #[tag("AlphaValue")] AlphaValue(AlphaValue), #[tag("Hue")] - Hue(Hue), + Hue(Box), #[tag("CmykComponent")] - CmykComponent(CmykComponent), + CmykComponent(Box), #[tag("Delimiter")] Delimiter(Delimiter), diff --git a/crates/swc_css_visit/src/lib.rs b/crates/swc_css_visit/src/lib.rs index e5142ac096f7..1c2f3735c009 100644 --- a/crates/swc_css_visit/src/lib.rs +++ b/crates/swc_css_visit/src/lib.rs @@ -35,17 +35,17 @@ define!({ Ident(Ident), DashedIdent(DashedIdent), Str(Str), - Url(Url), + Url(Box), Integer(Integer), Number(Number), Percentage(Percentage), - Dimension(Dimension), - Ratio(Ratio), + Dimension(Box), + Ratio(Box), UnicodeRange(UnicodeRange), - Color(Color), + Color(Box), AlphaValue(AlphaValue), - Hue(Hue), - CmykComponent(CmykComponent), + Hue(Box), + CmykComponent(Box), Delimiter(Delimiter), CalcSum(CalcSum), From 598bb067c6af82508b85e37000958ca09a50404c Mon Sep 17 00:00:00 2001 From: "alexander.akait" Date: Fri, 2 Dec 2022 19:06:43 +0300 Subject: [PATCH 09/42] perf(css/parser): reduce component value size --- crates/swc_css_ast/src/base.rs | 2 +- crates/swc_css_parser/src/parser/syntax/mod.rs | 2 +- crates/swc_css_visit/src/lib.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/swc_css_ast/src/base.rs b/crates/swc_css_ast/src/base.rs index 6d0ef0dc2758..7f2cd11fc5a9 100644 --- a/crates/swc_css_ast/src/base.rs +++ b/crates/swc_css_ast/src/base.rs @@ -90,7 +90,7 @@ pub enum ComponentValue { #[tag("TokenAndSpan")] PreservedToken(TokenAndSpan), #[tag("Function")] - Function(Function), + Function(Box), #[tag("SimpleBlock")] SimpleBlock(Box), diff --git a/crates/swc_css_parser/src/parser/syntax/mod.rs b/crates/swc_css_parser/src/parser/syntax/mod.rs index 756efee6a3ce..4bdaabaf8a6c 100644 --- a/crates/swc_css_parser/src/parser/syntax/mod.rs +++ b/crates/swc_css_parser/src/parser/syntax/mod.rs @@ -805,7 +805,7 @@ where ..self.ctx } }) - .parse_as::()?; + .parse_as::>()?; Ok(ComponentValue::Function(function)) } diff --git a/crates/swc_css_visit/src/lib.rs b/crates/swc_css_visit/src/lib.rs index 1c2f3735c009..a0004d3acda4 100644 --- a/crates/swc_css_visit/src/lib.rs +++ b/crates/swc_css_visit/src/lib.rs @@ -24,7 +24,7 @@ define!({ pub enum ComponentValue { PreservedToken(TokenAndSpan), - Function(Function), + Function(Box), SimpleBlock(Box), DeclarationOrAtRule(DeclarationOrAtRule), From 2109f4c2f70edf3fd892448b72677c1b15f687fa Mon Sep 17 00:00:00 2001 From: "alexander.akait" Date: Fri, 2 Dec 2022 19:10:57 +0300 Subject: [PATCH 10/42] perf(css/parser): reduce component value size --- crates/swc_css_ast/src/base.rs | 6 +++--- crates/swc_css_visit/src/lib.rs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/swc_css_ast/src/base.rs b/crates/swc_css_ast/src/base.rs index 7f2cd11fc5a9..9f7c55ad52bb 100644 --- a/crates/swc_css_ast/src/base.rs +++ b/crates/swc_css_ast/src/base.rs @@ -124,17 +124,17 @@ pub enum ComponentValue { #[tag("Ratio")] Ratio(Box), #[tag("UnicodeRange")] - UnicodeRange(UnicodeRange), + UnicodeRange(Box), #[tag("Color")] Color(Box), #[tag("AlphaValue")] - AlphaValue(AlphaValue), + AlphaValue(Box), #[tag("Hue")] Hue(Box), #[tag("CmykComponent")] CmykComponent(Box), #[tag("Delimiter")] - Delimiter(Delimiter), + Delimiter(Box), // Special function Contents grammar #[tag("CalcSum")] diff --git a/crates/swc_css_visit/src/lib.rs b/crates/swc_css_visit/src/lib.rs index a0004d3acda4..7187f0d392a6 100644 --- a/crates/swc_css_visit/src/lib.rs +++ b/crates/swc_css_visit/src/lib.rs @@ -41,12 +41,12 @@ define!({ Percentage(Percentage), Dimension(Box), Ratio(Box), - UnicodeRange(UnicodeRange), + UnicodeRange(Box), Color(Box), - AlphaValue(AlphaValue), + AlphaValue(Box), Hue(Box), CmykComponent(Box), - Delimiter(Delimiter), + Delimiter(Box), CalcSum(CalcSum), ComplexSelector(ComplexSelector), From 9000b65fe0813ebd022774db53314ee9cd20ea32 Mon Sep 17 00:00:00 2001 From: "alexander.akait" Date: Fri, 2 Dec 2022 19:13:53 +0300 Subject: [PATCH 11/42] perf(css/parser): reduce component value size --- crates/swc_css_ast/src/base.rs | 8 ++++---- crates/swc_css_parser/src/parser/values_and_units/mod.rs | 2 +- crates/swc_css_visit/src/lib.rs | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/crates/swc_css_ast/src/base.rs b/crates/swc_css_ast/src/base.rs index 9f7c55ad52bb..b449430f75a8 100644 --- a/crates/swc_css_ast/src/base.rs +++ b/crates/swc_css_ast/src/base.rs @@ -138,13 +138,13 @@ pub enum ComponentValue { // Special function Contents grammar #[tag("CalcSum")] - CalcSum(CalcSum), + CalcSum(Box), #[tag("ComplexSelector")] - ComplexSelector(ComplexSelector), + ComplexSelector(Box), #[tag("LayerName")] - LayerName(LayerName), + LayerName(Box), #[tag("SupportsCondition")] - SupportsCondition(SupportsCondition), + SupportsCondition(Box), #[tag("Declaration")] Declaration(Box), } diff --git a/crates/swc_css_parser/src/parser/values_and_units/mod.rs b/crates/swc_css_parser/src/parser/values_and_units/mod.rs index fac1f21ae8d5..634223da64aa 100644 --- a/crates/swc_css_parser/src/parser/values_and_units/mod.rs +++ b/crates/swc_css_parser/src/parser/values_and_units/mod.rs @@ -1589,7 +1589,7 @@ where )); } - let layer_name = self.parse_as::()?; + let layer_name = self.parse_as::>()?; values.push(ComponentValue::LayerName(layer_name)); diff --git a/crates/swc_css_visit/src/lib.rs b/crates/swc_css_visit/src/lib.rs index 7187f0d392a6..3a199408e401 100644 --- a/crates/swc_css_visit/src/lib.rs +++ b/crates/swc_css_visit/src/lib.rs @@ -48,10 +48,10 @@ define!({ CmykComponent(Box), Delimiter(Box), - CalcSum(CalcSum), - ComplexSelector(ComplexSelector), - LayerName(LayerName), - SupportsCondition(SupportsCondition), + CalcSum(Box), + ComplexSelector(Box), + LayerName(Box), + SupportsCondition(Box), Declaration(Box), } From 82d5b63bc3d5803879ab603ef1f99a2f23820089 Mon Sep 17 00:00:00 2001 From: "alexander.akait" Date: Fri, 2 Dec 2022 19:15:05 +0300 Subject: [PATCH 12/42] perf(css/parser): reduce component value size --- crates/swc_css_ast/src/base.rs | 4 ++-- crates/swc_css_visit/src/lib.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/swc_css_ast/src/base.rs b/crates/swc_css_ast/src/base.rs index b449430f75a8..2db372bfb931 100644 --- a/crates/swc_css_ast/src/base.rs +++ b/crates/swc_css_ast/src/base.rs @@ -110,7 +110,7 @@ pub enum ComponentValue { #[tag("DashedIdent")] DashedIdent(DashedIdent), #[tag("String")] - Str(Str), + Str(Box), #[tag("Url")] Url(Box), #[tag("Integer")] @@ -118,7 +118,7 @@ pub enum ComponentValue { #[tag("Number")] Number(Number), #[tag("Percentage")] - Percentage(Percentage), + Percentage(Box), #[tag("Dimension")] Dimension(Box), #[tag("Ratio")] diff --git a/crates/swc_css_visit/src/lib.rs b/crates/swc_css_visit/src/lib.rs index 3a199408e401..eebf03e04ad7 100644 --- a/crates/swc_css_visit/src/lib.rs +++ b/crates/swc_css_visit/src/lib.rs @@ -34,11 +34,11 @@ define!({ Ident(Ident), DashedIdent(DashedIdent), - Str(Str), + Str(Box), Url(Box), Integer(Integer), Number(Number), - Percentage(Percentage), + Percentage(Box), Dimension(Box), Ratio(Box), UnicodeRange(Box), From 67dc33366ca8f4be40b9a303a54097f431571c58 Mon Sep 17 00:00:00 2001 From: "alexander.akait" Date: Fri, 2 Dec 2022 20:16:32 +0300 Subject: [PATCH 13/42] perf(css/parser): reduce component value size --- crates/swc_css_parser/src/parser/input.rs | 63 ++++++++++++----------- 1 file changed, 33 insertions(+), 30 deletions(-) diff --git a/crates/swc_css_parser/src/parser/input.rs b/crates/swc_css_parser/src/parser/input.rs index b892a0c1a646..4934c6e84e06 100644 --- a/crates/swc_css_parser/src/parser/input.rs +++ b/crates/swc_css_parser/src/parser/input.rs @@ -220,15 +220,15 @@ pub enum InputType<'a> { } #[derive(Debug)] -pub enum TokenOrBlock { - Token(TokenAndSpan), - Function(Span, JsWord, Atom), - LBracket(Span), - LParen(Span), - LBrace(Span), - RParen(Span), - RBracket(Span), - RBrace(Span), +enum TokenOrBlock { + Token(Box), + Function(Box<(Span, JsWord, Atom)>), + LBracket(Box), + LParen(Box), + LBrace(Box), + RParen(Box), + RBracket(Box), + RBrace(Box), } impl<'a> Input<'a> { @@ -267,11 +267,11 @@ impl<'a> Input<'a> { match list.get(*index) { Some(ComponentValue::PreservedToken(token_and_span)) => { - Some(TokenOrBlock::Token(token_and_span.clone())) + Some(TokenOrBlock::Token(Box::new(token_and_span.clone()))) } Some(ComponentValue::Function(function)) => { if self.idx.len() - 1 == deep { - return Some(TokenOrBlock::Function( + return Some(TokenOrBlock::Function(Box::new(( Span::new( function.span_lo(), function.name.span_hi() + BytePos(1), @@ -282,17 +282,17 @@ impl<'a> Input<'a> { Some(raw) => raw.clone(), _ => Atom::from(function.name.value.clone()), }, - )); + )))); } let res = self.get_component_value(&function.value, deep + 1); if res.is_none() { - return Some(TokenOrBlock::RParen(Span::new( + return Some(TokenOrBlock::RParen(Box::new(Span::new( function.span_hi() - BytePos(1), function.span_hi(), Default::default(), - ))); + )))); } res @@ -300,9 +300,9 @@ impl<'a> Input<'a> { Some(ComponentValue::SimpleBlock(simple_block)) => { if self.idx.len() - 1 == deep { let close = match simple_block.name.token { - Token::LBracket => TokenOrBlock::LBracket(simple_block.name.span), - Token::LParen => TokenOrBlock::LParen(simple_block.name.span), - Token::LBrace => TokenOrBlock::LBrace(simple_block.name.span), + Token::LBracket => TokenOrBlock::LBracket(Box::new(simple_block.name.span)), + Token::LParen => TokenOrBlock::LParen(Box::new(simple_block.name.span)), + Token::LBrace => TokenOrBlock::LBrace(Box::new(simple_block.name.span)), _ => { unreachable!(); } @@ -320,9 +320,9 @@ impl<'a> Input<'a> { Default::default(), ); let close = match simple_block.name.token { - Token::LBracket => TokenOrBlock::RBracket(span), - Token::LParen => TokenOrBlock::RParen(span), - Token::LBrace => TokenOrBlock::RBrace(span), + Token::LBracket => TokenOrBlock::RBracket(Box::new(span)), + Token::LParen => TokenOrBlock::RParen(Box::new(span)), + Token::LBrace => TokenOrBlock::RBrace(Box::new(span)), _ => { unreachable!(); } @@ -368,33 +368,36 @@ impl<'a> Input<'a> { InputType::ListOfComponentValues(input) => { let token_and_span = match self.get_component_value(&input.children, 0) { Some(token_or_block) => match token_or_block { - TokenOrBlock::Token(token_and_span) => token_and_span, - TokenOrBlock::Function(span, value, raw) => TokenAndSpan { - span, - token: Token::Function { value, raw }, + TokenOrBlock::Token(token_and_span) => *token_and_span, + TokenOrBlock::Function(function) => TokenAndSpan { + span: function.0, + token: Token::Function { + value: function.1, + raw: function.2, + }, }, TokenOrBlock::LBracket(span) => TokenAndSpan { - span, + span: *span, token: Token::LBracket, }, TokenOrBlock::LBrace(span) => TokenAndSpan { - span, + span: *span, token: Token::LBrace, }, TokenOrBlock::LParen(span) => TokenAndSpan { - span, + span: *span, token: Token::LParen, }, TokenOrBlock::RBracket(span) => TokenAndSpan { - span, + span: *span, token: Token::RBracket, }, TokenOrBlock::RBrace(span) => TokenAndSpan { - span, + span: *span, token: Token::RBrace, }, TokenOrBlock::RParen(span) => TokenAndSpan { - span, + span: *span, token: Token::RParen, }, }, From 408da56f110905399fac67a072b21e6f94f8640d Mon Sep 17 00:00:00 2001 From: "alexander.akait" Date: Sun, 4 Dec 2022 20:30:53 +0300 Subject: [PATCH 14/42] refactor: code on boxes --- crates/swc_css_codegen/src/lib.rs | 73 ++++++++++---- crates/swc_css_prefixer/src/prefixer.rs | 121 ++++++++++++------------ 2 files changed, 117 insertions(+), 77 deletions(-) diff --git a/crates/swc_css_codegen/src/lib.rs b/crates/swc_css_codegen/src/lib.rs index e6c11cb3cfb0..435e2a9c1695 100644 --- a/crates/swc_css_codegen/src/lib.rs +++ b/crates/swc_css_codegen/src/lib.rs @@ -1159,32 +1159,62 @@ where let need_delim = match node { ComponentValue::SimpleBlock(_) | ComponentValue::Function(_) - | ComponentValue::Color(Color::Function(_)) - | ComponentValue::Color(Color::AbsoluteColorBase( - AbsoluteColorBase::Function(_), - )) | ComponentValue::Delimiter(_) | ComponentValue::Str(_) | ComponentValue::Url(_) | ComponentValue::Percentage(_) => match next { - Some(ComponentValue::Delimiter(Delimiter { - value: DelimiterValue::Comma, - .. - })) => false, + Some(ComponentValue::Delimiter(delimiter)) + if matches!( + **delimiter, + Delimiter { + value: DelimiterValue::Comma, + .. + } + ) => + { + false + } _ => !self.config.minify, }, + ComponentValue::Color(color) + if matches!( + **color, + Color::AbsoluteColorBase(AbsoluteColorBase::Function(_)) + | Color::Function(_) + ) => + { + match next { + Some(ComponentValue::Delimiter(delimiter)) + if matches!( + **delimiter, + Delimiter { + value: DelimiterValue::Comma, + .. + } + ) => + { + false + } + _ => !self.config.minify, + } + } ComponentValue::Ident(_) | ComponentValue::DashedIdent(_) => match next { - Some(ComponentValue::SimpleBlock(SimpleBlock { name, .. })) => { - if name.token == Token::LParen { + Some(ComponentValue::SimpleBlock(simple_block)) => { + if simple_block.name.token == Token::LParen { true } else { !self.config.minify } } - Some(ComponentValue::Color(Color::AbsoluteColorBase( - AbsoluteColorBase::HexColor(_), - ))) - | Some(ComponentValue::Str(_)) => !self.config.minify, + Some(ComponentValue::Color(color)) + if matches!( + **color, + Color::AbsoluteColorBase(AbsoluteColorBase::HexColor(_),) + ) => + { + !self.config.minify + } + Some(ComponentValue::Str(_)) => !self.config.minify, Some(ComponentValue::Delimiter(_)) => false, Some(ComponentValue::Number(n)) => { if self.config.minify { @@ -1197,7 +1227,7 @@ where } Some(ComponentValue::Dimension(dimension)) => { if self.config.minify { - let value = match dimension { + let value = match &**dimension { Dimension::Length(i) => i.value.value, Dimension::Angle(i) => i.value.value, Dimension::Time(i) => i.value.value, @@ -1217,10 +1247,15 @@ where _ => true, }, _ => match next { - Some(ComponentValue::SimpleBlock(_)) - | Some(ComponentValue::Color(Color::AbsoluteColorBase( - AbsoluteColorBase::HexColor(_), - ))) => !self.config.minify, + Some(ComponentValue::SimpleBlock(_)) => !self.config.minify, + Some(ComponentValue::Color(color)) + if matches!( + &**color, + Color::AbsoluteColorBase(AbsoluteColorBase::HexColor(_)) + ) => + { + !self.config.minify + } Some(ComponentValue::Delimiter(_)) => false, _ => true, }, diff --git a/crates/swc_css_prefixer/src/prefixer.rs b/crates/swc_css_prefixer/src/prefixer.rs index 545185d40d5b..bba5e3651df0 100644 --- a/crates/swc_css_prefixer/src/prefixer.rs +++ b/crates/swc_css_prefixer/src/prefixer.rs @@ -133,7 +133,7 @@ impl VisitMut for CrossFadeFunctionReplacerOnLegacyVariant<'_> { for group in n.value.split_mut(|n| { matches!( n, - ComponentValue::Delimiter(Delimiter { + ComponentValue::Delimiter(delimiter) if matches!(&**delimiter, Delimiter { value: DelimiterValue::Comma, .. }) @@ -147,15 +147,12 @@ impl VisitMut for CrossFadeFunctionReplacerOnLegacyVariant<'_> { for n in group { match n { - ComponentValue::Percentage(Percentage { - value: Number { value, .. }, - .. - }) => { + ComponentValue::Percentage(percentage) => { if transparency_value.is_some() { return; } - transparency_value = Some(*value / 100.0); + transparency_value = Some(percentage.value.value / 100.0); } ComponentValue::Number(Number { value, .. }) => { if transparency_value.is_some() { @@ -207,10 +204,10 @@ impl VisitMut for CrossFadeFunctionReplacerOnLegacyVariant<'_> { .collect(); new_value.extend(vec![ - ComponentValue::Delimiter(Delimiter { + ComponentValue::Delimiter(Box::new(Delimiter { span: DUMMY_SP, value: DelimiterValue::Comma, - }), + })), ComponentValue::Number(Number { span: DUMMY_SP, value: transparency_value, @@ -247,9 +244,9 @@ impl VisitMut for ImageSetFunctionReplacerOnLegacyVariant<'_> { return; } - if let ComponentValue::Str(Str { span, value, .. }) = n { - *n = ComponentValue::Url(Url { - span: *span, + if let ComponentValue::Str(node) = n { + *n = ComponentValue::Url(Box::new(Url { + span: node.span, name: Ident { span: DUMMY_SP, value: js_word!("url"), @@ -257,11 +254,11 @@ impl VisitMut for ImageSetFunctionReplacerOnLegacyVariant<'_> { }, value: Some(Box::new(UrlValue::Str(Str { span: DUMMY_SP, - value: value.as_ref().into(), + value: node.value.as_ref().into(), raw: None, }))), modifiers: Some(vec![]), - }) + })) } } @@ -370,17 +367,21 @@ impl VisitMut for LinearGradientFunctionReplacerOnLegacyVariant<'_> { _ => {} } } - Some(ComponentValue::Dimension(Dimension::Angle(Angle { - value, - unit, - span, - .. - }))) => { - let angle = match &*unit.value { - "deg" => (value.value % 360.0 + 360.0) % 360.0, - "grad" => value.value * 180.0 / 200.0, - "rad" => value.value * 180.0 / PI, - "turn" => value.value * 360.0, + Some(ComponentValue::Dimension(dimension)) + if matches!(&**dimension, Dimension::Angle(_)) => + { + let node = match &**dimension { + Dimension::Angle(angle) => angle, + _ => { + unreachable!() + } + }; + + let angle = match node.unit.value { + js_word!("deg") => (node.value.value % 360.0 + 360.0) % 360.0, + js_word!("grad") => node.value.value * 180.0 / 200.0, + js_word!("rad") => node.value.value * 180.0 / PI, + js_word!("turn") => node.value.value * 360.0, _ => { return; } @@ -388,44 +389,44 @@ impl VisitMut for LinearGradientFunctionReplacerOnLegacyVariant<'_> { if angle == 0.0 { n.value[0] = ComponentValue::Ident(Ident { - span: *span, + span: node.span, value: js_word!("bottom"), raw: None, }); } else if angle == 90.0 { n.value[0] = ComponentValue::Ident(Ident { - span: *span, + span: node.span, value: js_word!("left"), raw: None, }); } else if angle == 180.0 { n.value[0] = ComponentValue::Ident(Ident { - span: *span, + span: node.span, value: js_word!("top"), raw: None, }); } else if angle == 270.0 { n.value[0] = ComponentValue::Ident(Ident { - span: *span, + span: node.span, value: js_word!("right"), raw: None, }); } else { let new_value = ((450.0 - angle).abs() % 360.0 * 1000.0).round() / 1000.0; - n.value[0] = ComponentValue::Dimension(Dimension::Angle(Angle { - span: *span, + n.value[0] = ComponentValue::Dimension(Box::new(Dimension::Angle(Angle { + span: node.span, value: Number { - span: value.span, + span: node.value.span, value: new_value, raw: None, }, unit: Ident { - span: unit.span, + span: node.unit.span, value: js_word!("deg"), raw: None, }, - })); + }))); } } Some(_) | None => {} @@ -436,7 +437,7 @@ impl VisitMut for LinearGradientFunctionReplacerOnLegacyVariant<'_> { let first_comma_index = n.value.iter().position(|n| { matches!( n, - ComponentValue::Delimiter(Delimiter { + ComponentValue::Delimiter(delimiter) if matches!(&**delimiter, Delimiter { value: DelimiterValue::Comma, .. }) @@ -447,10 +448,10 @@ impl VisitMut for LinearGradientFunctionReplacerOnLegacyVariant<'_> { let mut new_value = vec![]; new_value.append(&mut n.value[at_index + 1..first_comma_index].to_vec()); - new_value.append(&mut vec![ComponentValue::Delimiter(Delimiter { + new_value.append(&mut vec![ComponentValue::Delimiter(Box::new(Delimiter { span: DUMMY_SP, value: DelimiterValue::Comma, - })]); + }))]); new_value.append(&mut n.value[0..at_index].to_vec()); n.value.splice(0..first_comma_index, new_value); @@ -711,9 +712,9 @@ impl VisitMut for Prefixer { if let Some(ComponentValue::Declaration(declaration)) = supports.value.get(0) { conditions.push(SupportsConditionType::SupportsInParens( - SupportsInParens::Feature(SupportsFeature::Declaration(Box::new( + SupportsInParens::Feature(SupportsFeature::Declaration( declaration.clone(), - ))), + )), )); } @@ -732,10 +733,12 @@ impl VisitMut for Prefixer { import_conditions.supports = Some(Box::new(Function { span: supports.span, name: supports.name, - value: vec![ComponentValue::SupportsCondition(SupportsCondition { - span: DUMMY_SP, - conditions, - })], + value: vec![ComponentValue::SupportsCondition(Box::new( + SupportsCondition { + span: DUMMY_SP, + conditions, + }, + ))], })); } } @@ -1774,19 +1777,21 @@ impl VisitMut for Prefixer { value: 0, span, .. })) = value.get(2) { - value[2] = ComponentValue::Dimension(Dimension::Length(Length { - span: *span, - value: Number { - span: DUMMY_SP, - value: 0.0, - raw: None, + value[2] = ComponentValue::Dimension(Box::new(Dimension::Length( + Length { + span: *span, + value: Number { + span: DUMMY_SP, + value: 0.0, + raw: None, + }, + unit: Ident { + span: DUMMY_SP, + value: js_word!("px"), + raw: None, + }, }, - unit: Ident { - span: DUMMY_SP, - value: js_word!("px"), - raw: None, - }, - })); + ))); } value @@ -2161,8 +2166,8 @@ impl VisitMut for Prefixer { "filter" => match &n.value[0] { ComponentValue::PreservedToken(_) => {} - ComponentValue::Function(Function { name, .. }) - if name.value.as_ref().eq_ignore_ascii_case("alpha") => {} + ComponentValue::Function(function) + if function.name.value.as_ref().eq_ignore_ascii_case("alpha") => {} _ => { add_declaration!(Prefix::Webkit, "-webkit-filter", None); } @@ -2326,9 +2331,9 @@ impl VisitMut for Prefixer { add_declaration!(Prefix::Moz, "-moz-transform", None); let has_3d_function = n.value.iter().any(|n| match n { - ComponentValue::Function(Function { name, .. }) + ComponentValue::Function(function) if matches!( - &*name.value.to_ascii_lowercase(), + &*function.name.value.to_ascii_lowercase(), "matrix3d" | "translate3d" | "translatez" From 2b20beacd750590cd8992f53b29f42ec6d02def9 Mon Sep 17 00:00:00 2001 From: "alexander.akait" Date: Sun, 4 Dec 2022 20:36:09 +0300 Subject: [PATCH 15/42] refactor: css modules --- crates/swc_css_modules/src/lib.rs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/crates/swc_css_modules/src/lib.rs b/crates/swc_css_modules/src/lib.rs index a4d7964fa5c8..2a89fb99d3ff 100644 --- a/crates/swc_css_modules/src/lib.rs +++ b/crates/swc_css_modules/src/lib.rs @@ -330,12 +330,16 @@ where ); can_change = false; } - } else if let ComponentValue::Delimiter(Delimiter { - value: DelimiterValue::Comma, - .. - }) = v - { - can_change = true; + } else if let ComponentValue::Delimiter(delimiter) = v { + if matches!( + &**delimiter, + Delimiter { + value: DelimiterValue::Comma, + .. + } + ) { + can_change = true; + } } } } From ae7e4ea24b7e94a2c3dda6d896a79b0e49030548 Mon Sep 17 00:00:00 2001 From: "alexander.akait" Date: Sun, 4 Dec 2022 20:43:36 +0300 Subject: [PATCH 16/42] refactor: lints --- .../rules/font_family_no_duplicate_names.rs | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/crates/swc_css_lints/src/rules/font_family_no_duplicate_names.rs b/crates/swc_css_lints/src/rules/font_family_no_duplicate_names.rs index 423e053250f2..13c8471432aa 100644 --- a/crates/swc_css_lints/src/rules/font_family_no_duplicate_names.rs +++ b/crates/swc_css_lints/src/rules/font_family_no_duplicate_names.rs @@ -56,18 +56,19 @@ impl FontFamilyNoDuplicateNames { (fonts, Some((value.to_string(), *span))) } } - ComponentValue::Str(Str { - raw: Some(raw), - span, - .. - }) => { - fonts.push((FontNameKind::from(raw), *span)); + ComponentValue::Str(str) if str.raw.is_some() => { + fonts.push((FontNameKind::from(str.raw.as_ref().unwrap()), str.span)); (fonts, None) } - ComponentValue::Delimiter(Delimiter { - value: DelimiterValue::Comma, - .. - }) => { + ComponentValue::Delimiter(delimiter) + if matches!( + **delimiter, + Delimiter { + value: DelimiterValue::Comma, + .. + } + ) => + { if let Some((identifier, span)) = last_identifier { fonts.push((FontNameKind::from(identifier), span)); } From bf886236d7c192bedd407d06539ae9bfa05e73c6 Mon Sep 17 00:00:00 2001 From: "alexander.akait" Date: Sun, 4 Dec 2022 21:07:48 +0300 Subject: [PATCH 17/42] refactor: code --- .../src/compressor/alpha_value.rs | 2 +- .../swc_css_minifier/src/compressor/angle.rs | 2 +- .../src/compressor/calc_sum.rs | 4 +- .../swc_css_minifier/src/compressor/color.rs | 30 ++++++------ .../src/compressor/container.rs | 6 +-- .../src/compressor/declaration.rs | 20 ++++---- .../src/compressor/easing_function.rs | 4 +- .../src/compressor/math/mod.rs | 48 +++++++++---------- .../swc_css_minifier/src/compressor/media.rs | 6 +-- .../swc_css_minifier/src/compressor/rules.rs | 2 +- .../src/compressor/transform_function.rs | 16 +++---- 11 files changed, 70 insertions(+), 70 deletions(-) diff --git a/crates/swc_css_minifier/src/compressor/alpha_value.rs b/crates/swc_css_minifier/src/compressor/alpha_value.rs index 1444b468f615..ebb38b1421e7 100644 --- a/crates/swc_css_minifier/src/compressor/alpha_value.rs +++ b/crates/swc_css_minifier/src/compressor/alpha_value.rs @@ -48,7 +48,7 @@ impl Compressor { } match component_value { - ComponentValue::Percentage(Percentage { + ComponentValue::Percentage(box Percentage { span, value: number, }) if number.value % 10.0 == 0.0 => { diff --git a/crates/swc_css_minifier/src/compressor/angle.rs b/crates/swc_css_minifier/src/compressor/angle.rs index e2bf64db8094..fe523fbfa683 100644 --- a/crates/swc_css_minifier/src/compressor/angle.rs +++ b/crates/swc_css_minifier/src/compressor/angle.rs @@ -12,7 +12,7 @@ impl Compressor { ) { if self.ctx.in_transform_function { match &component_value { - ComponentValue::Dimension(Dimension::Angle(Angle { + ComponentValue::Dimension(box Dimension::Angle(Angle { value: Number { value: number_value, diff --git a/crates/swc_css_minifier/src/compressor/calc_sum.rs b/crates/swc_css_minifier/src/compressor/calc_sum.rs index 4386152b5934..77bc5ba1d854 100644 --- a/crates/swc_css_minifier/src/compressor/calc_sum.rs +++ b/crates/swc_css_minifier/src/compressor/calc_sum.rs @@ -977,11 +977,11 @@ impl Compressor { match &component_value { // Transform "calc(calc-sum)" into "simple value" when calc-sum is not a complex // expression - ComponentValue::Function(Function { name, value, .. }) + ComponentValue::Function(box Function { name, value, .. }) if is_calc_function_name(name) && value.len() == 1 => { match &value[0] { - ComponentValue::CalcSum(CalcSum { + ComponentValue::CalcSum(box CalcSum { expressions: calc_sum_expressions, .. }) if calc_sum_expressions.len() == 1 => match &calc_sum_expressions[0] { diff --git a/crates/swc_css_minifier/src/compressor/color.rs b/crates/swc_css_minifier/src/compressor/color.rs index 6119c74227a0..0b41e9452460 100644 --- a/crates/swc_css_minifier/src/compressor/color.rs +++ b/crates/swc_css_minifier/src/compressor/color.rs @@ -167,29 +167,29 @@ macro_rules! make_color { value: r, raw: None, }), - ComponentValue::Delimiter(Delimiter { + ComponentValue::Delimiter(Box::new(Delimiter { span: DUMMY_SP, value: DelimiterValue::Comma, - }), + })), ComponentValue::Number(Number { span: DUMMY_SP, value: g, raw: None, }), - ComponentValue::Delimiter(Delimiter { + ComponentValue::Delimiter(Box::new(Delimiter { span: DUMMY_SP, value: DelimiterValue::Comma, - }), + })), ComponentValue::Number(Number { span: DUMMY_SP, value: b, raw: None, }), - ComponentValue::Delimiter(Delimiter { + ComponentValue::Delimiter(Box::new(Delimiter { span: DUMMY_SP, value: DelimiterValue::Comma, - }), - ComponentValue::AlphaValue(alpha_value), + })), + ComponentValue::AlphaValue(Box::new(alpha_value)), ], })) } @@ -262,7 +262,7 @@ impl Compressor { fn get_alpha_value(&self, alpha_value: Option<&&ComponentValue>) -> Option { match alpha_value { - Some(ComponentValue::AlphaValue(AlphaValue::Number(Number { value, .. }))) => { + Some(ComponentValue::AlphaValue(box AlphaValue::Number(Number { value, .. }))) => { if *value > 1.0 { return Some(1.0); } else if *value < 0.0 { @@ -271,7 +271,7 @@ impl Compressor { Some(*value) } - Some(ComponentValue::AlphaValue(AlphaValue::Percentage(Percentage { + Some(ComponentValue::AlphaValue(box AlphaValue::Percentage(Percentage { value: Number { value, .. }, .. }))) => { @@ -295,7 +295,7 @@ impl Compressor { fn get_hue(&self, hue: Option<&&ComponentValue>) -> Option { match hue { - Some(ComponentValue::Hue(hue)) => { + Some(ComponentValue::Hue(box hue)) => { let mut value = match hue { Hue::Number(Number { value, .. }) => *value, Hue::Angle(Angle { @@ -331,7 +331,7 @@ impl Compressor { fn get_percentage(&self, percentage: Option<&&ComponentValue>) -> Option { match percentage { - Some(ComponentValue::Percentage(Percentage { + Some(ComponentValue::Percentage(box Percentage { value: Number { value, .. }, .. })) => { @@ -366,7 +366,7 @@ impl Compressor { Some(*value) } - Some(ComponentValue::Percentage(Percentage { + Some(ComponentValue::Percentage(box Percentage { value: Number { value, .. }, .. })) => { @@ -435,7 +435,7 @@ impl Compressor { .filter(|n| { !matches!( n, - ComponentValue::Delimiter(Delimiter { + ComponentValue::Delimiter(box Delimiter { value: DelimiterValue::Comma | DelimiterValue::Solidus, .. }) @@ -473,7 +473,7 @@ impl Compressor { .filter(|n| { !matches!( n, - ComponentValue::Delimiter(Delimiter { + ComponentValue::Delimiter(box Delimiter { value: DelimiterValue::Comma | DelimiterValue::Solidus, .. }) @@ -513,7 +513,7 @@ impl Compressor { .filter(|n| { !matches!( n, - ComponentValue::Delimiter(Delimiter { + ComponentValue::Delimiter(box Delimiter { value: DelimiterValue::Comma | DelimiterValue::Solidus, .. }) diff --git a/crates/swc_css_minifier/src/compressor/container.rs b/crates/swc_css_minifier/src/compressor/container.rs index 45e64b331119..8b120335b2b9 100644 --- a/crates/swc_css_minifier/src/compressor/container.rs +++ b/crates/swc_css_minifier/src/compressor/container.rs @@ -10,7 +10,7 @@ impl Compressor { if is_calc_function_name(name) && value.len() == 1 => { match &value[0] { - ComponentValue::CalcSum(CalcSum { + ComponentValue::CalcSum(box CalcSum { expressions: calc_sum_expressions, .. }) if calc_sum_expressions.len() == 1 => match &calc_sum_expressions[0] { @@ -23,10 +23,10 @@ impl Compressor { { match transform_calc_value_into_component_value(calc_value) { Some(ComponentValue::Function(function)) => { - *n = SizeFeatureValue::Function(function); + *n = SizeFeatureValue::Function(*function); } Some(ComponentValue::Dimension(dimension)) => { - *n = SizeFeatureValue::Dimension(dimension); + *n = SizeFeatureValue::Dimension(*dimension); } Some(ComponentValue::Number(number)) => { *n = SizeFeatureValue::Number(number); diff --git a/crates/swc_css_minifier/src/compressor/declaration.rs b/crates/swc_css_minifier/src/compressor/declaration.rs index 06d6fc43bceb..2e2d2f483766 100644 --- a/crates/swc_css_minifier/src/compressor/declaration.rs +++ b/crates/swc_css_minifier/src/compressor/declaration.rs @@ -442,11 +442,11 @@ impl Compressor { raw: None, }) } else { - ComponentValue::Str(Str { + ComponentValue::Str(Box::new(Str { span: ident.span, value: to_be_identify.into(), raw: None, - }) + })) }, ); } @@ -475,11 +475,11 @@ impl Compressor { raw: None, }) } else { - ComponentValue::Str(Str { + ComponentValue::Str(Box::new(Str { span: ident.span, value: to_be_identify.into(), raw: None, - }) + })) } } } @@ -500,12 +500,12 @@ impl Compressor { ) -> bool { match (node_1, node_2) { ( - Some(ComponentValue::Dimension(Dimension::Length(Length { + Some(ComponentValue::Dimension(box Dimension::Length(Length { value: value_1, unit: unit_1, .. }))), - Some(ComponentValue::Dimension(Dimension::Length(Length { + Some(ComponentValue::Dimension(box Dimension::Length(Length { value: value_2, unit: unit_2, .. @@ -540,12 +540,12 @@ impl Compressor { ) -> bool { match (node_1, node_2) { ( - Some(ComponentValue::Dimension(Dimension::Length(Length { + Some(ComponentValue::Dimension(box Dimension::Length(Length { value: value_1, unit: unit_1, .. }))), - Some(ComponentValue::Dimension(Dimension::Length(Length { + Some(ComponentValue::Dimension(box Dimension::Length(Length { value: value_2, unit: unit_2, .. @@ -556,8 +556,8 @@ impl Compressor { true } ( - Some(ComponentValue::Percentage(Percentage { value: value_1, .. })), - Some(ComponentValue::Percentage(Percentage { value: value_2, .. })), + Some(ComponentValue::Percentage(box Percentage { value: value_1, .. })), + Some(ComponentValue::Percentage(box Percentage { value: value_2, .. })), ) if value_1.value == value_2.value => true, ( Some(ComponentValue::Integer(Integer { value: 0, .. })), diff --git a/crates/swc_css_minifier/src/compressor/easing_function.rs b/crates/swc_css_minifier/src/compressor/easing_function.rs index 29da26532bc1..2a4d89fb4db8 100644 --- a/crates/swc_css_minifier/src/compressor/easing_function.rs +++ b/crates/swc_css_minifier/src/compressor/easing_function.rs @@ -6,7 +6,7 @@ use super::Compressor; impl Compressor { pub(super) fn compress_easing_function(&mut self, component_value: &mut ComponentValue) { match component_value { - ComponentValue::Function(Function { + ComponentValue::Function(box Function { name, value: function_value, span, @@ -57,7 +57,7 @@ impl Compressor { } } } - ComponentValue::Function(Function { + ComponentValue::Function(box Function { name, value: function_value, span, diff --git a/crates/swc_css_minifier/src/compressor/math/mod.rs b/crates/swc_css_minifier/src/compressor/math/mod.rs index cb4e31f1bd29..a1ec5f05c098 100644 --- a/crates/swc_css_minifier/src/compressor/math/mod.rs +++ b/crates/swc_css_minifier/src/compressor/math/mod.rs @@ -10,64 +10,64 @@ pub fn is_calc_function_name(ident: &Ident) -> bool { pub fn transform_calc_value_into_component_value(calc_value: &CalcValue) -> Option { match &calc_value { CalcValue::Number(n) => Some(ComponentValue::Number(n.clone())), - CalcValue::Dimension(Dimension::Length(l)) => { - Some(ComponentValue::Dimension(Dimension::Length(Length { + CalcValue::Dimension(Dimension::Length(l)) => Some(ComponentValue::Dimension(Box::new( + Dimension::Length(Length { span: l.span, value: l.value.clone(), unit: l.unit.clone(), - }))) - } - CalcValue::Dimension(Dimension::Angle(a)) => { - Some(ComponentValue::Dimension(Dimension::Angle(Angle { + }), + ))), + CalcValue::Dimension(Dimension::Angle(a)) => Some(ComponentValue::Dimension(Box::new( + Dimension::Angle(Angle { span: a.span, value: a.value.clone(), unit: a.unit.clone(), - }))) - } + }), + ))), CalcValue::Dimension(Dimension::Time(t)) => { - Some(ComponentValue::Dimension(Dimension::Time(Time { + Some(ComponentValue::Dimension(Box::new(Dimension::Time(Time { span: t.span, value: t.value.clone(), unit: t.unit.clone(), - }))) + })))) } - CalcValue::Dimension(Dimension::Frequency(f)) => { - Some(ComponentValue::Dimension(Dimension::Frequency(Frequency { + CalcValue::Dimension(Dimension::Frequency(f)) => Some(ComponentValue::Dimension(Box::new( + Dimension::Frequency(Frequency { span: f.span, value: f.value.clone(), unit: f.unit.clone(), - }))) - } + }), + ))), CalcValue::Dimension(Dimension::Resolution(r)) => Some(ComponentValue::Dimension( - Dimension::Resolution(Resolution { + Box::new(Dimension::Resolution(Resolution { span: r.span, value: r.value.clone(), unit: r.unit.clone(), - }), + })), )), CalcValue::Dimension(Dimension::Flex(f)) => { - Some(ComponentValue::Dimension(Dimension::Flex(Flex { + Some(ComponentValue::Dimension(Box::new(Dimension::Flex(Flex { span: f.span, value: f.value.clone(), unit: f.unit.clone(), - }))) + })))) } CalcValue::Dimension(Dimension::UnknownDimension(u)) => Some(ComponentValue::Dimension( - Dimension::UnknownDimension(UnknownDimension { + Box::new(Dimension::UnknownDimension(UnknownDimension { span: u.span, value: u.value.clone(), unit: u.unit.clone(), - }), + })), )), - CalcValue::Percentage(p) => Some(ComponentValue::Percentage(Percentage { + CalcValue::Percentage(p) => Some(ComponentValue::Percentage(Box::new(Percentage { span: p.span, value: p.value.clone(), - })), - CalcValue::Function(f) => Some(ComponentValue::Function(Function { + }))), + CalcValue::Function(f) => Some(ComponentValue::Function(Box::new(Function { span: f.span, name: f.name.clone(), value: f.value.to_vec(), - })), + }))), CalcValue::Constant(_) => { // https://www.w3.org/TR/css-values-4/#calc-constants // "These keywords are only usable within a calculation" diff --git a/crates/swc_css_minifier/src/compressor/media.rs b/crates/swc_css_minifier/src/compressor/media.rs index 1d9a2d1b9684..d9be9ca0b317 100644 --- a/crates/swc_css_minifier/src/compressor/media.rs +++ b/crates/swc_css_minifier/src/compressor/media.rs @@ -336,7 +336,7 @@ impl Compressor { if is_calc_function_name(name) && value.len() == 1 => { match &value[0] { - ComponentValue::CalcSum(CalcSum { + ComponentValue::CalcSum(box CalcSum { expressions: calc_sum_expressions, .. }) if calc_sum_expressions.len() == 1 => match &calc_sum_expressions[0] { @@ -349,10 +349,10 @@ impl Compressor { { match transform_calc_value_into_component_value(calc_value) { Some(ComponentValue::Function(function)) => { - *n = MediaFeatureValue::Function(function); + *n = MediaFeatureValue::Function(*function); } Some(ComponentValue::Dimension(dimension)) => { - *n = MediaFeatureValue::Dimension(dimension); + *n = MediaFeatureValue::Dimension(*dimension); } Some(ComponentValue::Number(number)) => { *n = MediaFeatureValue::Number(number); diff --git a/crates/swc_css_minifier/src/compressor/rules.rs b/crates/swc_css_minifier/src/compressor/rules.rs index a5a7560b3b62..298afb03eca9 100644 --- a/crates/swc_css_minifier/src/compressor/rules.rs +++ b/crates/swc_css_minifier/src/compressor/rules.rs @@ -467,7 +467,7 @@ impl Compressor { block: Some(block), .. })) - | ComponentValue::KeyframeBlock(KeyframeBlock { block, .. }) + | ComponentValue::KeyframeBlock(box KeyframeBlock { block, .. }) if block.value.is_empty() => { false diff --git a/crates/swc_css_minifier/src/compressor/transform_function.rs b/crates/swc_css_minifier/src/compressor/transform_function.rs index 967ae55573db..0be79214d649 100644 --- a/crates/swc_css_minifier/src/compressor/transform_function.rs +++ b/crates/swc_css_minifier/src/compressor/transform_function.rs @@ -6,7 +6,7 @@ use super::Compressor; impl Compressor { pub(super) fn compress_transform_function(&self, component_value: &mut ComponentValue) { match component_value { - ComponentValue::Function(Function { + ComponentValue::Function(box Function { name, value: function_value, .. @@ -40,7 +40,7 @@ impl Compressor { _ => {} } } - ComponentValue::Function(Function { + ComponentValue::Function(box Function { name, value: function_value, .. @@ -73,7 +73,7 @@ impl Compressor { _ => {} } } - ComponentValue::Function(Function { + ComponentValue::Function(box Function { name, value: function_value, .. @@ -126,7 +126,7 @@ impl Compressor { _ => {} } } - ComponentValue::Function(Function { + ComponentValue::Function(box Function { name, value: function_value, .. @@ -195,7 +195,7 @@ impl Compressor { _ => {} } } - ComponentValue::Function(Function { + ComponentValue::Function(box Function { name, value: function_value, .. @@ -310,7 +310,7 @@ impl Compressor { _ => {} } } - ComponentValue::Function(Function { + ComponentValue::Function(box Function { name, value: function_value, .. @@ -392,7 +392,7 @@ impl Compressor { _ => {} } } - ComponentValue::Function(Function { + ComponentValue::Function(box Function { name, value: function_value, .. @@ -406,7 +406,7 @@ impl Compressor { }; } - ComponentValue::Function(Function { + ComponentValue::Function(box Function { name, value: function_value, .. From 81a4565ef63fd988ca5e994d36337a1c82386926 Mon Sep 17 00:00:00 2001 From: "alexander.akait" Date: Sun, 4 Dec 2022 21:34:37 +0300 Subject: [PATCH 18/42] refactor: fix code --- crates/swc_css_prefixer/src/prefixer.rs | 40 +++++++++++-------------- crates/swc_html_minifier/src/lib.rs | 4 +-- 2 files changed, 20 insertions(+), 24 deletions(-) diff --git a/crates/swc_css_prefixer/src/prefixer.rs b/crates/swc_css_prefixer/src/prefixer.rs index bba5e3651df0..e90ed54365fd 100644 --- a/crates/swc_css_prefixer/src/prefixer.rs +++ b/crates/swc_css_prefixer/src/prefixer.rs @@ -367,21 +367,17 @@ impl VisitMut for LinearGradientFunctionReplacerOnLegacyVariant<'_> { _ => {} } } - Some(ComponentValue::Dimension(dimension)) - if matches!(&**dimension, Dimension::Angle(_)) => - { - let node = match &**dimension { - Dimension::Angle(angle) => angle, - _ => { - unreachable!() - } - }; - - let angle = match node.unit.value { - js_word!("deg") => (node.value.value % 360.0 + 360.0) % 360.0, - js_word!("grad") => node.value.value * 180.0 / 200.0, - js_word!("rad") => node.value.value * 180.0 / PI, - js_word!("turn") => node.value.value * 360.0, + Some(ComponentValue::Dimension(box Dimension::Angle(Angle { + value, + unit, + span, + .. + }))) => { + let angle = match &*unit.value { + "deg" => (value.value % 360.0 + 360.0) % 360.0, + "grad" => value.value * 180.0 / 200.0, + "rad" => value.value * 180.0 / PI, + "turn" => value.value * 360.0, _ => { return; } @@ -389,25 +385,25 @@ impl VisitMut for LinearGradientFunctionReplacerOnLegacyVariant<'_> { if angle == 0.0 { n.value[0] = ComponentValue::Ident(Ident { - span: node.span, + span: *span, value: js_word!("bottom"), raw: None, }); } else if angle == 90.0 { n.value[0] = ComponentValue::Ident(Ident { - span: node.span, + span: *span, value: js_word!("left"), raw: None, }); } else if angle == 180.0 { n.value[0] = ComponentValue::Ident(Ident { - span: node.span, + span: *span, value: js_word!("top"), raw: None, }); } else if angle == 270.0 { n.value[0] = ComponentValue::Ident(Ident { - span: node.span, + span: *span, value: js_word!("right"), raw: None, }); @@ -415,14 +411,14 @@ impl VisitMut for LinearGradientFunctionReplacerOnLegacyVariant<'_> { let new_value = ((450.0 - angle).abs() % 360.0 * 1000.0).round() / 1000.0; n.value[0] = ComponentValue::Dimension(Box::new(Dimension::Angle(Angle { - span: node.span, + span: *span, value: Number { - span: node.value.span, + span: value.span, value: new_value, raw: None, }, unit: Ident { - span: node.unit.span, + span: unit.span, value: js_word!("deg"), raw: None, }, diff --git a/crates/swc_html_minifier/src/lib.rs b/crates/swc_html_minifier/src/lib.rs index ff4c362f7ca9..a6910fcab276 100644 --- a/crates/swc_html_minifier/src/lib.rs +++ b/crates/swc_html_minifier/src/lib.rs @@ -2394,13 +2394,13 @@ impl Minifier<'_> { }, // TODO make the `compress_empty` option for CSS minifier and // remove it - value: vec![swc_css_ast::ComponentValue::Str( + value: vec![swc_css_ast::ComponentValue::Str(Box::new( swc_css_ast::Str { span: Default::default(), value: js_word!("placeholder"), raw: None, }, - )], + ))], }), } .into(), From e2a91fbbf9808e1b88331ac405b59dac676fa8c5 Mon Sep 17 00:00:00 2001 From: "alexander.akait" Date: Sun, 4 Dec 2022 21:47:40 +0300 Subject: [PATCH 19/42] fix: box tokens --- crates/swc_css_ast/src/base.rs | 2 +- crates/swc_css_parser/src/lib.rs | 1 + crates/swc_css_parser/src/parser/input.rs | 2 +- .../swc_css_parser/src/parser/selectors/mod.rs | 6 ++++-- crates/swc_css_parser/src/parser/syntax/mod.rs | 18 +++++++++--------- crates/swc_css_parser/src/parser/util.rs | 14 +++++++------- .../src/parser/values_and_units/mod.rs | 2 +- crates/swc_css_visit/src/lib.rs | 2 +- 8 files changed, 25 insertions(+), 22 deletions(-) diff --git a/crates/swc_css_ast/src/base.rs b/crates/swc_css_ast/src/base.rs index 2db372bfb931..29ee15feb812 100644 --- a/crates/swc_css_ast/src/base.rs +++ b/crates/swc_css_ast/src/base.rs @@ -88,7 +88,7 @@ pub struct ListOfComponentValues { pub enum ComponentValue { // No grammar #[tag("TokenAndSpan")] - PreservedToken(TokenAndSpan), + PreservedToken(Box), #[tag("Function")] Function(Box), #[tag("SimpleBlock")] diff --git a/crates/swc_css_parser/src/lib.rs b/crates/swc_css_parser/src/lib.rs index c026f2302b73..198ca84c0106 100644 --- a/crates/swc_css_parser/src/lib.rs +++ b/crates/swc_css_parser/src/lib.rs @@ -1,3 +1,4 @@ +#![feature(box_patterns)] #![cfg_attr(docsrs, feature(doc_cfg))] #![deny(unused_must_use)] #![deny(clippy::all)] diff --git a/crates/swc_css_parser/src/parser/input.rs b/crates/swc_css_parser/src/parser/input.rs index 4934c6e84e06..3ef45f9a4f0c 100644 --- a/crates/swc_css_parser/src/parser/input.rs +++ b/crates/swc_css_parser/src/parser/input.rs @@ -267,7 +267,7 @@ impl<'a> Input<'a> { match list.get(*index) { Some(ComponentValue::PreservedToken(token_and_span)) => { - Some(TokenOrBlock::Token(Box::new(token_and_span.clone()))) + Some(TokenOrBlock::Token(token_and_span.clone())) } Some(ComponentValue::Function(function)) => { if self.idx.len() - 1 == deep { diff --git a/crates/swc_css_parser/src/parser/selectors/mod.rs b/crates/swc_css_parser/src/parser/selectors/mod.rs index a93ffef6e936..3da7cce95f51 100644 --- a/crates/swc_css_parser/src/parser/selectors/mod.rs +++ b/crates/swc_css_parser/src/parser/selectors/mod.rs @@ -70,7 +70,8 @@ where while !is_one_of!(parser, EOF, ",", ")") { if let Some(token_and_span) = parser.input.bump() { - children.push(ComponentValue::PreservedToken(token_and_span)); + children + .push(ComponentValue::PreservedToken(Box::new(token_and_span))); } } @@ -224,7 +225,8 @@ where while !is_one_of!(parser, EOF, ",", ")") { if let Some(token_and_span) = parser.input.bump() { - children.push(ComponentValue::PreservedToken(token_and_span)); + children + .push(ComponentValue::PreservedToken(Box::new(token_and_span))); } } diff --git a/crates/swc_css_parser/src/parser/syntax/mod.rs b/crates/swc_css_parser/src/parser/syntax/mod.rs index 4bdaabaf8a6c..11fe4b2c66b7 100644 --- a/crates/swc_css_parser/src/parser/syntax/mod.rs +++ b/crates/swc_css_parser/src/parser/syntax/mod.rs @@ -344,7 +344,7 @@ where ); list_of_component_values .children - .push(ComponentValue::PreservedToken(token_and_span)); + .push(ComponentValue::PreservedToken(Box::new(token_and_span))); } } // @@ -494,7 +494,7 @@ where ); list_of_component_values .children - .push(ComponentValue::PreservedToken(token_and_span)); + .push(ComponentValue::PreservedToken(Box::new(token_and_span))); } } // @@ -521,7 +521,7 @@ where let cur = self.input.bump().unwrap(); let mut temporary_list = ListOfComponentValues { span: Default::default(), - children: vec![ComponentValue::PreservedToken(cur)], + children: vec![ComponentValue::PreservedToken(Box::new(cur))], }; while !is_one_of!(self, ";", EOF) { @@ -651,7 +651,7 @@ where match &component_value { // Optimization for step 6 - ComponentValue::PreservedToken(TokenAndSpan { + ComponentValue::PreservedToken(box TokenAndSpan { span, token: Token::Delim { value: '!', .. }, .. @@ -670,7 +670,7 @@ where exclamation_point_span = Some(*span); } - ComponentValue::PreservedToken(TokenAndSpan { + ComponentValue::PreservedToken(box TokenAndSpan { token: Token::WhiteSpace { .. }, .. }) => match (&exclamation_point_span, &important_ident) { @@ -688,7 +688,7 @@ where } }, ComponentValue::PreservedToken( - token_and_span @ TokenAndSpan { + token_and_span @ box TokenAndSpan { token: Token::Ident { value, .. }, .. }, @@ -811,10 +811,10 @@ where } // Otherwise, return the current input token. _ => { - let token = self.input.bump(); + let token_and_span = self.input.bump(); - match token { - Some(t) => Ok(ComponentValue::PreservedToken(t)), + match token_and_span { + Some(t) => Ok(ComponentValue::PreservedToken(Box::new(t))), _ => { unreachable!(); } diff --git a/crates/swc_css_parser/src/parser/util.rs b/crates/swc_css_parser/src/parser/util.rs index 532885502ac6..ff128386f303 100644 --- a/crates/swc_css_parser/src/parser/util.rs +++ b/crates/swc_css_parser/src/parser/util.rs @@ -378,7 +378,7 @@ where component_value: &ComponentValue, ) -> PResult<()> { match component_value { - ComponentValue::PreservedToken(TokenAndSpan { + ComponentValue::PreservedToken(box TokenAndSpan { span, token: Token::BadString { .. }, }) => { @@ -387,7 +387,7 @@ where ErrorKind::Unexpected("bad string in declaration value"), )); } - ComponentValue::PreservedToken(TokenAndSpan { + ComponentValue::PreservedToken(box TokenAndSpan { span, token: Token::BadUrl { .. }, }) => { @@ -396,7 +396,7 @@ where ErrorKind::Unexpected("bad url in declaration value"), )); } - ComponentValue::PreservedToken(TokenAndSpan { + ComponentValue::PreservedToken(box TokenAndSpan { span, token: Token::RParen, }) => { @@ -405,7 +405,7 @@ where ErrorKind::Unexpected("')' in declaration value"), )); } - ComponentValue::PreservedToken(TokenAndSpan { + ComponentValue::PreservedToken(box TokenAndSpan { span, token: Token::RBracket, }) => { @@ -414,7 +414,7 @@ where ErrorKind::Unexpected("']' in declaration value"), )); } - ComponentValue::PreservedToken(TokenAndSpan { + ComponentValue::PreservedToken(box TokenAndSpan { span, token: Token::RBrace, }) => { @@ -423,7 +423,7 @@ where ErrorKind::Unexpected("'}' in declaration value"), )); } - ComponentValue::PreservedToken(TokenAndSpan { + ComponentValue::PreservedToken(box TokenAndSpan { span, token: Token::Semi, }) => { @@ -432,7 +432,7 @@ where ErrorKind::Unexpected("';' in declaration value"), )); } - ComponentValue::PreservedToken(TokenAndSpan { + ComponentValue::PreservedToken(box TokenAndSpan { span, token: Token::Delim { value: '!' }, }) => { diff --git a/crates/swc_css_parser/src/parser/values_and_units/mod.rs b/crates/swc_css_parser/src/parser/values_and_units/mod.rs index 634223da64aa..d816346d07d1 100644 --- a/crates/swc_css_parser/src/parser/values_and_units/mod.rs +++ b/crates/swc_css_parser/src/parser/values_and_units/mod.rs @@ -1642,7 +1642,7 @@ where if is_one_of!(self, ";", ":") { let tok = self.input.bump().unwrap(); - ComponentValue::PreservedToken(tok) + ComponentValue::PreservedToken(Box::new(tok)) } else { return Err(Error::new( self.input.cur_span(), diff --git a/crates/swc_css_visit/src/lib.rs b/crates/swc_css_visit/src/lib.rs index eebf03e04ad7..d5d3de1a0bf3 100644 --- a/crates/swc_css_visit/src/lib.rs +++ b/crates/swc_css_visit/src/lib.rs @@ -23,7 +23,7 @@ define!({ } pub enum ComponentValue { - PreservedToken(TokenAndSpan), + PreservedToken(Box), Function(Box), SimpleBlock(Box), From b7e95f55e066fb2ccd8094fad70aeecf4c84cfae Mon Sep 17 00:00:00 2001 From: "alexander.akait" Date: Sun, 4 Dec 2022 21:59:57 +0300 Subject: [PATCH 20/42] fix: box tokens --- crates/swc_css_ast/src/base.rs | 8 ++-- .../src/parser/values_and_units/mod.rs | 40 +++++++++---------- crates/swc_css_visit/src/lib.rs | 8 ++-- 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/crates/swc_css_ast/src/base.rs b/crates/swc_css_ast/src/base.rs index 29ee15feb812..c3a540077485 100644 --- a/crates/swc_css_ast/src/base.rs +++ b/crates/swc_css_ast/src/base.rs @@ -106,17 +106,17 @@ pub enum ComponentValue { // Arbitrary Contents grammar #[tag("Ident")] - Ident(Ident), + Ident(Box), #[tag("DashedIdent")] - DashedIdent(DashedIdent), + DashedIdent(Box), #[tag("String")] Str(Box), #[tag("Url")] Url(Box), #[tag("Integer")] - Integer(Integer), + Integer(Box), #[tag("Number")] - Number(Number), + Number(Box), #[tag("Percentage")] Percentage(Box), #[tag("Dimension")] diff --git a/crates/swc_css_parser/src/parser/values_and_units/mod.rs b/crates/swc_css_parser/src/parser/values_and_units/mod.rs index d816346d07d1..887958b6d4f9 100644 --- a/crates/swc_css_parser/src/parser/values_and_units/mod.rs +++ b/crates/swc_css_parser/src/parser/values_and_units/mod.rs @@ -405,7 +405,7 @@ where tok!("ident") => { is_legacy_syntax = false; - let ident: Ident = parser.parse()?; + let ident: Box = parser.parse()?; if ident.value.eq_str_ignore_ascii_case("none") { Ok(Some(ComponentValue::Ident(ident))) @@ -446,7 +446,7 @@ where Ok(Some(ComponentValue::Hue(parser.parse()?))) } tok!("ident") => { - let ident: Ident = parser.parse()?; + let ident: Box = parser.parse()?; if ident.value.eq_str_ignore_ascii_case("none") { Ok(Some(ComponentValue::Ident(ident))) @@ -516,7 +516,7 @@ where Ok(Some(ComponentValue::Function(parser.parse()?))) } tok!("ident") if !is_legacy_syntax => { - let ident: Ident = parser.parse()?; + let ident: Box = parser.parse()?; if ident.value.eq_str_ignore_ascii_case("none") { Ok(Some(ComponentValue::Ident(ident))) @@ -560,7 +560,7 @@ where Ok(Some(ComponentValue::Function(parser.parse()?))) } tok!("ident") => { - let ident: Ident = parser.parse()?; + let ident: Box = parser.parse()?; if ident.value.eq_str_ignore_ascii_case("none") { Ok(Some(ComponentValue::Ident(ident))) @@ -632,7 +632,7 @@ where Ok(Some(ComponentValue::Function(parser.parse()?))) } tok!("ident") if !is_legacy_syntax => { - let ident: Ident = parser.parse()?; + let ident: Box = parser.parse()?; if ident.value.eq_str_ignore_ascii_case("none") { Ok(Some(ComponentValue::Ident(ident))) @@ -676,7 +676,7 @@ where Ok(Some(ComponentValue::Function(parser.parse()?))) } tok!("ident") => { - let ident: Ident = parser.parse()?; + let ident: Box = parser.parse()?; if ident.value.eq_str_ignore_ascii_case("none") { Ok(Some(ComponentValue::Ident(ident))) @@ -763,7 +763,7 @@ where Ok(Some(ComponentValue::Function(parser.parse()?))) } tok!("ident") => { - let ident: Ident = parser.parse()?; + let ident: Box = parser.parse()?; if ident.value.eq_str_ignore_ascii_case("none") { Ok(Some(ComponentValue::Ident(ident))) @@ -837,7 +837,7 @@ where Ok(Some(ComponentValue::Function(parser.parse()?))) } tok!("ident") => { - let ident: Ident = parser.parse()?; + let ident: Box = parser.parse()?; if ident.value.eq_str_ignore_ascii_case("none") { Ok(Some(ComponentValue::Ident(ident))) @@ -882,7 +882,7 @@ where Ok(Some(ComponentValue::Function(parser.parse()?))) } tok!("ident") => { - let ident: Ident = parser.parse()?; + let ident: Box = parser.parse()?; if ident.value.eq_str_ignore_ascii_case("none") { Ok(Some(ComponentValue::Ident(ident))) @@ -945,7 +945,7 @@ where Ok(Some(ComponentValue::Function(parser.parse()?))) } tok!("ident") => { - let ident: Ident = parser.parse()?; + let ident: Box = parser.parse()?; if ident.value.eq_str_ignore_ascii_case("none") { Ok(Some(ComponentValue::Ident(ident))) @@ -994,7 +994,7 @@ where Ok(Some(ComponentValue::Function(parser.parse()?))) } tok!("ident") => { - let ident: Ident = parser.parse()?; + let ident: Box = parser.parse()?; if ident.value.eq_str_ignore_ascii_case("none") { Ok(Some(ComponentValue::Ident(ident))) @@ -1062,7 +1062,7 @@ where Ok(Some(ComponentValue::Function(parser.parse()?))) } tok!("ident") => { - let ident: Ident = parser.parse()?; + let ident: Box = parser.parse()?; if ident.value.eq_str_ignore_ascii_case("none") { Ok(Some(ComponentValue::Ident(ident))) @@ -1111,7 +1111,7 @@ where Ok(Some(ComponentValue::Function(parser.parse()?))) } tok!("ident") => { - let ident: Ident = parser.parse()?; + let ident: Box = parser.parse()?; if ident.value.eq_str_ignore_ascii_case("none") { Ok(Some(ComponentValue::Ident(ident))) @@ -1157,7 +1157,7 @@ where Ok(Some(ComponentValue::Function(parser.parse()?))) } tok!("ident") => { - let ident: Ident = parser.parse()?; + let ident: Box = parser.parse()?; if ident.value.eq_str_ignore_ascii_case("none") { Ok(Some(ComponentValue::Ident(ident))) @@ -1240,7 +1240,7 @@ where Ok(Some(ComponentValue::Function(parser.parse()?))) } tok!("ident") if !matches!(function_name, "device-cmyk") => { - let ident: Ident = parser.parse()?; + let ident: Box = parser.parse()?; if ident.value.eq_str_ignore_ascii_case("none") { Ok(Some(ComponentValue::Ident(ident))) @@ -1349,7 +1349,7 @@ where Ok(Some(ComponentValue::Function(parser.parse()?))) } tok!("ident") => { - let ident: Ident = parser.parse()?; + let ident: Box = parser.parse()?; if ident.value.eq_str_ignore_ascii_case("none") { Ok(Some(ComponentValue::Ident(ident))) @@ -1404,7 +1404,7 @@ where ComponentValue::Function(self.parse()?) } tok!("ident") => { - let ident: Ident = self.parse()?; + let ident: Box = self.parse()?; if ident.value.eq_str_ignore_ascii_case("none") { ComponentValue::Ident(ident) @@ -1435,7 +1435,7 @@ where Ok(Some(ComponentValue::Function(parser.parse()?))) } tok!("ident") => { - let ident: Ident = parser.parse()?; + let ident: Box = parser.parse()?; if ident.value.eq_str_ignore_ascii_case("none") { Ok(Some(ComponentValue::Ident(ident))) @@ -1476,7 +1476,7 @@ where Ok(Some(ComponentValue::Percentage(parser.parse()?))) } tok!("ident") => { - let ident: Ident = parser.parse()?; + let ident: Box = parser.parse()?; if ident.value.eq_str_ignore_ascii_case("none") { Ok(Some(ComponentValue::Ident(ident))) @@ -1528,7 +1528,7 @@ where Ok(Some(ComponentValue::Function(parser.parse()?))) } tok!("ident") if !matches!(function_name, "device-cmyk") => { - let ident: Ident = parser.parse()?; + let ident: Box = parser.parse()?; if ident.value.eq_str_ignore_ascii_case("none") { Ok(Some(ComponentValue::Ident(ident))) diff --git a/crates/swc_css_visit/src/lib.rs b/crates/swc_css_visit/src/lib.rs index d5d3de1a0bf3..9b0d7eb50bf8 100644 --- a/crates/swc_css_visit/src/lib.rs +++ b/crates/swc_css_visit/src/lib.rs @@ -32,12 +32,12 @@ define!({ StyleBlock(StyleBlock), KeyframeBlock(Box), - Ident(Ident), - DashedIdent(DashedIdent), + Ident(Box), + DashedIdent(Box), Str(Box), Url(Box), - Integer(Integer), - Number(Number), + Integer(Box), + Number(Box), Percentage(Box), Dimension(Box), Ratio(Box), From 793ce69c0fd48c8842c6697857935c34660eabcb Mon Sep 17 00:00:00 2001 From: "alexander.akait" Date: Sun, 4 Dec 2022 22:04:43 +0300 Subject: [PATCH 21/42] fix: box tokens --- crates/swc_css_ast/src/base.rs | 2 +- .../swc_css_parser/src/parser/at_rules/mod.rs | 38 ++++++++++++------- crates/swc_css_visit/src/lib.rs | 2 +- 3 files changed, 26 insertions(+), 16 deletions(-) diff --git a/crates/swc_css_ast/src/base.rs b/crates/swc_css_ast/src/base.rs index c3a540077485..238d663b83a2 100644 --- a/crates/swc_css_ast/src/base.rs +++ b/crates/swc_css_ast/src/base.rs @@ -98,7 +98,7 @@ pub enum ComponentValue { #[tag("DeclarationOrAtRule")] DeclarationOrAtRule(DeclarationOrAtRule), #[tag("Rule")] - Rule(Rule), + Rule(Box), #[tag("StyleBlock")] StyleBlock(StyleBlock), #[tag("KeyframeBlock")] diff --git a/crates/swc_css_parser/src/parser/at_rules/mod.rs b/crates/swc_css_parser/src/parser/at_rules/mod.rs index d527ae3e0dee..0b3b1b201cb7 100644 --- a/crates/swc_css_parser/src/parser/at_rules/mod.rs +++ b/crates/swc_css_parser/src/parser/at_rules/mod.rs @@ -460,8 +460,10 @@ where ..self.ctx }; let rule_list = self.with_ctx(ctx).parse_as::>()?; - let rule_list: Vec = - rule_list.into_iter().map(ComponentValue::Rule).collect(); + let rule_list: Vec = rule_list + .into_iter() + .map(|node| ComponentValue::Rule(Box::new(node))) + .collect(); rule_list } @@ -493,8 +495,10 @@ where } _ => { let rule_list = self.parse_as::>()?; - let rule_list: Vec = - rule_list.into_iter().map(ComponentValue::Rule).collect(); + let rule_list: Vec = rule_list + .into_iter() + .map(|node| ComponentValue::Rule(Box::new(node))) + .collect(); rule_list } @@ -573,7 +577,7 @@ where ErrorKind::Unexpected("at-rules are not allowed here"), )); - ComponentValue::Rule(Rule::AtRule(at_rule)) + ComponentValue::Rule(Box::new(Rule::AtRule(at_rule))) } Rule::QualifiedRule(qualified_rule) => { let locv = match qualified_rule.prelude { @@ -615,14 +619,14 @@ where Err(err) => { self.errors.push(err); - ComponentValue::Rule(Rule::ListOfComponentValues(Box::new( - locv, + ComponentValue::Rule(Box::new(Rule::ListOfComponentValues( + Box::new(locv), ))) } } } Rule::ListOfComponentValues(locv) => { - ComponentValue::Rule(Rule::ListOfComponentValues(locv)) + ComponentValue::Rule(Box::new(Rule::ListOfComponentValues(locv))) } }) .collect(); @@ -631,8 +635,10 @@ where } js_word!("layer") => { let rule_list = self.parse_as::>()?; - let rule_list: Vec = - rule_list.into_iter().map(ComponentValue::Rule).collect(); + let rule_list: Vec = rule_list + .into_iter() + .map(|node| ComponentValue::Rule(Box::new(node))) + .collect(); rule_list } @@ -648,8 +654,10 @@ where } _ => { let rule_list = self.parse_as::>()?; - let rule_list: Vec = - rule_list.into_iter().map(ComponentValue::Rule).collect(); + let rule_list: Vec = rule_list + .into_iter() + .map(|node| ComponentValue::Rule(Box::new(node))) + .collect(); rule_list } @@ -729,8 +737,10 @@ where } _ => { let rule_list = self.parse_as::>()?; - let rule_list: Vec = - rule_list.into_iter().map(ComponentValue::Rule).collect(); + let rule_list: Vec = rule_list + .into_iter() + .map(|node| ComponentValue::Rule(Box::new(node))) + .collect(); rule_list } diff --git a/crates/swc_css_visit/src/lib.rs b/crates/swc_css_visit/src/lib.rs index 9b0d7eb50bf8..212d684d3093 100644 --- a/crates/swc_css_visit/src/lib.rs +++ b/crates/swc_css_visit/src/lib.rs @@ -28,7 +28,7 @@ define!({ SimpleBlock(Box), DeclarationOrAtRule(DeclarationOrAtRule), - Rule(Rule), + Rule(Box), StyleBlock(StyleBlock), KeyframeBlock(Box), From 853e4aa0556778ed95796aa1a045e71208133229 Mon Sep 17 00:00:00 2001 From: "alexander.akait" Date: Sun, 4 Dec 2022 22:12:14 +0300 Subject: [PATCH 22/42] fix: box tokens --- crates/swc_css_ast/src/base.rs | 4 +-- .../swc_css_parser/src/parser/at_rules/mod.rs | 30 +++++++++---------- crates/swc_css_parser/src/parser/util.rs | 4 +-- crates/swc_css_visit/src/lib.rs | 4 +-- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/crates/swc_css_ast/src/base.rs b/crates/swc_css_ast/src/base.rs index 238d663b83a2..5e4327191c87 100644 --- a/crates/swc_css_ast/src/base.rs +++ b/crates/swc_css_ast/src/base.rs @@ -96,11 +96,11 @@ pub enum ComponentValue { // Block Contents grammar #[tag("DeclarationOrAtRule")] - DeclarationOrAtRule(DeclarationOrAtRule), + DeclarationOrAtRule(Box), #[tag("Rule")] Rule(Box), #[tag("StyleBlock")] - StyleBlock(StyleBlock), + StyleBlock(Box), #[tag("KeyframeBlock")] KeyframeBlock(Box), diff --git a/crates/swc_css_parser/src/parser/at_rules/mod.rs b/crates/swc_css_parser/src/parser/at_rules/mod.rs index 0b3b1b201cb7..a11790188ea2 100644 --- a/crates/swc_css_parser/src/parser/at_rules/mod.rs +++ b/crates/swc_css_parser/src/parser/at_rules/mod.rs @@ -435,7 +435,7 @@ where let declaration_list: Vec = self.parse()?; let declaration_list: Vec = declaration_list .into_iter() - .map(ComponentValue::DeclarationOrAtRule) + .map(|node| ComponentValue::DeclarationOrAtRule(Box::new(node))) .collect(); declaration_list @@ -449,7 +449,7 @@ where let style_blocks = self.with_ctx(ctx).parse_as::>()?; let style_blocks: Vec = style_blocks .into_iter() - .map(ComponentValue::StyleBlock) + .map(|node| ComponentValue::StyleBlock(Box::new(node))) .collect(); style_blocks @@ -472,7 +472,7 @@ where let declaration_list: Vec = self.parse()?; let declaration_list: Vec = declaration_list .into_iter() - .map(ComponentValue::DeclarationOrAtRule) + .map(|node| ComponentValue::DeclarationOrAtRule(Box::new(node))) .collect(); declaration_list @@ -488,7 +488,7 @@ where let style_blocks: Vec = self.parse()?; let style_blocks: Vec = style_blocks .into_iter() - .map(ComponentValue::StyleBlock) + .map(|node| ComponentValue::StyleBlock(Box::new(node))) .collect(); style_blocks @@ -508,7 +508,7 @@ where let declaration_list: Vec = self.parse()?; let declaration_list: Vec = declaration_list .into_iter() - .map(ComponentValue::DeclarationOrAtRule) + .map(|node| ComponentValue::DeclarationOrAtRule(Box::new(node))) .collect(); declaration_list @@ -521,7 +521,7 @@ where let declaration_list = self.with_ctx(ctx).parse_as::>()?; let declaration_list: Vec = declaration_list .into_iter() - .map(ComponentValue::DeclarationOrAtRule) + .map(|node| ComponentValue::DeclarationOrAtRule(Box::new(node))) .collect(); declaration_list @@ -538,7 +538,7 @@ where let declaration_list: Vec = self.parse()?; let declaration_list: Vec = declaration_list .into_iter() - .map(ComponentValue::DeclarationOrAtRule) + .map(|node| ComponentValue::DeclarationOrAtRule(Box::new(node))) .collect(); declaration_list @@ -547,7 +547,7 @@ where let declaration_list: Vec = self.parse()?; let declaration_list: Vec = declaration_list .into_iter() - .map(ComponentValue::DeclarationOrAtRule) + .map(|node| ComponentValue::DeclarationOrAtRule(Box::new(node))) .collect(); declaration_list @@ -647,7 +647,7 @@ where let style_blocks: Vec = self.parse()?; let style_blocks: Vec = style_blocks .into_iter() - .map(ComponentValue::StyleBlock) + .map(|node| ComponentValue::StyleBlock(Box::new(node))) .collect(); style_blocks @@ -671,7 +671,7 @@ where let style_blocks: Vec = self.parse()?; let style_blocks: Vec = style_blocks .into_iter() - .map(ComponentValue::StyleBlock) + .map(|node| ComponentValue::StyleBlock(Box::new(node))) .collect(); style_blocks @@ -685,7 +685,7 @@ where .parse_as::>()?; let declaration_list: Vec = declaration_list .into_iter() - .map(ComponentValue::DeclarationOrAtRule) + .map(|node| ComponentValue::DeclarationOrAtRule(Box::new(node))) .collect(); declaration_list @@ -711,7 +711,7 @@ where let declaration_list: Vec = self.parse()?; let declaration_list: Vec = declaration_list .into_iter() - .map(ComponentValue::DeclarationOrAtRule) + .map(|node| ComponentValue::DeclarationOrAtRule(Box::new(node))) .collect(); declaration_list @@ -720,7 +720,7 @@ where let declaration_list: Vec = self.parse()?; let declaration_list: Vec = declaration_list .into_iter() - .map(ComponentValue::DeclarationOrAtRule) + .map(|node| ComponentValue::DeclarationOrAtRule(Box::new(node))) .collect(); declaration_list @@ -730,7 +730,7 @@ where let style_blocks: Vec = self.parse()?; let style_blocks: Vec = style_blocks .into_iter() - .map(ComponentValue::StyleBlock) + .map(|node| ComponentValue::StyleBlock(Box::new(node))) .collect(); style_blocks @@ -749,7 +749,7 @@ where let declaration_list: Vec = self.parse()?; let declaration_list: Vec = declaration_list .into_iter() - .map(ComponentValue::DeclarationOrAtRule) + .map(|node| ComponentValue::DeclarationOrAtRule(Box::new(node))) .collect(); declaration_list diff --git a/crates/swc_css_parser/src/parser/util.rs b/crates/swc_css_parser/src/parser/util.rs index ff128386f303..61247dfd4ee0 100644 --- a/crates/swc_css_parser/src/parser/util.rs +++ b/crates/swc_css_parser/src/parser/util.rs @@ -241,7 +241,7 @@ where }, )? .into_iter() - .map(ComponentValue::DeclarationOrAtRule) + .map(|node| ComponentValue::DeclarationOrAtRule(Box::new(node))) .collect(), _ => self .parse_according_to_grammar( @@ -256,7 +256,7 @@ where }, )? .into_iter() - .map(ComponentValue::StyleBlock) + .map(|node| ComponentValue::StyleBlock(Box::new(node))) .collect(), }; diff --git a/crates/swc_css_visit/src/lib.rs b/crates/swc_css_visit/src/lib.rs index 212d684d3093..08459fde8ebe 100644 --- a/crates/swc_css_visit/src/lib.rs +++ b/crates/swc_css_visit/src/lib.rs @@ -27,9 +27,9 @@ define!({ Function(Box), SimpleBlock(Box), - DeclarationOrAtRule(DeclarationOrAtRule), + DeclarationOrAtRule(Box), Rule(Box), - StyleBlock(StyleBlock), + StyleBlock(Box), KeyframeBlock(Box), Ident(Box), From a18ed2262afc12e94aa6655f88ac163fa7981e62 Mon Sep 17 00:00:00 2001 From: "alexander.akait" Date: Sun, 4 Dec 2022 22:16:50 +0300 Subject: [PATCH 23/42] fix: codegen --- crates/swc_css_codegen/src/lib.rs | 8 ++++---- crates/swc_css_codegen/tests/fixture.rs | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/crates/swc_css_codegen/src/lib.rs b/crates/swc_css_codegen/src/lib.rs index 435e2a9c1695..2717a10a6963 100644 --- a/crates/swc_css_codegen/src/lib.rs +++ b/crates/swc_css_codegen/src/lib.rs @@ -1355,8 +1355,8 @@ where formatting_newline!(self); decrease_indent!(self); } - ComponentValue::StyleBlock(i) => { - match i { + ComponentValue::StyleBlock(node) => { + match &**node { StyleBlock::AtRule(_) | StyleBlock::QualifiedRule(_) => { formatting_newline!(self); } @@ -1381,8 +1381,8 @@ where decrease_indent!(self); } - ComponentValue::DeclarationOrAtRule(i) => { - match i { + ComponentValue::DeclarationOrAtRule(node) => { + match &**node { DeclarationOrAtRule::AtRule(_) => { formatting_newline!(self); } diff --git a/crates/swc_css_codegen/tests/fixture.rs b/crates/swc_css_codegen/tests/fixture.rs index c0fa305aa557..eeb264a18ef7 100644 --- a/crates/swc_css_codegen/tests/fixture.rs +++ b/crates/swc_css_codegen/tests/fixture.rs @@ -233,12 +233,12 @@ impl VisitMut for NormalizeTest { n.visit_mut_children_with(self); match n { - ComponentValue::Number(Number { value, .. }) if value.fract() == 0.0 => { - *n = ComponentValue::Integer(Integer { + ComponentValue::Number(number) if number.value.fract() == 0.0 => { + *n = ComponentValue::Integer(Box::new(Integer { span: Default::default(), - value: value.round() as i64, + value: number.value.round() as i64, raw: None, - }) + })) } _ => {} } From 5d3c0ab1e0135f7f7ee2368cc6593ef0c650f13f Mon Sep 17 00:00:00 2001 From: "alexander.akait" Date: Sun, 4 Dec 2022 22:38:15 +0300 Subject: [PATCH 24/42] fix: codegen --- crates/swc_css_prefixer/src/prefixer.rs | 225 ++++++++++++------------ 1 file changed, 116 insertions(+), 109 deletions(-) diff --git a/crates/swc_css_prefixer/src/prefixer.rs b/crates/swc_css_prefixer/src/prefixer.rs index e90ed54365fd..e2ab9db30a7d 100644 --- a/crates/swc_css_prefixer/src/prefixer.rs +++ b/crates/swc_css_prefixer/src/prefixer.rs @@ -154,19 +154,19 @@ impl VisitMut for CrossFadeFunctionReplacerOnLegacyVariant<'_> { transparency_value = Some(percentage.value.value / 100.0); } - ComponentValue::Number(Number { value, .. }) => { + ComponentValue::Number(number) => { if transparency_value.is_some() { return; } - transparency_value = Some(*value); + transparency_value = Some(number.value); } - ComponentValue::Integer(Integer { value, .. }) => { + ComponentValue::Integer(integer) => { if transparency_value.is_some() { return; } - transparency_value = Some((*value) as f64); + transparency_value = Some((integer.value) as f64); } _ => {} } @@ -208,11 +208,11 @@ impl VisitMut for CrossFadeFunctionReplacerOnLegacyVariant<'_> { span: DUMMY_SP, value: DelimiterValue::Comma, })), - ComponentValue::Number(Number { + ComponentValue::Number(Box::new(Number { span: DUMMY_SP, value: transparency_value, raw: None, - }), + })), ]); n.value = new_value; @@ -307,8 +307,8 @@ impl VisitMut for LinearGradientFunctionReplacerOnLegacyVariant<'_> { let first = n.value.get(0); match first { - Some(ComponentValue::Ident(Ident { value, .. })) - if value.as_ref().eq_ignore_ascii_case("to") => + Some(ComponentValue::Ident(ident)) + if ident.value.as_ref().eq_ignore_ascii_case("to") => { fn get_old_direction(direction: &str) -> Option<&str> { match direction { @@ -322,12 +322,12 @@ impl VisitMut for LinearGradientFunctionReplacerOnLegacyVariant<'_> { match (n.value.get(1), n.value.get(2)) { ( - Some(ComponentValue::Ident(Ident { + Some(ComponentValue::Ident(box Ident { value: first_value, span: first_span, .. })), - Some(ComponentValue::Ident(Ident { + Some(ComponentValue::Ident(box Ident { value: second_value, span: second_span, .. @@ -338,28 +338,28 @@ impl VisitMut for LinearGradientFunctionReplacerOnLegacyVariant<'_> { get_old_direction(second_value), ) { let new_value = vec![ - ComponentValue::Ident(Ident { + ComponentValue::Ident(Box::new(Ident { span: *first_span, value: new_first_direction.into(), raw: None, - }), - ComponentValue::Ident(Ident { + })), + ComponentValue::Ident(Box::new(Ident { span: *second_span, value: new_second_direction.into(), raw: None, - }), + })), ]; n.value.splice(0..3, new_value); } } - (Some(ComponentValue::Ident(Ident { value, span, .. })), Some(_)) => { + (Some(ComponentValue::Ident(box Ident { value, span, .. })), Some(_)) => { if let Some(new_direction) = get_old_direction(value) { - let new_value = vec![ComponentValue::Ident(Ident { + let new_value = vec![ComponentValue::Ident(Box::new(Ident { span: *span, value: new_direction.into(), raw: None, - })]; + }))]; n.value.splice(0..2, new_value); } @@ -384,29 +384,29 @@ impl VisitMut for LinearGradientFunctionReplacerOnLegacyVariant<'_> { }; if angle == 0.0 { - n.value[0] = ComponentValue::Ident(Ident { + n.value[0] = ComponentValue::Ident(Box::new(Ident { span: *span, value: js_word!("bottom"), raw: None, - }); + })); } else if angle == 90.0 { - n.value[0] = ComponentValue::Ident(Ident { + n.value[0] = ComponentValue::Ident(Box::new(Ident { span: *span, value: js_word!("left"), raw: None, - }); + })); } else if angle == 180.0 { - n.value[0] = ComponentValue::Ident(Ident { + n.value[0] = ComponentValue::Ident(Box::new(Ident { span: *span, value: js_word!("top"), raw: None, - }); + })); } else if angle == 270.0 { - n.value[0] = ComponentValue::Ident(Ident { + n.value[0] = ComponentValue::Ident(Box::new(Ident { span: *span, value: js_word!("right"), raw: None, - }); + })); } else { let new_value = ((450.0 - angle).abs() % 360.0 * 1000.0).round() / 1000.0; @@ -429,7 +429,7 @@ impl VisitMut for LinearGradientFunctionReplacerOnLegacyVariant<'_> { } if matches!(self.from, "radial-gradient" | "repeating-radial-gradient") { - let at_index = n.value.iter().position(|n| matches!(n, ComponentValue::Ident(Ident { value, .. }) if value.as_ref().eq_ignore_ascii_case("at"))); + let at_index = n.value.iter().position(|n| matches!(n, ComponentValue::Ident(box Ident { value, .. }) if value.as_ref().eq_ignore_ascii_case("at"))); let first_comma_index = n.value.iter().position(|n| { matches!( n, @@ -517,21 +517,21 @@ where macro_rules! to_ident { ($val:expr) => {{ - ComponentValue::Ident(Ident { + ComponentValue::Ident(Box::new(Ident { span: DUMMY_SP, value: $val.into(), raw: None, - }) + })) }}; } macro_rules! to_integer { ($val:expr) => {{ - ComponentValue::Integer(Integer { + ComponentValue::Integer(Box::new(Integer { span: DUMMY_SP, value: $val, raw: None, - }) + })) }}; } @@ -1133,12 +1133,9 @@ impl VisitMut for Prefixer { match n { ComponentValue::DeclarationOrAtRule(_) => { - new.extend( - self.added_declarations - .drain(..) - .map(StyleBlock::Declaration) - .map(ComponentValue::StyleBlock), - ); + new.extend(self.added_declarations.drain(..).map(|node| { + ComponentValue::StyleBlock(Box::new(StyleBlock::Declaration(node))) + })); for mut n in take(&mut self.added_at_rules) { let old_rule_prefix = self.rule_prefix.take(); @@ -1147,7 +1144,9 @@ impl VisitMut for Prefixer { n.1.visit_mut_children_with(self); - new.push(ComponentValue::StyleBlock(StyleBlock::AtRule(n.1))); + new.push(ComponentValue::StyleBlock(Box::new(StyleBlock::AtRule( + n.1, + )))); self.rule_prefix = old_rule_prefix; } @@ -1160,7 +1159,9 @@ impl VisitMut for Prefixer { n.1.visit_mut_children_with(self); - new.push(ComponentValue::StyleBlock(StyleBlock::QualifiedRule(n.1))); + new.push(ComponentValue::StyleBlock(Box::new( + StyleBlock::QualifiedRule(n.1), + ))); self.rule_prefix = old_rule_prefix; } @@ -1172,18 +1173,17 @@ impl VisitMut for Prefixer { n.1.visit_mut_children_with(self); - new.push(ComponentValue::StyleBlock(StyleBlock::AtRule(n.1))); + new.push(ComponentValue::StyleBlock(Box::new(StyleBlock::AtRule( + n.1, + )))); self.rule_prefix = old_rule_prefix; } } ComponentValue::StyleBlock(_) => { - new.extend( - self.added_declarations - .drain(..) - .map(StyleBlock::Declaration) - .map(ComponentValue::StyleBlock), - ); + new.extend(self.added_declarations.drain(..).map(|node| { + ComponentValue::StyleBlock(Box::new(StyleBlock::Declaration(node))) + })); for mut n in take(&mut self.added_qualified_rules) { let old_rule_prefix = self.rule_prefix.take(); @@ -1192,7 +1192,9 @@ impl VisitMut for Prefixer { n.1.visit_mut_children_with(self); - new.push(ComponentValue::StyleBlock(StyleBlock::QualifiedRule(n.1))); + new.push(ComponentValue::StyleBlock(Box::new( + StyleBlock::QualifiedRule(n.1), + ))); self.rule_prefix = old_rule_prefix; } @@ -1204,7 +1206,9 @@ impl VisitMut for Prefixer { n.1.visit_mut_children_with(self); - new.push(ComponentValue::StyleBlock(StyleBlock::AtRule(n.1))); + new.push(ComponentValue::StyleBlock(Box::new(StyleBlock::AtRule( + n.1, + )))); self.rule_prefix = old_rule_prefix; } @@ -1392,12 +1396,12 @@ impl VisitMut for Prefixer { for n in simple_block.value.iter() { match n { - ComponentValue::DeclarationOrAtRule(DeclarationOrAtRule::Declaration( - declaration, - )) => { + ComponentValue::DeclarationOrAtRule( + box DeclarationOrAtRule::Declaration(declaration), + ) => { declarations.push(declaration); } - ComponentValue::StyleBlock(StyleBlock::Declaration(declaration)) => { + ComponentValue::StyleBlock(box StyleBlock::Declaration(declaration)) => { declarations.push(declaration); } _ => {} @@ -1479,9 +1483,10 @@ impl VisitMut for Prefixer { "animation" => { let need_prefix = n.value.iter().all(|n| match n { - ComponentValue::Ident(Ident { value, .. }) => { - !matches!(&*value.to_lowercase(), "reverse" | "alternate-reverse") - } + ComponentValue::Ident(ident) => !matches!( + &*ident.value.to_lowercase(), + "reverse" | "alternate-reverse" + ), _ => true, }); @@ -1511,8 +1516,8 @@ impl VisitMut for Prefixer { } "animation-direction" => { - if let ComponentValue::Ident(Ident { value, .. }) = &n.value[0] { - match &*value.to_lowercase() { + if let ComponentValue::Ident(ident) = &n.value[0] { + match &*ident.value.to_lowercase() { "alternate-reverse" | "reverse" => {} _ => { add_declaration!(Prefix::Webkit, "-webkit-animation-direction", None); @@ -1548,8 +1553,8 @@ impl VisitMut for Prefixer { } "background-clip" => { - if let ComponentValue::Ident(Ident { value, .. }) = &n.value[0] { - if &*value.to_lowercase() == "text" { + if let ComponentValue::Ident(ident) = &n.value[0] { + if &*ident.value.to_lowercase() == "text" { add_declaration!(Prefix::Webkit, "-webkit-background-clip", None); } } @@ -1718,23 +1723,23 @@ impl VisitMut for Prefixer { "flex" => { let spec_2009_value = match n.value.get(0) { - Some(ComponentValue::Ident(Ident { value, span, .. })) - if value.as_ref().eq_ignore_ascii_case("none") => + Some(ComponentValue::Ident(ident)) + if ident.value.as_ref().eq_ignore_ascii_case("none") => { - Some(ComponentValue::Integer(Integer { - span: *span, + Some(ComponentValue::Integer(Box::new(Integer { + span: ident.span, value: 0, raw: None, - })) + }))) } - Some(ComponentValue::Ident(Ident { value, span, .. })) - if value.as_ref().eq_ignore_ascii_case("auto") => + Some(ComponentValue::Ident(ident)) + if ident.value.as_ref().eq_ignore_ascii_case("auto") => { - Some(ComponentValue::Integer(Integer { - span: *span, + Some(ComponentValue::Integer(Box::new(Integer { + span: ident.span, value: 1, raw: None, - })) + }))) } Some(any) => Some(any.clone()), None => None, @@ -1769,8 +1774,10 @@ impl VisitMut for Prefixer { Some(Box::new(|| { let mut value = ms_value.clone(); - if let Some(ComponentValue::Integer(Integer { - value: 0, span, .. + if let Some(ComponentValue::Integer(box Integer { + value: 0, + span, + .. })) = value.get(2) { value[2] = ComponentValue::Dimension(Box::new(Dimension::Length( @@ -1817,23 +1824,23 @@ impl VisitMut for Prefixer { "flex-direction" => { let old_values = match n.value.get(0) { - Some(ComponentValue::Ident(Ident { value, .. })) - if value.as_ref().eq_ignore_ascii_case("row") => + Some(ComponentValue::Ident(ident)) + if ident.value.as_ref().eq_ignore_ascii_case("row") => { Some(("horizontal", "normal")) } - Some(ComponentValue::Ident(Ident { value, .. })) - if value.as_ref().eq_ignore_ascii_case("column") => + Some(ComponentValue::Ident(ident)) + if ident.value.as_ref().eq_ignore_ascii_case("column") => { Some(("vertical", "normal")) } - Some(ComponentValue::Ident(Ident { value, .. })) - if value.as_ref().eq_ignore_ascii_case("row-reverse") => + Some(ComponentValue::Ident(ident)) + if ident.value.as_ref().eq_ignore_ascii_case("row-reverse") => { Some(("horizontal", "reverse")) } - Some(ComponentValue::Ident(Ident { value, .. })) - if value.as_ref().eq_ignore_ascii_case("column-reverse") => + Some(ComponentValue::Ident(ident)) + if ident.value.as_ref().eq_ignore_ascii_case("column-reverse") => { Some(("vertical", "reverse")) } @@ -1877,7 +1884,7 @@ impl VisitMut for Prefixer { } "flex-flow" => { - let is_single_flex_wrap = matches!(n.value.get(0), Some(ComponentValue::Ident(Ident { value, .. })) if n.value.len() == 1 + let is_single_flex_wrap = matches!(n.value.get(0), Some(ComponentValue::Ident(box Ident { value, .. })) if n.value.len() == 1 && matches!( &*value.to_lowercase(), "wrap" | "nowrap" | "wrap-reverse" @@ -1887,23 +1894,23 @@ impl VisitMut for Prefixer { true => None, _ => { let get_old_values = |index: usize| match n.value.get(index) { - Some(ComponentValue::Ident(Ident { value, .. })) - if value.as_ref().eq_ignore_ascii_case("row") => + Some(ComponentValue::Ident(ident)) + if ident.value.as_ref().eq_ignore_ascii_case("row") => { Some(("horizontal", "normal")) } - Some(ComponentValue::Ident(Ident { value, .. })) - if value.as_ref().eq_ignore_ascii_case("column") => + Some(ComponentValue::Ident(ident)) + if ident.value.as_ref().eq_ignore_ascii_case("column") => { Some(("vertical", "normal")) } - Some(ComponentValue::Ident(Ident { value, .. })) - if value.as_ref().eq_ignore_ascii_case("row-reverse") => + Some(ComponentValue::Ident(ident)) + if ident.value.as_ref().eq_ignore_ascii_case("row-reverse") => { Some(("horizontal", "reverse")) } - Some(ComponentValue::Ident(Ident { value, .. })) - if value.as_ref().eq_ignore_ascii_case("column-reverse") => + Some(ComponentValue::Ident(ident)) + if ident.value.as_ref().eq_ignore_ascii_case("column-reverse") => { Some(("vertical", "reverse")) } @@ -1946,7 +1953,7 @@ impl VisitMut for Prefixer { } "justify-content" => { - let need_old_spec = !matches!(n.value.get(0), Some(ComponentValue::Ident(Ident { value, .. })) if value.as_ref().eq_ignore_ascii_case("space-around")); + let need_old_spec = !matches!(n.value.get(0), Some(ComponentValue::Ident(box Ident { value, .. })) if value.as_ref().eq_ignore_ascii_case("space-around")); if need_old_spec { add_declaration!( @@ -2004,7 +2011,7 @@ impl VisitMut for Prefixer { "order" => { let old_spec_num = match n.value.get(0) { - Some(ComponentValue::Integer(Integer { value, .. })) => Some(value + 1), + Some(ComponentValue::Integer(integer)) => Some(integer.value + 1), _ => None, }; @@ -2305,8 +2312,8 @@ impl VisitMut for Prefixer { add_declaration!(Prefix::Webkit, "-webkit-user-select", None); add_declaration!(Prefix::Moz, "-moz-user-select", None); - if let ComponentValue::Ident(Ident { value, .. }) = &n.value[0] { - match &*value.to_lowercase() { + if let ComponentValue::Ident(ident) = &n.value[0] { + match &*ident.value.to_lowercase() { "contain" => { add_declaration!( Prefix::Ms, @@ -2385,9 +2392,9 @@ impl VisitMut for Prefixer { "text-decoration" => { if n.value.len() == 1 { match &n.value[0] { - ComponentValue::Ident(Ident { value, .. }) + ComponentValue::Ident(ident) if matches!( - &*value.to_lowercase(), + &*ident.value.to_lowercase(), "none" | "underline" | "overline" @@ -2429,8 +2436,8 @@ impl VisitMut for Prefixer { } "text-decoration-skip-ink" => { - if let ComponentValue::Ident(Ident { value, .. }) = &n.value[0] { - match &*value.to_lowercase() { + if let ComponentValue::Ident(ident) = &n.value[0] { + match &*ident.value.to_lowercase() { "auto" => { add_declaration!( Prefix::Webkit, @@ -2450,8 +2457,8 @@ impl VisitMut for Prefixer { } "text-size-adjust" if n.value.len() == 1 => { - if let ComponentValue::Ident(Ident { value, .. }) = &n.value[0] { - if &*value.to_lowercase() == "none" { + if let ComponentValue::Ident(ident) = &n.value[0] { + if &*ident.value.to_lowercase() == "none" { add_declaration!(Prefix::Webkit, "-webkit-text-size-adjust", None); add_declaration!(Prefix::Moz, "-moz-text-size-adjust", None); add_declaration!(Prefix::Ms, "-ms-text-size-adjust", None); @@ -2547,8 +2554,8 @@ impl VisitMut for Prefixer { } if value.as_ref().eq_ignore_ascii_case("direction")) }) { Some(box Declaration { value, .. }) => match value.get(0) { - Some(ComponentValue::Ident(Ident { value, .. })) - if value.as_ref().eq_ignore_ascii_case("rtl") => + Some(ComponentValue::Ident(ident)) + if ident.value.as_ref().eq_ignore_ascii_case("rtl") => { Some("rtl") } @@ -2557,8 +2564,8 @@ impl VisitMut for Prefixer { _ => Some("ltr"), }; - if let ComponentValue::Ident(Ident { value, .. }) = &n.value[0] { - match &*value.to_lowercase() { + if let ComponentValue::Ident(ident) = &n.value[0] { + match &*ident.value.to_lowercase() { "vertical-lr" => { add_declaration!(Prefix::Webkit, "-webkit-writing-mode", None); @@ -2927,8 +2934,8 @@ impl VisitMut for Prefixer { } "overscroll-behavior" => { - if let ComponentValue::Ident(Ident { value, .. }) = &n.value[0] { - match &*value.to_lowercase() { + if let ComponentValue::Ident(ident) = &n.value[0] { + match &*ident.value.to_lowercase() { "auto" => { add_declaration!( Prefix::Ms, @@ -2962,8 +2969,8 @@ impl VisitMut for Prefixer { } "break-inside" => { - if let ComponentValue::Ident(Ident { value, .. }) = &n.value[0] { - match &*value.to_lowercase() { + if let ComponentValue::Ident(ident) = &n.value[0] { + match &*ident.value.to_lowercase() { "auto" | "avoid" => { add_declaration!(Prefix::Webkit, "-webkit-column-break-inside", None); } @@ -2973,8 +2980,8 @@ impl VisitMut for Prefixer { } "break-before" => { - if let ComponentValue::Ident(Ident { value, .. }) = &n.value[0] { - match &*value.to_lowercase() { + if let ComponentValue::Ident(ident) = &n.value[0] { + match &*ident.value.to_lowercase() { "auto" | "avoid" => { add_declaration!(Prefix::Webkit, "-webkit-column-break-before", None); } @@ -2991,8 +2998,8 @@ impl VisitMut for Prefixer { } "break-after" => { - if let ComponentValue::Ident(Ident { value, .. }) = &n.value[0] { - match &*value.to_lowercase() { + if let ComponentValue::Ident(ident) = &n.value[0] { + match &*ident.value.to_lowercase() { "auto" | "avoid" => { add_declaration!(Prefix::Webkit, "-webkit-column-break-after", None); } From a4d919f233c19f8e37d4a99d1bc4fa7346c5d943 Mon Sep 17 00:00:00 2001 From: "alexander.akait" Date: Sun, 4 Dec 2022 22:45:48 +0300 Subject: [PATCH 25/42] fix: code --- crates/swc_css_compat/src/lib.rs | 1 + crates/swc_css_compat/src/nesting.rs | 26 +++++++++++------ .../rules/font_family_no_duplicate_names.rs | 2 +- .../src/rules/unit_no_unknown.rs | 2 +- crates/swc_css_modules/src/imports.rs | 4 +-- crates/swc_css_modules/src/lib.rs | 28 +++++++++++-------- 6 files changed, 39 insertions(+), 24 deletions(-) diff --git a/crates/swc_css_compat/src/lib.rs b/crates/swc_css_compat/src/lib.rs index 3e9f0997d54b..485214058c30 100644 --- a/crates/swc_css_compat/src/lib.rs +++ b/crates/swc_css_compat/src/lib.rs @@ -1,3 +1,4 @@ +#![feature(box_patterns)] #![allow(clippy::vec_box)] pub mod nesting; diff --git a/crates/swc_css_compat/src/nesting.rs b/crates/swc_css_compat/src/nesting.rs index 45c09b1659b5..c5b79a172da4 100644 --- a/crates/swc_css_compat/src/nesting.rs +++ b/crates/swc_css_compat/src/nesting.rs @@ -231,14 +231,14 @@ impl NestingHandler { for value in rule.block.value.take() { match value { - ComponentValue::StyleBlock(StyleBlock::QualifiedRule(mut nested)) => { + ComponentValue::StyleBlock(box StyleBlock::QualifiedRule(mut nested)) => { self.process_prelude(&rule.prelude, &mut nested.prelude); nested_rules.push(Rule::QualifiedRule(nested)); continue; } - ComponentValue::StyleBlock(StyleBlock::AtRule(ref at_rule)) => { + ComponentValue::StyleBlock(box StyleBlock::AtRule(ref at_rule)) => { if let Some( AtRulePrelude::MediaPrelude(..) | AtRulePrelude::SupportsPrelude(..) @@ -252,7 +252,9 @@ impl NestingHandler { for n in &block.value { match n { - ComponentValue::StyleBlock(StyleBlock::QualifiedRule(n)) => { + ComponentValue::StyleBlock(box StyleBlock::QualifiedRule( + n, + )) => { let mut q = n.clone(); self.process_prelude(&rule.prelude, &mut q.prelude); @@ -284,7 +286,9 @@ impl NestingHandler { nested_of_media.insert( 0, - ComponentValue::StyleBlock(StyleBlock::QualifiedRule(rule)), + ComponentValue::StyleBlock(Box::new( + StyleBlock::QualifiedRule(rule), + )), ); } @@ -340,12 +344,14 @@ impl VisitMut for NestingHandler { for n in n.take() { match n { - ComponentValue::StyleBlock(StyleBlock::QualifiedRule(mut n)) => { + ComponentValue::StyleBlock(box StyleBlock::QualifiedRule(mut n)) => { let mut rules = self.extract_nested_rules(&mut n); rules.visit_mut_with(self); - new.push(ComponentValue::StyleBlock(StyleBlock::QualifiedRule(n))); + new.push(ComponentValue::StyleBlock(Box::new( + StyleBlock::QualifiedRule(n), + ))); new.extend(rules.into_iter().map(rule_to_component_value)); } @@ -361,8 +367,10 @@ impl VisitMut for NestingHandler { fn rule_to_component_value(rule: Rule) -> ComponentValue { match rule { - Rule::QualifiedRule(q) => ComponentValue::StyleBlock(StyleBlock::QualifiedRule(q)), - Rule::AtRule(r) => ComponentValue::StyleBlock(StyleBlock::AtRule(r)), - Rule::ListOfComponentValues(..) => ComponentValue::Rule(rule), + Rule::QualifiedRule(q) => { + ComponentValue::StyleBlock(Box::new(StyleBlock::QualifiedRule(q))) + } + Rule::AtRule(r) => ComponentValue::StyleBlock(Box::new(StyleBlock::AtRule(r))), + Rule::ListOfComponentValues(..) => ComponentValue::Rule(Box::new(rule)), } } diff --git a/crates/swc_css_lints/src/rules/font_family_no_duplicate_names.rs b/crates/swc_css_lints/src/rules/font_family_no_duplicate_names.rs index 13c8471432aa..15c0c9c0b3d9 100644 --- a/crates/swc_css_lints/src/rules/font_family_no_duplicate_names.rs +++ b/crates/swc_css_lints/src/rules/font_family_no_duplicate_names.rs @@ -47,7 +47,7 @@ impl FontFamilyNoDuplicateNames { Option::<(String, Span)>::None, ), |(mut fonts, last_identifier), item| match item { - ComponentValue::Ident(Ident { value, span, .. }) => { + ComponentValue::Ident(box Ident { value, span, .. }) => { if let Some((mut identifier, last_span)) = last_identifier { identifier.push(' '); identifier.push_str(value); diff --git a/crates/swc_css_lints/src/rules/unit_no_unknown.rs b/crates/swc_css_lints/src/rules/unit_no_unknown.rs index 1c8d2594a3e3..1d9a909452fd 100644 --- a/crates/swc_css_lints/src/rules/unit_no_unknown.rs +++ b/crates/swc_css_lints/src/rules/unit_no_unknown.rs @@ -51,7 +51,7 @@ impl Visit for UnitNoUnknown { fn visit_component_value(&mut self, component_value: &ComponentValue) { if let ComponentValue::PreservedToken( - token_and_span @ TokenAndSpan { + token_and_span @ box TokenAndSpan { token: Token::Dimension { unit, .. }, .. }, diff --git a/crates/swc_css_modules/src/imports.rs b/crates/swc_css_modules/src/imports.rs index 6a90d04eeb3f..f7caa2c8377a 100644 --- a/crates/swc_css_modules/src/imports.rs +++ b/crates/swc_css_modules/src/imports.rs @@ -49,10 +49,10 @@ impl Visit for Analyzer { if let DeclarationName::Ident(name) = &d.name { if &*name.value == "composes" { - // comoses: name from 'foo.css' + // composes: name from 'foo.css' if d.value.len() >= 3 { if let ( - ComponentValue::Ident(Ident { + ComponentValue::Ident(box Ident { value: js_word!("from"), .. }), diff --git a/crates/swc_css_modules/src/lib.rs b/crates/swc_css_modules/src/lib.rs index 2a89fb99d3ff..8cebe35f19c2 100644 --- a/crates/swc_css_modules/src/lib.rs +++ b/crates/swc_css_modules/src/lib.rs @@ -1,3 +1,5 @@ +#![feature(box_patterns)] + use rustc_hash::FxHashMap; use serde::Serialize; use swc_atoms::{js_word, JsWord}; @@ -233,8 +235,8 @@ where n.visit_mut_children_with(self); n.retain(|v| match v { - ComponentValue::StyleBlock(StyleBlock::Declaration(d)) - | ComponentValue::DeclarationOrAtRule(DeclarationOrAtRule::Declaration(d)) => { + ComponentValue::StyleBlock(box StyleBlock::Declaration(d)) + | ComponentValue::DeclarationOrAtRule(box DeclarationOrAtRule::Declaration(d)) => { if let DeclarationName::Ident(ident) = &d.name { if &*ident.value == "composes" { return false; @@ -254,18 +256,20 @@ where if let Some(composes_for_current) = &mut self.data.composes_for_current { if let DeclarationName::Ident(name) = &n.name { if &*name.value == "composes" { - // comoses: name from 'foo.css' + // composes: name from 'foo.css' if n.value.len() >= 3 { match (&n.value[n.value.len() - 2], &n.value[n.value.len() - 1]) { ( - ComponentValue::Ident(Ident { + ComponentValue::Ident(box Ident { value: js_word!("from"), .. }), ComponentValue::Str(import_source), ) => { for class_name in n.value.iter().take(n.value.len() - 2) { - if let ComponentValue::Ident(Ident { value, .. }) = class_name { + if let ComponentValue::Ident(box Ident { value, .. }) = + class_name + { composes_for_current.push(CssClassName::Import { name: value.clone(), from: import_source.value.clone(), @@ -276,17 +280,19 @@ where return; } ( - ComponentValue::Ident(Ident { + ComponentValue::Ident(box Ident { value: js_word!("from"), .. }), - ComponentValue::Ident(Ident { + ComponentValue::Ident(box Ident { value: js_word!("global"), .. }), ) => { for class_name in n.value.iter().take(n.value.len() - 2) { - if let ComponentValue::Ident(Ident { value, .. }) = class_name { + if let ComponentValue::Ident(box Ident { value, .. }) = + class_name + { composes_for_current.push(CssClassName::Global { name: value.clone(), }); @@ -299,7 +305,7 @@ where } for class_name in n.value.iter() { - if let ComponentValue::Ident(Ident { value, .. }) = class_name { + if let ComponentValue::Ident(box Ident { value, .. }) = class_name { if let Some(value) = self.data.orig_to_renamed.get(value) { composes_for_current.push(CssClassName::Local { name: value.clone(), @@ -318,7 +324,7 @@ where for v in &mut n.value { if can_change { - if let ComponentValue::Ident(Ident { value, raw, .. }) = v { + if let ComponentValue::Ident(box Ident { value, raw, .. }) = v { *raw = None; rename( @@ -345,7 +351,7 @@ where } js_word!("animation-name") => { for v in &mut n.value { - if let ComponentValue::Ident(Ident { value, raw, .. }) = v { + if let ComponentValue::Ident(box Ident { value, raw, .. }) = v { *raw = None; rename( From e58990fa72e269a0db7e106092db90773ff2979e Mon Sep 17 00:00:00 2001 From: "alexander.akait" Date: Sun, 4 Dec 2022 23:00:42 +0300 Subject: [PATCH 26/42] refactor: code --- .../src/compressor/alpha_value.rs | 4 +- .../swc_css_minifier/src/compressor/angle.rs | 4 +- .../swc_css_minifier/src/compressor/color.rs | 22 ++--- .../src/compressor/container.rs | 2 +- .../src/compressor/declaration.rs | 95 ++++++++++--------- .../src/compressor/easing_function.rs | 50 +++++----- .../swc_css_minifier/src/compressor/length.rs | 2 +- .../src/compressor/math/mod.rs | 2 +- .../swc_css_minifier/src/compressor/media.rs | 2 +- .../swc_css_minifier/src/compressor/rules.rs | 62 ++++++------ .../src/compressor/transform_function.rs | 70 +++++++------- 11 files changed, 161 insertions(+), 154 deletions(-) diff --git a/crates/swc_css_minifier/src/compressor/alpha_value.rs b/crates/swc_css_minifier/src/compressor/alpha_value.rs index ebb38b1421e7..6caeda8961d5 100644 --- a/crates/swc_css_minifier/src/compressor/alpha_value.rs +++ b/crates/swc_css_minifier/src/compressor/alpha_value.rs @@ -54,11 +54,11 @@ impl Compressor { }) if number.value % 10.0 == 0.0 => { let new_value = number.value / 100.0; - *component_value = ComponentValue::Number(Number { + *component_value = ComponentValue::Number(Box::new(Number { span: *span, value: new_value, raw: None, - }); + })); } _ => {} } diff --git a/crates/swc_css_minifier/src/compressor/angle.rs b/crates/swc_css_minifier/src/compressor/angle.rs index fe523fbfa683..7bae189ba893 100644 --- a/crates/swc_css_minifier/src/compressor/angle.rs +++ b/crates/swc_css_minifier/src/compressor/angle.rs @@ -21,11 +21,11 @@ impl Compressor { span, .. })) if *number_value == 0.0 => { - *component_value = ComponentValue::Number(Number { + *component_value = ComponentValue::Number(Box::new(Number { span: *span, value: 0.0, raw: None, - }); + })); } _ => {} } diff --git a/crates/swc_css_minifier/src/compressor/color.rs b/crates/swc_css_minifier/src/compressor/color.rs index 0b41e9452460..d2f7011726a7 100644 --- a/crates/swc_css_minifier/src/compressor/color.rs +++ b/crates/swc_css_minifier/src/compressor/color.rs @@ -162,29 +162,29 @@ macro_rules! make_color { raw: None, }, value: vec![ - ComponentValue::Number(Number { + ComponentValue::Number(Box::new(Number { span: DUMMY_SP, value: r, raw: None, - }), + })), ComponentValue::Delimiter(Box::new(Delimiter { span: DUMMY_SP, value: DelimiterValue::Comma, })), - ComponentValue::Number(Number { + ComponentValue::Number(Box::new(Number { span: DUMMY_SP, value: g, raw: None, - }), + })), ComponentValue::Delimiter(Box::new(Delimiter { span: DUMMY_SP, value: DelimiterValue::Comma, })), - ComponentValue::Number(Number { + ComponentValue::Number(Box::new(Number { span: DUMMY_SP, value: b, raw: None, - }), + })), ComponentValue::Delimiter(Box::new(Delimiter { span: DUMMY_SP, value: DelimiterValue::Comma, @@ -283,7 +283,7 @@ impl Compressor { Some(*value / 100.0) } - Some(ComponentValue::Ident(Ident { value, .. })) + Some(ComponentValue::Ident(box Ident { value, .. })) if value.to_ascii_lowercase() == js_word!("none") => { Some(0.0) @@ -320,7 +320,7 @@ impl Compressor { Some(value) } - Some(ComponentValue::Ident(Ident { value, .. })) + Some(ComponentValue::Ident(box Ident { value, .. })) if value.to_ascii_lowercase() == js_word!("none") => { Some(0.0) @@ -343,7 +343,7 @@ impl Compressor { Some(*value / 100.0) } - Some(ComponentValue::Ident(Ident { value, .. })) + Some(ComponentValue::Ident(box Ident { value, .. })) if value.to_ascii_lowercase() == js_word!("none") => { Some(0.0) @@ -357,7 +357,7 @@ impl Compressor { number_or_percentage: Option<&&ComponentValue>, ) -> Option { match number_or_percentage { - Some(ComponentValue::Number(Number { value, .. })) => { + Some(ComponentValue::Number(box Number { value, .. })) => { if *value > 255.0 { return Some(255.0); } else if *value < 0.0 { @@ -378,7 +378,7 @@ impl Compressor { Some((2.55 * *value).round()) } - Some(ComponentValue::Ident(Ident { value, .. })) + Some(ComponentValue::Ident(box Ident { value, .. })) if value.to_ascii_lowercase() == js_word!("none") => { Some(0.0) diff --git a/crates/swc_css_minifier/src/compressor/container.rs b/crates/swc_css_minifier/src/compressor/container.rs index 8b120335b2b9..5e850c8ee008 100644 --- a/crates/swc_css_minifier/src/compressor/container.rs +++ b/crates/swc_css_minifier/src/compressor/container.rs @@ -29,7 +29,7 @@ impl Compressor { *n = SizeFeatureValue::Dimension(*dimension); } Some(ComponentValue::Number(number)) => { - *n = SizeFeatureValue::Number(number); + *n = SizeFeatureValue::Number(*number); } _ => {} } diff --git a/crates/swc_css_minifier/src/compressor/declaration.rs b/crates/swc_css_minifier/src/compressor/declaration.rs index 2e2d2f483766..7bda7d80d493 100644 --- a/crates/swc_css_minifier/src/compressor/declaration.rs +++ b/crates/swc_css_minifier/src/compressor/declaration.rs @@ -15,7 +15,7 @@ impl Compressor { for value in declaration.value.iter() { match value { - outside_node @ ComponentValue::Ident(Ident { value, .. }) + outside_node @ ComponentValue::Ident(box Ident { value, .. }) if matches!( value.to_ascii_lowercase(), js_word!("block") | js_word!("inline") | js_word!("run-in") @@ -23,7 +23,7 @@ impl Compressor { { outside = Some(outside_node); } - inside_node @ ComponentValue::Ident(Ident { value, .. }) + inside_node @ ComponentValue::Ident(box Ident { value, .. }) if matches!( value.to_ascii_lowercase(), js_word!("flow") @@ -36,10 +36,11 @@ impl Compressor { { inside = Some(inside_node); } - list_item_node @ ComponentValue::Ident(Ident { value, .. }) + list_item_node @ ComponentValue::Ident(box Ident { value, .. }) if value.to_ascii_lowercase() == js_word!("list-item") => { - if let Some(ComponentValue::Ident(Ident { value, .. })) = inside { + if let Some(ComponentValue::Ident(box Ident { value, .. })) = inside + { if !matches!( value.to_ascii_lowercase(), js_word!("flow") | js_word!("flow-root") @@ -60,7 +61,7 @@ impl Compressor { // `run-in flow` -> `run-in` ( Some(outside), - Some(ComponentValue::Ident(Ident { + Some(ComponentValue::Ident(box Ident { value: inside_value, .. })), @@ -70,12 +71,12 @@ impl Compressor { } // `block flow-root` -> `flow-root` ( - Some(ComponentValue::Ident(Ident { + Some(ComponentValue::Ident(box Ident { value: outside_value, .. })), Some( - inside @ ComponentValue::Ident(Ident { + inside @ ComponentValue::Ident(box Ident { value: inside_value, .. }), @@ -88,12 +89,12 @@ impl Compressor { } // `inline flow-root` -> `inline-block` ( - Some(ComponentValue::Ident(Ident { + Some(ComponentValue::Ident(box Ident { value: outside_value, span, .. })), - Some(ComponentValue::Ident(Ident { + Some(ComponentValue::Ident(box Ident { value: inside_value, .. })), @@ -101,19 +102,19 @@ impl Compressor { ) if outside_value.to_ascii_lowercase() == js_word!("inline") && inside_value.to_ascii_lowercase() == js_word!("flow-root") => { - declaration.value = vec![ComponentValue::Ident(Ident { + declaration.value = vec![ComponentValue::Ident(Box::new(Ident { span: *span, value: js_word!("inline-block"), raw: None, - })]; + }))]; } // `block flow list-item` -> `list-item` ( - Some(ComponentValue::Ident(Ident { + Some(ComponentValue::Ident(box Ident { value: outside_value, .. })), - Some(ComponentValue::Ident(Ident { + Some(ComponentValue::Ident(box Ident { value: inside_value, .. })), @@ -125,7 +126,7 @@ impl Compressor { } // `block list-item` -> `list-item` ( - Some(ComponentValue::Ident(Ident { + Some(ComponentValue::Ident(box Ident { value: outside_value, .. })), @@ -137,7 +138,7 @@ impl Compressor { // `flow list-item` -> `list-item` ( None, - Some(ComponentValue::Ident(Ident { + Some(ComponentValue::Ident(box Ident { value: inside_value, .. })), @@ -148,12 +149,12 @@ impl Compressor { // `inline flow list-item` -> `inline list-item` ( Some( - outside @ ComponentValue::Ident(Ident { + outside @ ComponentValue::Ident(box Ident { value: outside_value, .. }), ), - Some(ComponentValue::Ident(Ident { + Some(ComponentValue::Ident(box Ident { value: inside_value, .. })), @@ -167,12 +168,12 @@ impl Compressor { // `block grid` -> `grid` // `block table` -> `table` ( - Some(ComponentValue::Ident(Ident { + Some(ComponentValue::Ident(box Ident { value: outside_value, .. })), Some( - inside @ ComponentValue::Ident(Ident { + inside @ ComponentValue::Ident(box Ident { value: inside_value, .. }), @@ -188,12 +189,12 @@ impl Compressor { } // `inline ruby` -> `ruby` ( - Some(ComponentValue::Ident(Ident { + Some(ComponentValue::Ident(box Ident { value: outside_value, .. })), Some( - inside @ ComponentValue::Ident(Ident { + inside @ ComponentValue::Ident(box Ident { value: inside_value, .. }), @@ -334,23 +335,23 @@ impl Compressor { .take() .into_iter() .map(|node| match node { - ComponentValue::Ident(Ident { value, span, .. }) + ComponentValue::Ident(box Ident { value, span, .. }) if value.to_ascii_lowercase() == js_word!("normal") => { - ComponentValue::Number(Number { + ComponentValue::Number(Box::new(Number { span, value: 400.0, raw: None, - }) + })) } - ComponentValue::Ident(Ident { value, span, .. }) + ComponentValue::Ident(box Ident { value, span, .. }) if value.to_ascii_lowercase() == js_word!("bold") => { - ComponentValue::Number(Number { + ComponentValue::Number(Box::new(Number { span, value: 700.0, raw: None, - }) + })) } _ => node, }) @@ -365,12 +366,12 @@ impl Compressor { let second = declaration.value.get(1); if let ( - Some(ComponentValue::Ident(Ident { + Some(ComponentValue::Ident(box Ident { span, value: first_value, .. })), - Some(ComponentValue::Ident(Ident { + Some(ComponentValue::Ident(box Ident { value: second_value, .. })), @@ -381,18 +382,18 @@ impl Compressor { second_value.to_ascii_lowercase(), ) { (js_word!("repeat"), js_word!("no-repeat")) => { - declaration.value = vec![ComponentValue::Ident(Ident { + declaration.value = vec![ComponentValue::Ident(Box::new(Ident { span: *span, value: js_word!("repeat-x"), raw: None, - })]; + }))]; } (js_word!("no-repeat"), js_word!("repeat")) => { - declaration.value = vec![ComponentValue::Ident(Ident { + declaration.value = vec![ComponentValue::Ident(Box::new(Ident { span: *span, value: js_word!("repeat-y"), raw: None, - })]; + }))]; } (js_word!("repeat"), js_word!("repeat")) | (js_word!("space"), js_word!("space")) @@ -436,11 +437,11 @@ impl Compressor { declaration.value.insert( 0, if self.is_ident_shorter_than_str(to_be_identify) { - ComponentValue::Ident(Ident { + ComponentValue::Ident(Box::new(Ident { span: ident.span, value: to_be_identify.into(), raw: None, - }) + })) } else { ComponentValue::Str(Box::new(Str { span: ident.span, @@ -469,11 +470,11 @@ impl Compressor { } to_be_identify => { if self.is_ident_shorter_than_str(to_be_identify) { - ComponentValue::Ident(Ident { + ComponentValue::Ident(Box::new(Ident { span: ident.span, value: to_be_identify.into(), raw: None, - }) + })) } else { ComponentValue::Str(Box::new(Str { span: ident.span, @@ -516,15 +517,15 @@ impl Compressor { true } ( - Some(ComponentValue::Integer(Integer { value: 0, .. })), - Some(ComponentValue::Integer(Integer { value: 0, .. })), + Some(ComponentValue::Integer(box Integer { value: 0, .. })), + Some(ComponentValue::Integer(box Integer { value: 0, .. })), ) => true, ( - Some(ComponentValue::Number(Number { + Some(ComponentValue::Number(box Number { value: first_number, .. })), - Some(ComponentValue::Number(Number { + Some(ComponentValue::Number(box Number { value: second_number, .. })), @@ -560,15 +561,15 @@ impl Compressor { Some(ComponentValue::Percentage(box Percentage { value: value_2, .. })), ) if value_1.value == value_2.value => true, ( - Some(ComponentValue::Integer(Integer { value: 0, .. })), - Some(ComponentValue::Integer(Integer { value: 0, .. })), + Some(ComponentValue::Integer(box Integer { value: 0, .. })), + Some(ComponentValue::Integer(box Integer { value: 0, .. })), ) => true, ( - Some(ComponentValue::Number(Number { + Some(ComponentValue::Number(box Number { value: first_number, .. })), - Some(ComponentValue::Number(Number { + Some(ComponentValue::Number(box Number { value: second_number, .. })), @@ -583,8 +584,8 @@ impl Compressor { node_2: Option<&ComponentValue>, ) -> bool { matches!((node_1, node_2), ( - Some(ComponentValue::Ident(Ident { value: value_1, .. })), - Some(ComponentValue::Ident(Ident { value: value_2, .. })), + Some(ComponentValue::Ident(box Ident { value: value_1, .. })), + Some(ComponentValue::Ident(box Ident { value: value_2, .. })), ) if value_1.to_ascii_lowercase() == value_2.to_ascii_lowercase()) } } diff --git a/crates/swc_css_minifier/src/compressor/easing_function.rs b/crates/swc_css_minifier/src/compressor/easing_function.rs index 2a4d89fb4db8..75c4865bf4d2 100644 --- a/crates/swc_css_minifier/src/compressor/easing_function.rs +++ b/crates/swc_css_minifier/src/compressor/easing_function.rs @@ -14,10 +14,10 @@ impl Compressor { && function_value.len() == 7 => { if let ( - ComponentValue::Number(Number { value: first, .. }), - ComponentValue::Number(Number { value: second, .. }), - ComponentValue::Number(Number { value: third, .. }), - ComponentValue::Number(Number { value: fourth, .. }), + ComponentValue::Number(box Number { value: first, .. }), + ComponentValue::Number(box Number { value: second, .. }), + ComponentValue::Number(box Number { value: third, .. }), + ComponentValue::Number(box Number { value: fourth, .. }), ) = ( &function_value[0], &function_value[2], @@ -25,35 +25,35 @@ impl Compressor { &function_value[6], ) { if *first == 0.0 && *second == 0.0 && *third == 1.0 && *fourth == 1.0 { - *component_value = ComponentValue::Ident(Ident { + *component_value = ComponentValue::Ident(Box::new(Ident { span: *span, value: js_word!("linear"), raw: None, - }) + })) } else if *first == 0.25 && *second == 0.1 && *third == 0.25 && *fourth == 1.0 { - *component_value = ComponentValue::Ident(Ident { + *component_value = ComponentValue::Ident(Box::new(Ident { span: *span, value: js_word!("ease"), raw: None, - }) + })) } else if *first == 0.42 && *second == 0.0 && *third == 1.0 && *fourth == 1.0 { - *component_value = ComponentValue::Ident(Ident { + *component_value = ComponentValue::Ident(Box::new(Ident { span: *span, value: js_word!("ease-in"), raw: None, - }) + })) } else if *first == 0.0 && *second == 0.0 && *third == 0.58 && *fourth == 1.0 { - *component_value = ComponentValue::Ident(Ident { + *component_value = ComponentValue::Ident(Box::new(Ident { span: *span, value: js_word!("ease-out"), raw: None, - }) + })) } else if *first == 0.42 && *second == 0.0 && *third == 0.58 && *fourth == 1.0 { - *component_value = ComponentValue::Ident(Ident { + *component_value = ComponentValue::Ident(Box::new(Ident { span: *span, value: js_word!("ease-in-out"), raw: None, - }) + })) } } } @@ -66,45 +66,45 @@ impl Compressor { { match (&function_value[0], &function_value[2]) { ( - ComponentValue::Number(Number { + ComponentValue::Number(box Number { value: number_value, .. }), - ComponentValue::Ident(Ident { + ComponentValue::Ident(box Ident { value: ident_value, .. }), ) if *number_value == 1.0 => match ident_value.to_ascii_lowercase() { js_word!("start") | js_word!("jump-start") => { - *component_value = ComponentValue::Ident(Ident { + *component_value = ComponentValue::Ident(Box::new(Ident { span: *span, value: js_word!("step-start"), raw: None, - }) + })) } js_word!("end") | js_word!("jump-end") => { - *component_value = ComponentValue::Ident(Ident { + *component_value = ComponentValue::Ident(Box::new(Ident { span: *span, value: js_word!("step-end"), raw: None, - }) + })) } _ => {} }, ( - ComponentValue::Number(Number { .. }), - ComponentValue::Ident(Ident { + ComponentValue::Number(box Number { .. }), + ComponentValue::Ident(box Ident { value: ident_value, .. }), ) if ident_value.to_ascii_lowercase() == js_word!("jump-start") => { - function_value[2] = ComponentValue::Ident(Ident { + function_value[2] = ComponentValue::Ident(Box::new(Ident { span: *span, value: js_word!("start"), raw: None, - }) + })) } ( ComponentValue::Number(number), - ComponentValue::Ident(Ident { + ComponentValue::Ident(box Ident { value: ident_value, .. }), ) => match ident_value.to_ascii_lowercase() { diff --git a/crates/swc_css_minifier/src/compressor/length.rs b/crates/swc_css_minifier/src/compressor/length.rs index 768268e8f62b..d52c8689be17 100644 --- a/crates/swc_css_minifier/src/compressor/length.rs +++ b/crates/swc_css_minifier/src/compressor/length.rs @@ -124,7 +124,7 @@ impl Compressor { if let ComponentValue::Dimension(dimension) = n { if let Some(number) = self.length_to_zero(dimension) { - *n = ComponentValue::Number(number) + *n = ComponentValue::Number(Box::new(number)) } } } diff --git a/crates/swc_css_minifier/src/compressor/math/mod.rs b/crates/swc_css_minifier/src/compressor/math/mod.rs index a1ec5f05c098..31fb1940b374 100644 --- a/crates/swc_css_minifier/src/compressor/math/mod.rs +++ b/crates/swc_css_minifier/src/compressor/math/mod.rs @@ -9,7 +9,7 @@ pub fn is_calc_function_name(ident: &Ident) -> bool { pub fn transform_calc_value_into_component_value(calc_value: &CalcValue) -> Option { match &calc_value { - CalcValue::Number(n) => Some(ComponentValue::Number(n.clone())), + CalcValue::Number(n) => Some(ComponentValue::Number(Box::new(n.clone()))), CalcValue::Dimension(Dimension::Length(l)) => Some(ComponentValue::Dimension(Box::new( Dimension::Length(Length { span: l.span, diff --git a/crates/swc_css_minifier/src/compressor/media.rs b/crates/swc_css_minifier/src/compressor/media.rs index d9be9ca0b317..6c8d2b25fbf8 100644 --- a/crates/swc_css_minifier/src/compressor/media.rs +++ b/crates/swc_css_minifier/src/compressor/media.rs @@ -355,7 +355,7 @@ impl Compressor { *n = MediaFeatureValue::Dimension(*dimension); } Some(ComponentValue::Number(number)) => { - *n = MediaFeatureValue::Number(number); + *n = MediaFeatureValue::Number(*number); } _ => {} } diff --git a/crates/swc_css_minifier/src/compressor/rules.rs b/crates/swc_css_minifier/src/compressor/rules.rs index 298afb03eca9..37c1ea09f03d 100644 --- a/crates/swc_css_minifier/src/compressor/rules.rs +++ b/crates/swc_css_minifier/src/compressor/rules.rs @@ -138,7 +138,7 @@ impl Compressor { }); } ParentNode::SimpleBlock(simple_block) => simple_block.value.retain(|rule| match rule { - ComponentValue::Rule(Rule::AtRule(box at_rule)) => discarder(at_rule), + ComponentValue::Rule(box Rule::AtRule(box at_rule)) => discarder(at_rule), _ => true, }), } @@ -451,33 +451,37 @@ impl Compressor { simple_block.value.retain_mut(|rule| { let result = match rule { - ComponentValue::Rule(Rule::AtRule(box AtRule { + ComponentValue::Rule(box Rule::AtRule(box AtRule { block: Some(block), .. })) - | ComponentValue::Rule(Rule::QualifiedRule(box QualifiedRule { block, .. })) - | ComponentValue::StyleBlock(StyleBlock::QualifiedRule(box QualifiedRule { - block, - .. + | ComponentValue::Rule(box Rule::QualifiedRule(box QualifiedRule { + block, .. })) - | ComponentValue::StyleBlock(StyleBlock::AtRule(box AtRule { - block: Some(block), + | ComponentValue::StyleBlock(box StyleBlock::QualifiedRule(box QualifiedRule { + block, .. })) - | ComponentValue::DeclarationOrAtRule(DeclarationOrAtRule::AtRule(box AtRule { + | ComponentValue::StyleBlock(box StyleBlock::AtRule(box AtRule { block: Some(block), .. })) + | ComponentValue::DeclarationOrAtRule(box DeclarationOrAtRule::AtRule( + box AtRule { + block: Some(block), .. + }, + )) | ComponentValue::KeyframeBlock(box KeyframeBlock { block, .. }) if block.value.is_empty() => { false } - ComponentValue::Rule(Rule::AtRule(box at_rule @ AtRule { .. })) + ComponentValue::Rule(box Rule::AtRule(box at_rule @ AtRule { .. })) if prev_rule.is_some() && self.is_mergeable_at_rule(at_rule) => { - if let Some(ComponentValue::Rule(Rule::AtRule(box prev_rule))) = &prev_rule { + if let Some(ComponentValue::Rule(box Rule::AtRule(box prev_rule))) = &prev_rule + { if let Some(at_rule) = self.try_merge_at_rule(prev_rule, at_rule) { - *rule = ComponentValue::Rule(Rule::AtRule(Box::new(at_rule))); + *rule = ComponentValue::Rule(Box::new(Rule::AtRule(Box::new(at_rule)))); remove_rules_list.push(prev_index); } @@ -485,15 +489,16 @@ impl Compressor { true } - ComponentValue::StyleBlock(StyleBlock::AtRule(box at_rule @ AtRule { .. })) + ComponentValue::StyleBlock(box StyleBlock::AtRule(box at_rule @ AtRule { .. })) if prev_rule.is_some() && self.is_mergeable_at_rule(at_rule) => { - if let Some(ComponentValue::StyleBlock(StyleBlock::AtRule(box prev_rule))) = + if let Some(ComponentValue::StyleBlock(box StyleBlock::AtRule(box prev_rule))) = &prev_rule { if let Some(at_rule) = self.try_merge_at_rule(prev_rule, at_rule) { - *rule = - ComponentValue::StyleBlock(StyleBlock::AtRule(Box::new(at_rule))); + *rule = ComponentValue::StyleBlock(Box::new(StyleBlock::AtRule( + Box::new(at_rule), + ))); remove_rules_list.push(prev_index); } @@ -501,17 +506,18 @@ impl Compressor { true } - ComponentValue::Rule(Rule::QualifiedRule( + ComponentValue::Rule(box Rule::QualifiedRule( box qualified_rule @ QualifiedRule { .. }, )) if prev_rule.is_some() => { - if let Some(ComponentValue::Rule(Rule::QualifiedRule(box prev_rule))) = + if let Some(ComponentValue::Rule(box Rule::QualifiedRule(box prev_rule))) = &prev_rule { if let Some(qualified_rule) = self.try_merge_qualified_rules(prev_rule, qualified_rule) { - *rule = - ComponentValue::Rule(Rule::QualifiedRule(Box::new(qualified_rule))); + *rule = ComponentValue::Rule(Box::new(Rule::QualifiedRule(Box::new( + qualified_rule, + )))); remove_rules_list.push(prev_index); } @@ -519,18 +525,18 @@ impl Compressor { true } - ComponentValue::StyleBlock(StyleBlock::QualifiedRule( + ComponentValue::StyleBlock(box StyleBlock::QualifiedRule( box qualified_rule @ QualifiedRule { .. }, )) if prev_rule.is_some() => { - if let Some(ComponentValue::StyleBlock(StyleBlock::QualifiedRule( + if let Some(ComponentValue::StyleBlock(box StyleBlock::QualifiedRule( box prev_rule, ))) = &prev_rule { if let Some(qualified_rule) = self.try_merge_qualified_rules(prev_rule, qualified_rule) { - *rule = ComponentValue::StyleBlock(StyleBlock::QualifiedRule( - Box::new(qualified_rule), + *rule = ComponentValue::StyleBlock(Box::new( + StyleBlock::QualifiedRule(Box::new(qualified_rule)), )); remove_rules_list.push(prev_index); @@ -550,16 +556,16 @@ impl Compressor { if result { match rule { - ComponentValue::Rule(Rule::AtRule(box at_rule)) - | ComponentValue::StyleBlock(StyleBlock::AtRule(box at_rule)) + ComponentValue::Rule(box Rule::AtRule(box at_rule)) + | ComponentValue::StyleBlock(box StyleBlock::AtRule(box at_rule)) if self.is_mergeable_at_rule(at_rule) => { prev_index = index; prev_rule = Some(rule.clone()); } - ComponentValue::Rule(Rule::QualifiedRule(_)) - | ComponentValue::StyleBlock(StyleBlock::QualifiedRule(_)) => { + ComponentValue::Rule(box Rule::QualifiedRule(_)) + | ComponentValue::StyleBlock(box StyleBlock::QualifiedRule(_)) => { prev_index = index; prev_rule = Some(rule.clone()); } diff --git a/crates/swc_css_minifier/src/compressor/transform_function.rs b/crates/swc_css_minifier/src/compressor/transform_function.rs index 0be79214d649..9e1d9ff3d031 100644 --- a/crates/swc_css_minifier/src/compressor/transform_function.rs +++ b/crates/swc_css_minifier/src/compressor/transform_function.rs @@ -16,7 +16,7 @@ impl Compressor { match (function_value.get(0), function_value.get(2)) { ( Some(first), - Some(ComponentValue::Number(Number { + Some(ComponentValue::Number(box Number { value: second_number, .. })), @@ -24,7 +24,7 @@ impl Compressor { *function_value = vec![first.clone()]; } ( - Some(ComponentValue::Number(Number { + Some(ComponentValue::Number(box Number { value: first_number, .. })), @@ -53,11 +53,11 @@ impl Compressor { function_value.get(4), ) { ( - Some(ComponentValue::Number(Number { + Some(ComponentValue::Number(box Number { value: first_number, .. })), - Some(ComponentValue::Number(Number { + Some(ComponentValue::Number(box Number { value: second_number, .. })), @@ -83,12 +83,12 @@ impl Compressor { match (function_value.get(0), function_value.get(2)) { ( Some( - first @ ComponentValue::Number(Number { + first @ ComponentValue::Number(box Number { value: first_number, .. }), ), - Some(ComponentValue::Number(Number { + Some(ComponentValue::Number(box Number { value: second_number, .. })), @@ -97,7 +97,7 @@ impl Compressor { } ( Some(first), - Some(ComponentValue::Number(Number { + Some(ComponentValue::Number(box Number { value: second_number, .. })), @@ -110,7 +110,7 @@ impl Compressor { *function_value = vec![first.clone()]; } ( - Some(ComponentValue::Number(Number { + Some(ComponentValue::Number(box Number { value: first_number, .. })), @@ -140,11 +140,11 @@ impl Compressor { ) { ( Some(first), - Some(ComponentValue::Number(Number { + Some(ComponentValue::Number(box Number { value: second_number, .. })), - Some(ComponentValue::Number(Number { + Some(ComponentValue::Number(box Number { value: third_number, .. })), @@ -157,12 +157,12 @@ impl Compressor { *function_value = vec![first.clone()]; } ( - Some(ComponentValue::Number(Number { + Some(ComponentValue::Number(box Number { value: first_number, .. })), Some(second), - Some(ComponentValue::Number(Number { + Some(ComponentValue::Number(box Number { value: third_number, .. })), @@ -175,11 +175,11 @@ impl Compressor { *function_value = vec![second.clone()]; } ( - Some(ComponentValue::Number(Number { + Some(ComponentValue::Number(box Number { value: first_number, .. })), - Some(ComponentValue::Number(Number { + Some(ComponentValue::Number(box Number { value: second_number, .. })), @@ -230,11 +230,11 @@ impl Compressor { Some(first_comma), Some(second), Some(second_comma), - Some(ComponentValue::Number(Number { + Some(ComponentValue::Number(box Number { value: third_number, .. })), - Some(ComponentValue::Number(Number { + Some(ComponentValue::Number(box Number { value: fourth_number, .. })), @@ -242,38 +242,38 @@ impl Compressor { Some(fifth_comma), Some(sixth), Some(sixth_comma), - Some(ComponentValue::Number(Number { + Some(ComponentValue::Number(box Number { value: seventh_number, .. })), - Some(ComponentValue::Number(Number { + Some(ComponentValue::Number(box Number { value: eighth_number, .. })), - Some(ComponentValue::Number(Number { + Some(ComponentValue::Number(box Number { value: ninth_number, .. })), - Some(ComponentValue::Number(Number { + Some(ComponentValue::Number(box Number { value: tenth_number, .. })), - Some(ComponentValue::Number(Number { + Some(ComponentValue::Number(box Number { value: eleventh_number, .. })), - Some(ComponentValue::Number(Number { + Some(ComponentValue::Number(box Number { value: twelfth_number, .. })), Some(thirteenth), Some(thirteenth_comma), Some(fourteenth), - Some(ComponentValue::Number(Number { + Some(ComponentValue::Number(box Number { value: fifteenth_number, .. })), - Some(ComponentValue::Number(Number { + Some(ComponentValue::Number(box Number { value: sixteenth_number, .. })), @@ -324,15 +324,15 @@ impl Compressor { function_value.get(6), ) { ( - Some(ComponentValue::Number(Number { + Some(ComponentValue::Number(box Number { value: first_number, .. })), - Some(ComponentValue::Number(Number { + Some(ComponentValue::Number(box Number { value: second_number, .. })), - Some(ComponentValue::Number(Number { + Some(ComponentValue::Number(box Number { value: third_number, .. })), @@ -346,15 +346,15 @@ impl Compressor { *function_value = vec![fourth_value.clone()]; } ( - Some(ComponentValue::Number(Number { + Some(ComponentValue::Number(box Number { value: first_number, .. })), - Some(ComponentValue::Number(Number { + Some(ComponentValue::Number(box Number { value: second_number, .. })), - Some(ComponentValue::Number(Number { + Some(ComponentValue::Number(box Number { value: third_number, .. })), @@ -368,15 +368,15 @@ impl Compressor { *function_value = vec![fourth_value.clone()]; } ( - Some(ComponentValue::Number(Number { + Some(ComponentValue::Number(box Number { value: first_number, .. })), - Some(ComponentValue::Number(Number { + Some(ComponentValue::Number(box Number { value: second_number, .. })), - Some(ComponentValue::Number(Number { + Some(ComponentValue::Number(box Number { value: third_number, .. })), @@ -416,7 +416,7 @@ impl Compressor { match (function_value.get(0), function_value.get(2)) { ( Some(first), - Some(ComponentValue::Number(Number { + Some(ComponentValue::Number(box Number { value: second_number, .. })), @@ -430,7 +430,7 @@ impl Compressor { } ( - Some(ComponentValue::Number(Number { + Some(ComponentValue::Number(box Number { value: first_number, .. })), From 6e1d3b4501c4196ff3004da9f31c331520b2d29e Mon Sep 17 00:00:00 2001 From: "alexander.akait" Date: Sun, 4 Dec 2022 23:46:22 +0300 Subject: [PATCH 27/42] refactor: code --- crates/swc_html_minifier/src/lib.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/swc_html_minifier/src/lib.rs b/crates/swc_html_minifier/src/lib.rs index a6910fcab276..936a0e8d8a1c 100644 --- a/crates/swc_html_minifier/src/lib.rs +++ b/crates/swc_html_minifier/src/lib.rs @@ -2336,7 +2336,9 @@ impl Minifier<'_> { let declaration_list: Vec = list_of_declarations .into_iter() - .map(swc_css_ast::ComponentValue::DeclarationOrAtRule) + .map(|node| { + swc_css_ast::ComponentValue::DeclarationOrAtRule(Box::new(node)) + }) .collect(); swc_css_ast::Stylesheet { From ef6b85bf9a3fc4f532e0236330f14ef890eef3a3 Mon Sep 17 00:00:00 2001 From: "alexander.akait" Date: Mon, 5 Dec 2022 01:50:51 +0300 Subject: [PATCH 28/42] perf: box all tokens --- crates/swc_css_ast/src/token.rs | 281 +++---- crates/swc_css_parser/src/lexer/mod.rs | 108 +-- crates/swc_css_parser/src/macros.rs | 38 +- .../swc_css_parser/src/parser/at_rules/mod.rs | 70 +- crates/swc_css_parser/src/parser/input.rs | 6 +- crates/swc_css_parser/src/parser/macros.rs | 6 +- .../src/parser/selectors/mod.rs | 30 +- .../swc_css_parser/src/parser/syntax/mod.rs | 14 +- crates/swc_css_parser/src/parser/util.rs | 2 +- .../src/parser/values_and_units/mod.rs | 226 +++--- .../fixture/at-rule/container/span.swc-stderr | 30 +- .../fixture/at-rule/media/span.swc-stderr | 54 +- .../fixture/at-rule/supports/span.swc-stderr | 166 ++--- .../fixture/at-rule/unknown/span.swc-stderr | 684 +++++++++--------- .../fixture/dashed-ident/span.swc-stderr | 10 +- .../fixture/function/calc/span.swc-stderr | 10 +- .../selector/pseudo-class/has/span.swc-stderr | 52 +- .../selector/pseudo-class/is/span.swc-stderr | 72 +- .../pseudo-class/unknown/span.swc-stderr | 68 +- .../pseudo-class/where/span.swc-stderr | 36 +- .../pseudo-element/unknown/span.swc-stderr | 68 +- .../tests/fixture/style-block/span.swc-stderr | 62 +- .../styled-jsx/selector/1/span.swc-stderr | 12 +- .../styled-jsx/selector/2/span.swc-stderr | 8 +- .../value/custom-property/span.swc-stderr | 146 ++-- .../tests/fixture/value/url/span.swc-stderr | 2 +- .../vendor/csstree/basic/span.swc-stderr | 12 +- .../6s_VBuRPHbPiUrh1fWCR_Q/span.swc-stderr | 2 +- .../L0mEf41IMkWcP7NotllkAg/span.swc-stderr | 18 +- .../MvD7ThpMVIxU3dzF71Gpcg/span.swc-stderr | 2 +- .../SnMCumHJazvlgOXgmxJ9Jg/span.swc-stderr | 4 +- .../WQWdwW4B4hm60AQgxTU08Q/span.swc-stderr | 2 +- .../_d22bZcPKDgNEKSyJ2NRsQ/span.swc-stderr | 2 +- .../_e6qpZBWfowEh1P3Wn3orA/span.swc-stderr | 2 +- .../d1BWbOHfSbCE8-_qEz-luA/span.swc-stderr | 2 +- .../pLQn9swtbpZ-CVZMGw0EwA/span.swc-stderr | 2 +- .../rome/custom-properties/span.swc-stderr | 34 +- .../vendor/rome/functions/span.swc-stderr | 2 +- .../vendor/rome/selectors/span.swc-stderr | 6 +- .../recovery/at-rule/document/span.swc-stderr | 18 +- .../at-rule/extra-semi/span.swc-stderr | 8 +- .../at-rule/font-face/span.swc-stderr | 22 +- .../at-rule/import/empty/span.swc-stderr | 2 +- .../at-rule/import/indent/span.swc-stderr | 4 +- .../import/invalid-layer/span.swc-stderr | 8 +- .../import/invalid-supports/span.swc-stderr | 2 +- .../at-rule/import/no-semi/span.swc-stderr | 10 +- .../at-rule/import/no-url/span.swc-stderr | 8 +- .../at-rule/import/unknown/span.swc-stderr | 20 +- .../keyframes/custom-ident-1/span.swc-stderr | 6 +- .../keyframes/custom-ident-2/span.swc-stderr | 6 +- .../keyframes/custom-ident-3/span.swc-stderr | 6 +- .../keyframes/custom-ident-4/span.swc-stderr | 6 +- .../keyframes/custom-ident/span.swc-stderr | 6 +- .../keyframes/empty-name/span.swc-stderr | 2 +- .../keyframe-broke-and-normal/span.swc-stderr | 4 +- .../span.swc-stderr | 30 +- .../keyframe-keyword/span.swc-stderr | 8 +- .../keyframes/keyframe-number/span.swc-stderr | 4 +- .../at-rule/layer/block/span.swc-stderr | 16 +- .../at-rule/layer/empty/span.swc-stderr | 2 +- .../layer/string-name-block/span.swc-stderr | 6 +- .../string-name-statement/span.swc-stderr | 4 +- .../at-rule/media/condition-1/span.swc-stderr | 34 +- .../media/condition-and-or/span.swc-stderr | 30 +- .../at-rule/media/condition/span.swc-stderr | 22 +- .../media/feature-name-1/span.swc-stderr | 10 +- .../media/feature-name-2/span.swc-stderr | 6 +- .../media/feature-name/span.swc-stderr | 10 +- .../media/feature-range-2/span.swc-stderr | 22 +- .../media/feature-range-3/span.swc-stderr | 30 +- .../media/feature-range-4/span.swc-stderr | 24 +- .../media/feature-range-5/span.swc-stderr | 26 +- .../media/feature-range-6/span.swc-stderr | 26 +- .../at-rule/media/feature/span.swc-stderr | 10 +- .../media/invalid-nesting/span.swc-stderr | 8 +- .../at-rule/media/media-type/span.swc-stderr | 10 +- .../media/wrong-stylesheet/span.swc-stderr | 12 +- .../page/invalid-pseudo/span.swc-stderr | 6 +- .../at-rule/page/no-space/span.swc-stderr | 10 +- .../at-rule/page/without-page/span.swc-stderr | 20 +- .../supports/empty-in-parens/span.swc-stderr | 6 +- .../supports/no-parens/span.swc-stderr | 10 +- .../non-standard-prelude/span.swc-stderr | 66 +- .../supports/wrong-or-and/span.swc-stderr | 34 +- .../double-quotes/span.swc-stderr | 2 +- .../bad-url-token/escaped/span.swc-stderr | 2 +- .../invalid-escape/span.swc-stderr | 2 +- .../left-parenthesis/span.swc-stderr | 2 +- .../single-quotes/span.swc-stderr | 2 +- .../whitespace-in-middle/span.swc-stderr | 2 +- .../bad-url-token/whitespace/span.swc-stderr | 2 +- .../recovery/cdo-and-cdc/span.swc-stderr | 54 +- .../comments/bad-comment-1/span.swc-stderr | 8 +- .../comments/declaration/span.swc-stderr | 8 +- .../declaration/bad-value-1/span.swc-stderr | 2 +- .../declaration/bad-value-2/span.swc-stderr | 2 +- .../declaration/bad-value/span.swc-stderr | 42 +- .../declaration/basic/span.swc-stderr | 6 +- .../declaration/important-1/span.swc-stderr | 8 +- .../declaration/important/span.swc-stderr | 100 +-- .../declaration/wrong-name-3/span.swc-stderr | 2 +- .../declaration/wrong-name/span.swc-stderr | 6 +- .../delim-token/ampersand/span.swc-stderr | 2 +- .../delim-token/asterisk/span.swc-stderr | 2 +- .../delim-token/at-sign/span.swc-stderr | 6 +- .../recovery/delim-token/bang/span.swc-stderr | 4 +- .../recovery/delim-token/bar/span.swc-stderr | 2 +- .../delim-token/caret/span.swc-stderr | 2 +- .../delim-token/dollar/span.swc-stderr | 2 +- .../delim-token/equals/span.swc-stderr | 2 +- .../delim-token/greater-than/span.swc-stderr | 2 +- .../recovery/delim-token/hash/span.swc-stderr | 4 +- .../delim-token/less-than/span.swc-stderr | 2 +- .../delim-token/minus/span.swc-stderr | 22 +- .../delim-token/percent/span.swc-stderr | 2 +- .../recovery/delim-token/plus/span.swc-stderr | 22 +- .../delim-token/question-mark/span.swc-stderr | 2 +- .../recovery/delim-token/star/span.swc-stderr | 2 +- .../delim-token/tilde/span.swc-stderr | 2 +- .../escaped/declaration-value/span.swc-stderr | 4 +- .../escaped/id-selector/span.swc-stderr | 4 +- .../function/bad-comment-2/span.swc-stderr | 2 +- .../function/bad-comment/span.swc-stderr | 2 +- .../recovery/function/base/span.swc-stderr | 36 +- .../function/calc/space/span.swc-stderr | 4 +- .../function/nested-unclosed/span.swc-stderr | 4 +- .../recovery/function/rgb/span.swc-stderr | 94 +-- .../function/unclosed-2/span.swc-stderr | 14 +- .../function/unclosed/span.swc-stderr | 6 +- .../tests/recovery/hacks/span.swc-stderr | 230 +++--- .../tests/recovery/ie-progid/span.swc-stderr | 62 +- .../tests/recovery/number/span.swc-stderr | 26 +- .../qualified-rule/basic/span.swc-stderr | 14 +- .../double-slash-comment/span.swc-stderr | 14 +- .../rules/at-rule-in-middle/span.swc-stderr | 6 +- .../rules/at-rule-with-semi/span.swc-stderr | 6 +- .../rules/unclosed-brackets/span.swc-stderr | 48 +- .../rules/unclosed-curly/span.swc-stderr | 8 +- .../invalid-matcher-1/span.swc-stderr | 6 +- .../invalid-matcher-2/span.swc-stderr | 10 +- .../invalid-matcher-3/span.swc-stderr | 24 +- .../invalid-matcher-4/span.swc-stderr | 12 +- .../attribute/invalid-matcher/span.swc-stderr | 10 +- .../invalid-modifier/span.swc-stderr | 12 +- .../attribute/unclosed/span.swc-stderr | 14 +- .../selector/combinator/only/span.swc-stderr | 4 +- .../selector/combinator/two/span.swc-stderr | 12 +- .../selector/id/invalid/span.swc-stderr | 4 +- .../recovery/selector/list/span.swc-stderr | 2 +- .../pseudo-class/an-plus-b/span.swc-stderr | 2 +- .../invalid-function/span.swc-stderr | 6 +- .../invalid-ident/span.swc-stderr | 6 +- .../pseudo-class/invalid/span.swc-stderr | 16 +- .../pseudo-element/after/span.swc-stderr | 6 +- .../pseudo-element/between/span.swc-stderr | 6 +- .../pseudo-element/invalid/span.swc-stderr | 6 +- .../basic/span.swc-stderr | 36 +- .../invalid-nested-1/span.swc-stderr | 16 +- .../invalid-nested-2/span.swc-stderr | 6 +- .../invalid-nested/span.swc-stderr | 6 +- .../recovery/styled-jsx/1/span.swc-stderr | 36 +- .../recovery/styled-jsx/2/span.swc-stderr | 12 +- .../recovery/unicode-range/span.swc-stderr | 8 +- .../value/at-keyword/1/span.swc-stderr | 2 +- .../value/at-keyword/2/span.swc-stderr | 2 +- .../value/at-keyword/3/span.swc-stderr | 2 +- .../value/at-keyword/4/span.swc-stderr | 2 +- .../value/at-keyword/5/span.swc-stderr | 2 +- .../value/at-keyword/6/span.swc-stderr | 2 +- .../value/at-keyword/7/span.swc-stderr | 2 +- .../exclamation/span.swc-stderr | 14 +- .../only-dashed/span.swc-stderr | 14 +- .../recovery/value/hash/eof/span.swc-stderr | 2 +- .../recovery/value/number/dot/span.swc-stderr | 4 +- .../value/number/minus-dot/span.swc-stderr | 4 +- .../value/number/plus-dot/span.swc-stderr | 4 +- .../value/percentage/dot/span.swc-stderr | 6 +- .../value/percentage/minus/span.swc-stderr | 6 +- .../value/percentage/plus/span.swc-stderr | 6 +- .../recovery/value/quotes/span.swc-stderr | 8 +- .../value/string/escaped/eof/span.swc-stderr | 2 +- .../value/string/newline/span.swc-stderr | 2 +- .../recovery/value/url/basic/span.swc-stderr | 12 +- .../value/url/parenthesis/span.swc-stderr | 2 +- .../tests/recovery/vercel/001/span.swc-stderr | 4 +- .../tests/recovery/vercel/002/span.swc-stderr | 10 +- .../tests/recovery/vercel/003/span.swc-stderr | 12 +- .../tests/recovery/vercel/004/span.swc-stderr | 18 +- .../tests/recovery/vercel/005/span.swc-stderr | 18 +- 190 files changed, 2220 insertions(+), 2129 deletions(-) diff --git a/crates/swc_css_ast/src/token.rs b/crates/swc_css_ast/src/token.rs index 86bd1a20b16d..5b336592e7b3 100644 --- a/crates/swc_css_ast/src/token.rs +++ b/crates/swc_css_ast/src/token.rs @@ -35,6 +35,99 @@ pub enum NumberType { Number, } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, EqIgnoreSpan)] +pub struct IdentToken { + #[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))] + pub value: JsWord, + pub raw: Atom, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, EqIgnoreSpan)] +pub struct FunctionToken { + #[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))] + pub value: JsWord, + pub raw: Atom, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, EqIgnoreSpan)] +pub struct AtKeywordToken { + #[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))] + pub value: JsWord, + pub raw: Atom, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, EqIgnoreSpan)] +pub struct HashToken { + pub is_id: bool, + #[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))] + pub value: JsWord, + pub raw: Atom, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, EqIgnoreSpan)] +pub struct StringToken { + #[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))] + pub value: JsWord, + pub raw: Atom, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, EqIgnoreSpan)] +pub struct BadStringToken { + pub raw: Atom, +} + +/// `url(value)` +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, EqIgnoreSpan)] +pub struct UrlToken { + #[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))] + pub name: JsWord, + #[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))] + pub value: JsWord, + /// Name and value + pub raw: Box<(Atom, Atom)>, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, EqIgnoreSpan)] +pub struct BadUrlToken { + /// Name and value + pub raw: Box<(Atom, Atom)>, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, EqIgnoreSpan)] +pub struct DelimToken { + pub value: char, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, EqIgnoreSpan)] +pub struct NumberToken { + pub value: f64, + pub raw: Atom, + #[serde(rename = "type")] + pub type_flag: NumberType, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, EqIgnoreSpan)] +pub struct PercentageToken { + pub value: f64, + pub raw: Atom, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, EqIgnoreSpan)] +pub struct DimensionToken { + pub value: f64, + #[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))] + pub unit: JsWord, + #[serde(rename = "type")] + pub type_flag: NumberType, + /// Value and unit + pub raw: Box<(Atom, Atom)>, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, EqIgnoreSpan)] +pub struct WhiteSpaceToken { + pub value: Atom, +} + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, EqIgnoreSpan)] #[cfg_attr( feature = "rkyv", @@ -49,119 +142,43 @@ pub enum NumberType { )) )] pub enum Token { - Ident { - #[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))] - value: JsWord, - raw: Atom, - }, - - Function { - #[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))] - value: JsWord, - raw: Atom, - }, - + Ident(Box), + Function(Box), /// `@` - AtKeyword { - #[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))] - value: JsWord, - raw: Atom, - }, - + AtKeyword(Box), /// `#` - Hash { - is_id: bool, - #[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))] - value: JsWord, - raw: Atom, - }, - - String { - #[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))] - value: JsWord, - raw: Atom, - }, - - BadString { - raw: Atom, - }, - + Hash(Box), + String(Box), + BadString(Box), /// `url(value)` - Url { - #[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))] - name: JsWord, - #[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))] - value: JsWord, - /// Name and value - raw: Box<(Atom, Atom)>, - }, - - BadUrl { - /// Name and value - raw: Box<(Atom, Atom)>, - }, - - Delim { - value: char, - }, - - Number { - value: f64, - raw: Atom, - #[serde(rename = "type")] - type_flag: NumberType, - }, - - Percentage { - value: f64, - raw: Atom, - }, - - Dimension { - value: f64, - #[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))] - unit: JsWord, - #[serde(rename = "type")] - type_flag: NumberType, - /// Value and unit - raw: Box<(Atom, Atom)>, - }, - + Url(Box), + BadUrl(Box), + Delim(Box), + Number(Box), + Percentage(Box), + Dimension(Box), /// One or more whitespace. - WhiteSpace { - value: Atom, - }, - + WhiteSpace(Box), /// `` CDC, - /// `:`` Colon, - /// `;` Semi, - /// `,` Comma, - /// `[` LBracket, - /// `]` RBracket, - /// `(` LParen, - /// `)` RParen, - /// `{` LBrace, - /// `}` RBrace, } @@ -185,58 +202,58 @@ impl Hash for Token { } match self { - Token::Ident { value, raw } - | Token::Function { value, raw } - | Token::AtKeyword { value, raw } - | Token::String { value, raw } => { - value.hash(state); - raw.hash(state); + Token::Ident(ident) => { + ident.value.hash(state); + ident.raw.hash(state); + } + Token::Function(function) => { + function.value.hash(state); + function.raw.hash(state); + } + Token::AtKeyword(at_keyword) => { + at_keyword.value.hash(state); + at_keyword.raw.hash(state); + } + Token::String(string) => { + string.value.hash(state); + string.raw.hash(state); } - Token::BadString { raw } => { - raw.hash(state); + Token::BadString(bad_string) => { + bad_string.raw.hash(state); } - Token::Hash { value, raw, is_id } => { - value.hash(state); - raw.hash(state); - is_id.hash(state); + Token::Hash(hash) => { + hash.value.hash(state); + hash.raw.hash(state); + hash.is_id.hash(state); } - Token::Url { name, value, raw } => { - name.hash(state); - value.hash(state); - raw.hash(state); + Token::Url(url) => { + url.name.hash(state); + url.value.hash(state); + url.raw.hash(state); } - Token::BadUrl { raw } => { - raw.hash(state); + Token::BadUrl(bad_url) => { + bad_url.raw.hash(state); } - Token::Delim { value } => { - value.hash(state); + Token::Delim(delim) => { + delim.value.hash(state); } - Token::Number { - value, - raw, - type_flag, - } => { - integer_decode(*value).hash(state); - raw.hash(state); - type_flag.hash(state); + Token::Number(number) => { + integer_decode(number.value).hash(state); + number.raw.hash(state); + number.type_flag.hash(state); } - Token::Percentage { value, raw } => { - integer_decode(*value).hash(state); - raw.hash(state); + Token::Percentage(percentage) => { + integer_decode(percentage.value).hash(state); + percentage.raw.hash(state); } - Token::Dimension { - value, - unit, - type_flag, - raw, - } => { - integer_decode(*value).hash(state); - unit.hash(state); - type_flag.hash(state); - raw.hash(state); + Token::Dimension(dimension) => { + integer_decode(dimension.value).hash(state); + dimension.unit.hash(state); + dimension.type_flag.hash(state); + dimension.raw.hash(state); } - Token::WhiteSpace { value } => { - value.hash(state); + Token::WhiteSpace(white_space) => { + white_space.value.hash(state); } Token::CDO | Token::CDC diff --git a/crates/swc_css_parser/src/lexer/mod.rs b/crates/swc_css_parser/src/lexer/mod.rs index f029f8aa902d..3db1e93d65ee 100644 --- a/crates/swc_css_parser/src/lexer/mod.rs +++ b/crates/swc_css_parser/src/lexer/mod.rs @@ -2,7 +2,11 @@ use std::{cell::RefCell, char::REPLACEMENT_CHARACTER, rc::Rc}; use swc_atoms::{js_word, Atom, JsWord}; use swc_common::{input::Input, BytePos, Span}; -use swc_css_ast::{NumberType, Token, TokenAndSpan}; +use swc_css_ast::{ + AtKeywordToken, BadStringToken, BadUrlToken, DelimToken, DimensionToken, FunctionToken, + HashToken, IdentToken, NumberToken, NumberType, PercentageToken, StringToken, Token, + TokenAndSpan, WhiteSpaceToken, +}; use crate::{ error::{Error, ErrorKind}, @@ -253,9 +257,9 @@ where } } - return Ok(Token::WhiteSpace { + return Ok(Token::WhiteSpace(Box::new(WhiteSpaceToken { value: (&**buf).into(), - }); + }))); }), // U+0022 QUOTATION MARK (") // Consume a string token and return it. @@ -271,11 +275,11 @@ where || self.is_valid_escape(first, second)? { // Create a . - let mut hash_token = Token::Hash { + let mut hash_token = Token::Hash(Box::new(HashToken { is_id: Default::default(), value: Default::default(), raw: Default::default(), - }; + })); // If the next 3 input code points would start an identifier, set the // ’s type flag to "id". @@ -283,7 +287,7 @@ where let is_would_start_ident = self.would_start_ident(first, second, third)?; match hash_token { - Token::Hash { ref mut is_id, .. } => { + Token::Hash(box HashToken { ref mut is_id, .. }) => { *is_id = is_would_start_ident; } _ => { @@ -295,11 +299,11 @@ where let ident_sequence = self.read_ident_sequence()?; match hash_token { - Token::Hash { + Token::Hash(box HashToken { ref mut value, ref mut raw, .. - } => { + }) => { *value = ident_sequence.0; *raw = ident_sequence.1; } @@ -312,7 +316,7 @@ where return Ok(hash_token); } - Ok(Token::Delim { value: '#' }) + Ok(Token::Delim(Box::new(DelimToken { value: '#' }))) } // U+0027 APOSTROPHE (') // Consume a string token and return it. @@ -335,7 +339,7 @@ where // Otherwise, return a with its value set to the current input // code point. - Ok(Token::Delim { value: '+' }) + Ok(Token::Delim(Box::new(DelimToken { value: '+' }))) } // U+002C COMMA (,) // Return a . @@ -367,7 +371,7 @@ where // Otherwise, return a with its value set to the current input // code point. - Ok(Token::Delim { value: '-' }) + Ok(Token::Delim(Box::new(DelimToken { value: '-' }))) } // U+002E FULL STOP (.) Some('.') => { @@ -381,7 +385,7 @@ where // Otherwise, return a with its value set to the current input // code point. - Ok(Token::Delim { value: '.' }) + Ok(Token::Delim(Box::new(DelimToken { value: '.' }))) } // U+003A COLON (:) // Return a . @@ -407,7 +411,7 @@ where // Otherwise, return a with its value set to the current input // code point. - Ok(Token::Delim { value: '<' }) + Ok(Token::Delim(Box::new(DelimToken { value: '<' }))) } // U+0040 COMMERCIAL AT (@) Some('@') => { @@ -421,15 +425,15 @@ where if self.would_start_ident(first, second, third)? { let ident_sequence = self.read_ident_sequence()?; - return Ok(Token::AtKeyword { + return Ok(Token::AtKeyword(Box::new(AtKeywordToken { value: ident_sequence.0, raw: ident_sequence.1, - }); + }))); } // Otherwise, return a with its value set to the current input // code point. - Ok(Token::Delim { value: '@' }) + Ok(Token::Delim(Box::new(DelimToken { value: '@' }))) } // U+005B LEFT SQUARE BRACKET ([) // Return a <[-token>. @@ -448,7 +452,7 @@ where // to the current input code point. self.emit_error(ErrorKind::InvalidEscape); - Ok(Token::Delim { value: '\\' }) + Ok(Token::Delim(Box::new(DelimToken { value: '\\' }))) } // U+005D RIGHT SQUARE BRACKET (]) // Return a <]-token>. @@ -478,7 +482,7 @@ where None => Err(ErrorKind::Eof), // anything else // Return a with its value set to the current input code point. - Some(c) => Ok(Token::Delim { value: c }), + Some(c) => Ok(Token::Delim(Box::new(DelimToken { value: c }))), } } @@ -561,12 +565,12 @@ where let ident_sequence = self.read_ident_sequence()?; // Create a with the same value and type flag as number, and a // unit set initially to the empty string. - let token = Token::Dimension { + let token = Token::Dimension(Box::new(DimensionToken { value: number.0, unit: ident_sequence.0, type_flag: number.2, raw: Box::new((number.1, ident_sequence.1)), - }; + })); // Return the . return Ok(token); @@ -576,19 +580,19 @@ where else if next_first == Some('%') { self.consume(); - return Ok(Token::Percentage { + return Ok(Token::Percentage(Box::new(PercentageToken { value: number.0, raw: number.1, - }); + }))); } // Otherwise, create a with the same value and type flag as // number, and return it. - Ok(Token::Number { + Ok(Token::Number(Box::new(NumberToken { value: number.0, raw: number.1, type_flag: number.2, - }) + }))) } // This section describes how to consume an ident-like token from a stream of @@ -634,16 +638,16 @@ where // should not be part of token self.last_pos = Some(start_whitespace); - return Ok(Token::Function { + return Ok(Token::Function(Box::new(FunctionToken { value: ident_sequence.0, raw: ident_sequence.1, - }); + }))); } Some('"' | '\'') => { - return Ok(Token::Function { + return Ok(Token::Function(Box::new(FunctionToken { value: ident_sequence.0, raw: ident_sequence.1, - }); + }))); } // Otherwise, consume a url token, and return it. _ => { @@ -656,18 +660,18 @@ where else if self.next() == Some('(') { self.consume(); - return Ok(Token::Function { + return Ok(Token::Function(Box::new(FunctionToken { value: ident_sequence.0, raw: ident_sequence.1, - }); + }))); } // Otherwise, create an with its value set to string and return // it. - Ok(Token::Ident { + Ok(Token::Ident(Box::new(IdentToken { value: ident_sequence.0, raw: ident_sequence.1, - }) + }))) } // This section describes how to consume a string token from a stream of code @@ -702,10 +706,10 @@ where None => { l.emit_error(ErrorKind::UnterminatedString); - return Ok(Token::String { + return Ok(Token::String(Box::new(StringToken { value: (&**buf).into(), raw: (&**raw).into(), - }); + }))); } // Newline @@ -715,9 +719,9 @@ where l.emit_error(ErrorKind::NewlineInString); l.reconsume(); - return Ok(Token::BadString { + return Ok(Token::BadString(Box::new(BadStringToken { raw: (&**raw).into(), - }); + }))); } // U+005C REVERSE SOLIDUS (\) @@ -756,10 +760,10 @@ where } } - Ok(Token::String { + Ok(Token::String(Box::new(StringToken { value: (&**buf).into(), raw: (&**raw).into(), - }) + }))) }) } @@ -789,11 +793,11 @@ where // U+0029 RIGHT PARENTHESIS ()) // Return the . Some(')') => { - return Ok(Token::Url { + return Ok(Token::Url(Box::new(swc_css_ast::UrlToken { name: name.0, value: (&**out).into(), raw: Box::new((name.1, (&**raw).into())), - }); + }))); } // EOF @@ -801,11 +805,11 @@ where None => { l.emit_error(ErrorKind::UnterminatedUrl); - return Ok(Token::Url { + return Ok(Token::Url(Box::new(swc_css_ast::UrlToken { name: name.0, value: (&**out).into(), raw: Box::new((name.1, (&**raw).into())), - }); + }))); } // whitespace @@ -836,22 +840,22 @@ where raw.push_str(&whitespaces); - return Ok(Token::Url { + return Ok(Token::Url(Box::new(swc_css_ast::UrlToken { name: name.0, value: (&**out).into(), raw: Box::new((name.1, (&**raw).into())), - }); + }))); } None => { l.emit_error(ErrorKind::UnterminatedUrl); raw.push_str(&whitespaces); - return Ok(Token::Url { + return Ok(Token::Url(Box::new(swc_css_ast::UrlToken { name: name.0, value: (&**out).into(), raw: Box::new((name.1, (&**raw).into())), - }); + }))); } _ => {} } @@ -866,9 +870,9 @@ where out.push_str(&remnants.0); raw.push_str(&remnants.1); - return Ok(Token::BadUrl { + return Ok(Token::BadUrl(Box::new(BadUrlToken { raw: Box::new((name.1, (&**raw).into())), - }); + }))); } // U+0022 QUOTATION MARK (") @@ -887,9 +891,9 @@ where raw.push(c); raw.push_str(&remnants.1); - return Ok(Token::BadUrl { + return Ok(Token::BadUrl(Box::new(swc_css_ast::BadUrlToken { raw: Box::new((name.1, (&**raw).into())), - }); + }))); } // U+005C REVERSE SOLIDUS (\) @@ -916,9 +920,9 @@ where raw.push(c); raw.push_str(&remnants.1); - return Ok(Token::BadUrl { + return Ok(Token::BadUrl(Box::new(swc_css_ast::BadUrlToken { raw: Box::new((name.1, (&**raw).into())), - }); + }))); } } diff --git a/crates/swc_css_parser/src/macros.rs b/crates/swc_css_parser/src/macros.rs index 136e148a2cea..02d0d597d7db 100644 --- a/crates/swc_css_parser/src/macros.rs +++ b/crates/swc_css_parser/src/macros.rs @@ -32,7 +32,7 @@ macro_rules! tok { }; ("bad-url") => { - swc_css_ast::Token::BadUrl { .. } + swc_css_ast::Token::BadUrl(_) }; ("[") => { @@ -52,11 +52,7 @@ macro_rules! tok { }; ("%") => { - swc_css_ast::Token::Delim { value: '%', .. } - }; - - ("--") => { - swc_css_ast::Token::MinusMinus + swc_css_ast::Token::Delim(box DelimToken { value: '%', .. }) }; (",") => { @@ -68,11 +64,11 @@ macro_rules! tok { }; ("!") => { - swc_css_ast::Token::Delim { value: '!', .. } + swc_css_ast::Token::Delim(box DelimToken { value: '!', .. }) }; ("?") => { - swc_css_ast::Token::Delim { value: '?', .. } + swc_css_ast::Token::Delim(box DelimToken { value: '?', .. }) }; ("{") => { @@ -96,7 +92,7 @@ macro_rules! tok { }; ("*") => { - swc_css_ast::Token::Delim { value: '*', .. } + swc_css_ast::Token::Delim(box DelimToken { value: '*', .. }) }; ("@") => { @@ -108,27 +104,27 @@ macro_rules! tok { }; ("&") => { - swc_css_ast::Token::Delim { value: '&', .. } + swc_css_ast::Token::Delim(box DelimToken { value: '&', .. }) }; ("|") => { - swc_css_ast::Token::Delim { value: '|', .. } + swc_css_ast::Token::Delim(box DelimToken { value: '|', .. }) }; ("$") => { - swc_css_ast::Token::Delim { value: '$', .. } + swc_css_ast::Token::Delim(box DelimToken { value: '$', .. }) }; ("^") => { - swc_css_ast::Token::Delim { value: '^', .. } + swc_css_ast::Token::Delim(box DelimToken { value: '^', .. }) }; ("~") => { - swc_css_ast::Token::Delim { value: '~', .. } + swc_css_ast::Token::Delim(box DelimToken { value: '~', .. }) }; ("=") => { - swc_css_ast::Token::Delim { value: '=', .. } + swc_css_ast::Token::Delim(box DelimToken { value: '=', .. }) }; (" ") => { @@ -144,26 +140,26 @@ macro_rules! tok { }; ("+") => { - swc_css_ast::Token::Delim { value: '+', .. } + swc_css_ast::Token::Delim(box DelimToken { value: '+', .. }) }; ("-") => { - swc_css_ast::Token::Delim { value: '-', .. } + swc_css_ast::Token::Delim(box DelimToken { value: '-', .. }) }; (".") => { - swc_css_ast::Token::Delim { value: '.', .. } + swc_css_ast::Token::Delim(box DelimToken { value: '.', .. }) }; ("/") => { - swc_css_ast::Token::Delim { value: '/', .. } + swc_css_ast::Token::Delim(box DelimToken { value: '/', .. }) }; ("<") => { - swc_css_ast::Token::Delim { value: '<', .. } + swc_css_ast::Token::Delim(box DelimToken { value: '<', .. }) }; (">") => { - swc_css_ast::Token::Delim { value: '>', .. } + swc_css_ast::Token::Delim(box DelimToken { value: '>', .. }) }; } diff --git a/crates/swc_css_parser/src/parser/at_rules/mod.rs b/crates/swc_css_parser/src/parser/at_rules/mod.rs index a11790188ea2..b78c0365f82a 100644 --- a/crates/swc_css_parser/src/parser/at_rules/mod.rs +++ b/crates/swc_css_parser/src/parser/at_rules/mod.rs @@ -31,7 +31,7 @@ where self.input.skip_ws(); let name = match cur!(self) { - Token::Ident { value, .. } => { + Token::Ident(box IdentToken { value, .. }) => { if value.starts_with("--") { ColorProfileName::DashedIdent(self.parse()?) } else { @@ -175,14 +175,16 @@ where let layer_name = if !is!(self, EOF) { match cur!(self) { - Token::Ident { value, .. } if *value.to_ascii_lowercase() == *"layer" => { + Token::Ident(box IdentToken { value, .. }) + if *value.to_ascii_lowercase() == *"layer" => + { let name = ImportLayerName::Ident(self.parse()?); self.input.skip_ws(); Some(Box::new(name)) } - Token::Function { value, .. } + Token::Function(box FunctionToken { value, .. }) if *value.to_ascii_lowercase() == *"layer" => { let ctx = Ctx { @@ -772,7 +774,9 @@ where let supports = if !is!(self, EOF) { match cur!(self) { - Token::Function { value, .. } if *value.to_ascii_lowercase() == *"supports" => { + Token::Function(box FunctionToken { value, .. }) + if *value.to_ascii_lowercase() == *"supports" => + { let ctx = Ctx { in_import_at_rule: true, ..self.ctx @@ -819,13 +823,13 @@ where bump!(self); match cur!(self) { - Token::Function { value, .. } + Token::Function(box FunctionToken { value, .. }) if (&*value.to_ascii_lowercase() == "local" || &*value.to_ascii_lowercase() == "global") => { let span = self.input.cur_span(); let pseudo = match bump!(self) { - Token::Function { value, raw, .. } => Ident { + Token::Function(box FunctionToken { value, raw }) => Ident { span: span!(self, span.lo), value, raw: Some(raw), @@ -851,7 +855,7 @@ where }, ))) } - Token::Ident { value, .. } + Token::Ident(box IdentToken { value, .. }) if (&*value.to_ascii_lowercase() == "local" || &*value.to_ascii_lowercase() == "global") => { @@ -1022,7 +1026,9 @@ where fn parse(&mut self) -> PResult { let span = self.input.cur_span(); let keyword = match cur!(self) { - Token::Ident { value, .. } if value.as_ref().eq_ignore_ascii_case("not") => { + Token::Ident(box IdentToken { value, .. }) + if value.as_ref().eq_ignore_ascii_case("not") => + { Some(self.parse()?) } _ => { @@ -1052,7 +1058,9 @@ where fn parse(&mut self) -> PResult { let span = self.input.cur_span(); let keyword = match cur!(self) { - Token::Ident { value, .. } if value.as_ref().eq_ignore_ascii_case("and") => { + Token::Ident(box IdentToken { value, .. }) + if value.as_ref().eq_ignore_ascii_case("and") => + { Some(self.parse()?) } _ => { @@ -1082,7 +1090,9 @@ where fn parse(&mut self) -> PResult { let span = self.input.cur_span(); let keyword = match cur!(self) { - Token::Ident { value, .. } if value.as_ref().eq_ignore_ascii_case("or") => { + Token::Ident(box IdentToken { value, .. }) + if value.as_ref().eq_ignore_ascii_case("or") => + { Some(self.parse()?) } _ => { @@ -1176,7 +1186,9 @@ where Ok(SupportsFeature::Declaration(Box::new(declaration))) } - Token::Function { value, .. } if &*value.to_ascii_lowercase() == "selector" => { + Token::Function(box FunctionToken { value, .. }) + if &*value.to_ascii_lowercase() == "selector" => + { // TODO improve me let ctx = Ctx { in_supports_at_rule: true, @@ -1276,10 +1288,10 @@ where fn parse(&mut self) -> PResult { match cur!(self) { tok!("url") => Ok(DocumentPreludeMatchingFunction::Url(self.parse()?)), - Token::Function { + Token::Function(box FunctionToken { value: function_name, .. - } => { + }) => { if &*function_name.to_ascii_lowercase() == "url" || &*function_name.to_ascii_lowercase() == "src" { @@ -1544,7 +1556,9 @@ where fn parse(&mut self) -> PResult { let span = self.input.cur_span(); let keyword = match cur!(self) { - Token::Ident { value, .. } if value.as_ref().eq_ignore_ascii_case("not") => { + Token::Ident(box IdentToken { value, .. }) + if value.as_ref().eq_ignore_ascii_case("not") => + { Some(self.parse()?) } _ => { @@ -1574,7 +1588,9 @@ where fn parse(&mut self) -> PResult { let span = self.input.cur_span(); let keyword = match cur!(self) { - Token::Ident { value, .. } if value.as_ref().eq_ignore_ascii_case("and") => { + Token::Ident(box IdentToken { value, .. }) + if value.as_ref().eq_ignore_ascii_case("and") => + { Some(self.parse()?) } _ => { @@ -1604,7 +1620,9 @@ where fn parse(&mut self) -> PResult { let span = self.input.cur_span(); let keyword = match cur!(self) { - Token::Ident { value, .. } if value.as_ref().eq_ignore_ascii_case("or") => { + Token::Ident(box IdentToken { value, .. }) + if value.as_ref().eq_ignore_ascii_case("or") => + { Some(self.parse()?) } _ => { @@ -1865,7 +1883,7 @@ where } tok!("ident") => Ok(MediaFeatureValue::Ident(self.parse()?)), tok!("dimension") => Ok(MediaFeatureValue::Dimension(self.parse()?)), - Token::Function { value, .. } if is_math_function(value) => { + Token::Function(box FunctionToken { value, .. }) if is_math_function(value) => { let function = self.parse()?; Ok(MediaFeatureValue::Function(function)) @@ -1984,7 +2002,7 @@ where expect!(self, ":"); let value = match cur!(self) { - Token::Ident { value, .. } + Token::Ident(box IdentToken { value, .. }) if matches!( &*value.to_ascii_lowercase(), "left" | "right" | "first" | "blank" @@ -2141,7 +2159,9 @@ where fn parse(&mut self) -> PResult { let span = self.input.cur_span(); let keyword = match cur!(self) { - Token::Ident { value, .. } if value.as_ref().eq_ignore_ascii_case("not") => { + Token::Ident(box IdentToken { value, .. }) + if value.as_ref().eq_ignore_ascii_case("not") => + { Some(self.parse()?) } _ => { @@ -2171,7 +2191,9 @@ where fn parse(&mut self) -> PResult { let span = self.input.cur_span(); let keyword = match cur!(self) { - Token::Ident { value, .. } if value.as_ref().eq_ignore_ascii_case("and") => { + Token::Ident(box IdentToken { value, .. }) + if value.as_ref().eq_ignore_ascii_case("and") => + { Some(self.parse()?) } _ => { @@ -2201,7 +2223,9 @@ where fn parse(&mut self) -> PResult { let span = self.input.cur_span(); let keyword = match cur!(self) { - Token::Ident { value, .. } if value.as_ref().eq_ignore_ascii_case("or") => { + Token::Ident(box IdentToken { value, .. }) + if value.as_ref().eq_ignore_ascii_case("or") => + { Some(self.parse()?) } _ => { @@ -2458,7 +2482,7 @@ where } tok!("ident") => Ok(SizeFeatureValue::Ident(self.parse()?)), tok!("dimension") => Ok(SizeFeatureValue::Dimension(self.parse()?)), - Token::Function { value, .. } if is_math_function(value) => { + Token::Function(box FunctionToken { value, .. }) if is_math_function(value) => { let function = self.parse()?; Ok(SizeFeatureValue::Function(function)) @@ -2483,7 +2507,7 @@ where } match bump!(self) { - Token::Ident { value, raw } => { + Token::Ident(box IdentToken { value, raw, .. }) => { if !value.starts_with("--") { return Err(Error::new( span, diff --git a/crates/swc_css_parser/src/parser/input.rs b/crates/swc_css_parser/src/parser/input.rs index 3ef45f9a4f0c..d349920fea90 100644 --- a/crates/swc_css_parser/src/parser/input.rs +++ b/crates/swc_css_parser/src/parser/input.rs @@ -2,7 +2,7 @@ use std::{fmt::Debug, mem::take}; use swc_atoms::{Atom, JsWord}; use swc_common::{BytePos, Span, Spanned, SyntaxContext}; -use swc_css_ast::{ComponentValue, ListOfComponentValues, Token, TokenAndSpan}; +use swc_css_ast::{ComponentValue, FunctionToken, ListOfComponentValues, Token, TokenAndSpan}; use super::PResult; use crate::error::{Error, ErrorKind}; @@ -371,10 +371,10 @@ impl<'a> Input<'a> { TokenOrBlock::Token(token_and_span) => *token_and_span, TokenOrBlock::Function(function) => TokenAndSpan { span: function.0, - token: Token::Function { + token: Token::Function(Box::new(FunctionToken { value: function.1, raw: function.2, - }, + })), }, TokenOrBlock::LBracket(span) => TokenAndSpan { span: *span, diff --git a/crates/swc_css_parser/src/parser/macros.rs b/crates/swc_css_parser/src/parser/macros.rs index 5914f0db9725..69a38423de4c 100644 --- a/crates/swc_css_parser/src/parser/macros.rs +++ b/crates/swc_css_parser/src/parser/macros.rs @@ -7,7 +7,7 @@ macro_rules! span { macro_rules! tok_pat { (Ident) => { - swc_css_ast::Token::Ident { .. } + swc_css_ast::Token::Ident(box IdentToken { .. }) }; (Percentage) => { @@ -94,7 +94,7 @@ macro_rules! bump { macro_rules! is_case_insensitive_ident { ($parser:expr, $tt:tt) => {{ match $parser.input.cur() { - Some(swc_css_ast::Token::Ident { value, .. }) + Some(swc_css_ast::Token::Ident(box IdentToken { value, .. })) if &*value.to_ascii_lowercase() == $tt => { true @@ -107,7 +107,7 @@ macro_rules! is_case_insensitive_ident { macro_rules! is_one_of_case_insensitive_ident { ($parser:expr, $($tt:tt),+) => { match $parser.input.cur() { - Some(swc_css_ast::Token::Ident { value, .. }) => { + Some(swc_css_ast::Token::Ident(box IdentToken { value, .. })) => { let lowercased = &*value.to_ascii_lowercase(); if $(lowercased == $tt)||* { diff --git a/crates/swc_css_parser/src/parser/selectors/mod.rs b/crates/swc_css_parser/src/parser/selectors/mod.rs index 3da7cce95f51..d5d41b987b3f 100644 --- a/crates/swc_css_parser/src/parser/selectors/mod.rs +++ b/crates/swc_css_parser/src/parser/selectors/mod.rs @@ -534,7 +534,7 @@ where name, })); } - Token::Delim { value, .. } if *value == '*' => { + Token::Delim(box DelimToken { value, .. }) if *value == '*' => { bump!(self); namespace = Some(Namespace::Any(AnyNamespace { @@ -618,9 +618,9 @@ where fn parse(&mut self) -> PResult { let span = self.input.cur_span(); let text = match bump!(self) { - Token::Hash { + Token::Hash(box HashToken { is_id, value, raw, .. - } => { + }) => { if !is_id { return Err(Error::new( span, @@ -845,7 +845,7 @@ where let fn_span = self.input.cur_span(); let name = bump!(self); let names = match name { - Token::Function { value, raw } => (value, raw), + Token::Function(box FunctionToken { value, raw }) => (value, raw), _ => unreachable!(), }; let state = self.input.state(); @@ -1073,7 +1073,7 @@ where let fn_span = self.input.cur_span(); let name = bump!(self); let names = match name { - Token::Function { value, raw } => (value, raw), + Token::Function(box FunctionToken { value, raw }) => (value, raw), _ => unreachable!(), }; let state = self.input.state(); @@ -1186,7 +1186,7 @@ where match cur!(self) { // odd | even - Token::Ident { value, .. } + Token::Ident(box IdentToken { value, .. }) if &(*value).to_ascii_lowercase() == "odd" || &(*value).to_ascii_lowercase() == "even" => { @@ -1195,7 +1195,7 @@ where // tok!("number") => { let number = match bump!(self) { - Token::Number { value, raw, .. } => (value, raw), + Token::Number(box NumberToken { value, raw, .. }) => (value, raw), _ => { unreachable!(); } @@ -1229,7 +1229,7 @@ where let mut has_plus_sign = false; // '+' n - if let Token::Delim { value: '+' } = cur!(self){ + if let Token::Delim(box DelimToken { value: '+' }) = cur!(self){ let peeked = self.input.peek(); if let Some(Token::Ident { .. }) = peeked { @@ -1245,7 +1245,7 @@ where match cur!(self) { Token::Ident { .. } => { let ident_value = match bump!(self) { - Token::Ident { value, .. } => value, + Token::Ident(box IdentToken { value, .. }) => value, _ => { unreachable!(); } @@ -1268,7 +1268,7 @@ where } tok!("dimension") => { let dimension = match bump!(self) { - Token::Dimension { value, raw, unit, .. } => (value, raw, unit), + Token::Dimension(box DimensionToken { value, unit, raw, .. }) => (value, raw, unit), _ => { unreachable!(); } @@ -1306,7 +1306,7 @@ where // tok!("number") if dash_after_n.is_none() => { let number = match bump!(self) { - Token::Number { value, raw, .. } => (value, raw), + Token::Number(box NumberToken { value, raw, .. }) => (value, raw), _ => { unreachable!(); } @@ -1320,7 +1320,7 @@ where // tok!("number") if dash_after_n == Some('-') => { let number = match bump!(self) { - Token::Number { value, raw, .. } => (value, raw), + Token::Number(box NumberToken { value, raw, .. }) => (value, raw), _ => { unreachable!(); } @@ -1339,7 +1339,7 @@ where // ['+' | '-'] tok!("-") | tok!("+") => { let (b_sign, b_sign_raw) = match bump!(self) { - Token::Delim { value, .. } => (if value == '-' { -1 } else { 1 }, value), + Token::Delim(box DelimToken { value, .. }) => (if value == '-' { -1 } else { 1 }, value), _ => { unreachable!(); } @@ -1348,7 +1348,7 @@ where self.input.skip_ws(); let number = match bump!(self) { - Token::Number { value, raw, .. } => (value, raw), + Token::Number(box NumberToken { value, raw, .. }) => (value, raw), _ => { return Err(Error::new(span, ErrorKind::Expected("Num"))); } @@ -1420,7 +1420,7 @@ where } match bump!(self) { - Token::Ident { value, raw } => Ok(CustomHighlightName { + Token::Ident(box IdentToken { value, raw, .. }) => Ok(CustomHighlightName { span, value, raw: Some(raw), diff --git a/crates/swc_css_parser/src/parser/syntax/mod.rs b/crates/swc_css_parser/src/parser/syntax/mod.rs index 11fe4b2c66b7..f0b8063928ce 100644 --- a/crates/swc_css_parser/src/parser/syntax/mod.rs +++ b/crates/swc_css_parser/src/parser/syntax/mod.rs @@ -143,7 +143,7 @@ where // and its value initially set to nothing. let span = self.input.cur_span(); let at_keyword_name = match bump!(self) { - Token::AtKeyword { value, raw } => (value, raw), + Token::AtKeyword(box AtKeywordToken { value, raw }) => (value, raw), _ => { unreachable!() } @@ -371,7 +371,7 @@ where // Constructions like `a { prop: {value}; }` still affected this problem, but // `{`/`}` doesn't used in declarations if self.config.legacy_nesting - && matches!(self.input.cur(), Some(Token::Ident { value, .. }) if !value.starts_with("--")) + && matches!(self.input.cur(), Some(Token::Ident(box IdentToken { value, .. })) if !value.starts_with("--")) { if let Some(legacy_nested) = self.try_to_parse_legacy_nesting() { rules.push(StyleBlock::QualifiedRule(Box::new(legacy_nested))); @@ -606,7 +606,7 @@ where // Return nothing. let span = self.input.cur_span(); let is_dashed_ident = match cur!(self) { - Token::Ident { value, .. } => value.starts_with("--"), + Token::Ident(box IdentToken { value, .. }) => value.starts_with("--"), _ => { return Err(Error::new(span, ErrorKind::Expected("ident"))); } @@ -653,7 +653,7 @@ where // Optimization for step 6 ComponentValue::PreservedToken(box TokenAndSpan { span, - token: Token::Delim { value: '!', .. }, + token: Token::Delim(box DelimToken { value: '!', .. }), .. }) if is!(self, " ") || is_case_insensitive_ident!(self, "important") => { if let Some(span) = &exclamation_point_span { @@ -689,7 +689,7 @@ where }, ComponentValue::PreservedToken( token_and_span @ box TokenAndSpan { - token: Token::Ident { value, .. }, + token: Token::Ident(box IdentToken { value, .. }), .. }, ) if exclamation_point_span.is_some() @@ -736,7 +736,7 @@ where Default::default(), ); let value = match important_ident.token { - Token::Ident { value, raw } => (value, raw), + Token::Ident(box IdentToken { value, raw, .. }) => (value, raw), _ => { unreachable!(); } @@ -920,7 +920,7 @@ where // and with its value initially set to an empty list. let span = self.input.cur_span(); let ident = match bump!(self) { - Token::Function { value, raw } => (value, raw), + Token::Function(box FunctionToken { value, raw }) => (value, raw), _ => { unreachable!() } diff --git a/crates/swc_css_parser/src/parser/util.rs b/crates/swc_css_parser/src/parser/util.rs index 61247dfd4ee0..f7d194e03366 100644 --- a/crates/swc_css_parser/src/parser/util.rs +++ b/crates/swc_css_parser/src/parser/util.rs @@ -434,7 +434,7 @@ where } ComponentValue::PreservedToken(box TokenAndSpan { span, - token: Token::Delim { value: '!' }, + token: Token::Delim(box DelimToken { value: '!' }), }) => { return Err(Error::new( *span, diff --git a/crates/swc_css_parser/src/parser/values_and_units/mod.rs b/crates/swc_css_parser/src/parser/values_and_units/mod.rs index 887958b6d4f9..bd71f0044174 100644 --- a/crates/swc_css_parser/src/parser/values_and_units/mod.rs +++ b/crates/swc_css_parser/src/parser/values_and_units/mod.rs @@ -47,18 +47,20 @@ where return Ok(ComponentValue::Url(self.parse()?)); } - Token::Function { value, .. } => match &*value.to_ascii_lowercase() { - "url" | "src" => { - return Ok(ComponentValue::Url(self.parse()?)); - } - "rgb" | "rgba" | "hsl" | "hsla" | "hwb" | "lab" | "lch" | "oklab" | "oklch" - | "color" | "device-cmyk" | "color-mix" | "color-contrast" => { - return Ok(ComponentValue::Color(self.parse()?)); - } - _ => { - return Ok(ComponentValue::Function(self.parse()?)); + Token::Function(box FunctionToken { value, .. }) => { + match &*value.to_ascii_lowercase() { + "url" | "src" => { + return Ok(ComponentValue::Url(self.parse()?)); + } + "rgb" | "rgba" | "hsl" | "hsla" | "hwb" | "lab" | "lch" | "oklab" | "oklch" + | "color" | "device-cmyk" | "color-mix" | "color-contrast" => { + return Ok(ComponentValue::Color(self.parse()?)); + } + _ => { + return Ok(ComponentValue::Function(self.parse()?)); + } } - }, + } tok!("percentage") => { return Ok(ComponentValue::Percentage(self.parse()?)); @@ -66,7 +68,7 @@ where tok!("dimension") => return Ok(ComponentValue::Dimension(self.parse()?)), - Token::Number { type_flag, .. } => { + Token::Number(box NumberToken { type_flag, .. }) => { if *type_flag == NumberType::Integer { return Ok(ComponentValue::Integer(self.parse()?)); } @@ -74,7 +76,7 @@ where return Ok(ComponentValue::Number(self.parse()?)); } - Token::Ident { value, .. } => { + Token::Ident(box IdentToken { value, .. }) => { if value.starts_with("--") { return Ok(ComponentValue::DashedIdent(self.parse()?)); } else if &*value.to_ascii_lowercase() == "u" @@ -370,7 +372,9 @@ where let mut is_legacy_syntax = true; match cur!(self) { - Token::Ident { value, .. } if &*value.to_ascii_lowercase() == "from" => { + Token::Ident(box IdentToken { value, .. }) + if &*value.to_ascii_lowercase() == "from" => + { is_legacy_syntax = false; values.push(ComponentValue::Ident(self.parse()?)); @@ -399,7 +403,9 @@ where Ok(Some(ComponentValue::Percentage(parser.parse()?))) } tok!("number") => Ok(Some(ComponentValue::Number(parser.parse()?))), - Token::Function { value, .. } if is_math_function(value) => { + Token::Function(box FunctionToken { value, .. }) + if is_math_function(value) => + { Ok(Some(ComponentValue::Function(parser.parse()?))) } tok!("ident") => { @@ -457,7 +463,9 @@ where )) } } - Token::Function { value, .. } if is_math_function(value) => { + Token::Function(box FunctionToken { value, .. }) + if is_math_function(value) => + { Ok(Some(ComponentValue::Function(parser.parse()?))) } _ => { @@ -512,7 +520,9 @@ where Ok(Some(ComponentValue::Percentage(parser.parse()?))) } tok!("number") => Ok(Some(ComponentValue::Number(parser.parse()?))), - Token::Function { value, .. } if is_math_function(value) => { + Token::Function(box FunctionToken { value, .. }) + if is_math_function(value) => + { Ok(Some(ComponentValue::Function(parser.parse()?))) } tok!("ident") if !is_legacy_syntax => { @@ -556,7 +566,9 @@ where tok!("percentage") => { Ok(Some(ComponentValue::Percentage(parser.parse()?))) } - Token::Function { value, .. } if is_math_function(value) => { + Token::Function(box FunctionToken { value, .. }) + if is_math_function(value) => + { Ok(Some(ComponentValue::Function(parser.parse()?))) } tok!("ident") => { @@ -628,7 +640,9 @@ where Ok(Some(ComponentValue::Percentage(parser.parse()?))) } tok!("number") => Ok(Some(ComponentValue::Number(parser.parse()?))), - Token::Function { value, .. } if is_math_function(value) => { + Token::Function(box FunctionToken { value, .. }) + if is_math_function(value) => + { Ok(Some(ComponentValue::Function(parser.parse()?))) } tok!("ident") if !is_legacy_syntax => { @@ -672,7 +686,9 @@ where tok!("percentage") => { Ok(Some(ComponentValue::Percentage(parser.parse()?))) } - Token::Function { value, .. } if is_math_function(value) => { + Token::Function(box FunctionToken { value, .. }) + if is_math_function(value) => + { Ok(Some(ComponentValue::Function(parser.parse()?))) } tok!("ident") => { @@ -725,7 +741,9 @@ where tok!("number") | tok!("percentage") => { Ok(Some(ComponentValue::AlphaValue(parser.parse()?))) } - Token::Function { value, .. } if is_math_function(value) => { + Token::Function(box FunctionToken { value, .. }) + if is_math_function(value) => + { Ok(Some(ComponentValue::Function(parser.parse()?))) } _ => { @@ -759,7 +777,9 @@ where tok!("number") | tok!("percentage") => { Ok(Some(ComponentValue::AlphaValue(parser.parse()?))) } - Token::Function { value, .. } if is_math_function(value) => { + Token::Function(box FunctionToken { value, .. }) + if is_math_function(value) => + { Ok(Some(ComponentValue::Function(parser.parse()?))) } tok!("ident") => { @@ -804,7 +824,7 @@ where let mut has_variable = false; match cur!(self) { - Token::Ident { value, .. } + Token::Ident(box IdentToken { value, .. }) if &*value.to_ascii_lowercase() == "from" && function_name != "device-cmyk" => { @@ -833,7 +853,9 @@ where tok!("number") | tok!("dimension") => { Ok(Some(ComponentValue::Hue(parser.parse()?))) } - Token::Function { value, .. } if is_math_function(value) => { + Token::Function(box FunctionToken { value, .. }) + if is_math_function(value) => + { Ok(Some(ComponentValue::Function(parser.parse()?))) } tok!("ident") => { @@ -878,7 +900,9 @@ where Ok(Some(ComponentValue::Percentage(parser.parse()?))) } tok!("number") => Ok(Some(ComponentValue::Number(parser.parse()?))), - Token::Function { value, .. } if is_math_function(value) => { + Token::Function(box FunctionToken { value, .. }) + if is_math_function(value) => + { Ok(Some(ComponentValue::Function(parser.parse()?))) } tok!("ident") => { @@ -941,7 +965,9 @@ where tok!("percentage") => { Ok(Some(ComponentValue::Percentage(parser.parse()?))) } - Token::Function { value, .. } if is_math_function(value) => { + Token::Function(box FunctionToken { value, .. }) + if is_math_function(value) => + { Ok(Some(ComponentValue::Function(parser.parse()?))) } tok!("ident") => { @@ -990,7 +1016,9 @@ where tok!("number") => { Ok(Some(ComponentValue::Number(parser.parse()?))) } - Token::Function { value, .. } if is_math_function(value) => { + Token::Function(box FunctionToken { value, .. }) + if is_math_function(value) => + { Ok(Some(ComponentValue::Function(parser.parse()?))) } tok!("ident") => { @@ -1058,7 +1086,9 @@ where tok!("percentage") => { Ok(Some(ComponentValue::Percentage(parser.parse()?))) } - Token::Function { value, .. } if is_math_function(value) => { + Token::Function(box FunctionToken { value, .. }) + if is_math_function(value) => + { Ok(Some(ComponentValue::Function(parser.parse()?))) } tok!("ident") => { @@ -1107,7 +1137,9 @@ where tok!("number") => { Ok(Some(ComponentValue::Number(parser.parse()?))) } - Token::Function { value, .. } if is_math_function(value) => { + Token::Function(box FunctionToken { value, .. }) + if is_math_function(value) => + { Ok(Some(ComponentValue::Function(parser.parse()?))) } tok!("ident") => { @@ -1153,7 +1185,9 @@ where tok!("number") | tok!("dimension") => { Ok(Some(ComponentValue::Hue(parser.parse()?))) } - Token::Function { value, .. } if is_math_function(value) => { + Token::Function(box FunctionToken { value, .. }) + if is_math_function(value) => + { Ok(Some(ComponentValue::Function(parser.parse()?))) } tok!("ident") => { @@ -1236,7 +1270,9 @@ where tok!("number") | tok!("percentage") => { Ok(Some(ComponentValue::AlphaValue(parser.parse()?))) } - Token::Function { value, .. } if is_math_function(value) => { + Token::Function(box FunctionToken { value, .. }) + if is_math_function(value) => + { Ok(Some(ComponentValue::Function(parser.parse()?))) } tok!("ident") if !matches!(function_name, "device-cmyk") => { @@ -1281,7 +1317,9 @@ where let mut has_variable = false; match cur!(self) { - Token::Ident { value, .. } if &*value.to_ascii_lowercase() == "from" => { + Token::Ident(box IdentToken { value, .. }) + if &*value.to_ascii_lowercase() == "from" => + { values.push(ComponentValue::Ident(self.parse()?)); self.input.skip_ws(); @@ -1305,7 +1343,7 @@ where let ident = self.try_parse_variable_function( |parser, _| match cur!(parser) { - Token::Ident { value, .. } => { + Token::Ident(box IdentToken { value, .. }) => { if value.starts_with("--") && value.len() > 2 { is_custom_params = true; @@ -1345,7 +1383,9 @@ where tok!("percentage") if !is_xyz => { Ok(Some(ComponentValue::Percentage(parser.parse()?))) } - Token::Function { value, .. } if is_math_function(value) => { + Token::Function(box FunctionToken { value, .. }) + if is_math_function(value) => + { Ok(Some(ComponentValue::Function(parser.parse()?))) } tok!("ident") => { @@ -1394,7 +1434,7 @@ where tok!("percentage") if !is_xyz => { ComponentValue::Percentage(self.parse()?) } - Token::Function { value, .. } + Token::Function(box FunctionToken { value, .. }) if is_math_function(value) || matches!( &*value.to_ascii_lowercase(), @@ -1431,7 +1471,9 @@ where tok!("percentage") if !is_xyz => { Ok(Some(ComponentValue::Percentage(parser.parse()?))) } - Token::Function { value, .. } if is_math_function(value) => { + Token::Function(box FunctionToken { value, .. }) + if is_math_function(value) => + { Ok(Some(ComponentValue::Function(parser.parse()?))) } tok!("ident") => { @@ -1487,7 +1529,9 @@ where )) } } - Token::Function { value, .. } if is_math_function(value) => { + Token::Function(box FunctionToken { value, .. }) + if is_math_function(value) => + { Ok(Some(ComponentValue::Function(parser.parse()?))) } _ => { @@ -1524,7 +1568,9 @@ where tok!("number") | tok!("percentage") => { Ok(Some(ComponentValue::AlphaValue(parser.parse()?))) } - Token::Function { value, .. } if is_math_function(value) => { + Token::Function(box FunctionToken { value, .. }) + if is_math_function(value) => + { Ok(Some(ComponentValue::Function(parser.parse()?))) } tok!("ident") if !matches!(function_name, "device-cmyk") => { @@ -1672,7 +1718,7 @@ where } match cur!(self) { - Token::Function { value, .. } + Token::Function(box FunctionToken { value, .. }) if matches!(&*value.to_ascii_lowercase(), "var" | "env" | "constant") => { *has_before_variable = true; @@ -1744,12 +1790,12 @@ where let value = bump!(self); match value { - Token::Number { + Token::Number(box NumberToken { value, raw, type_flag, .. - } => { + }) => { if type_flag == NumberType::Number { return Err(Error::new(span, ErrorKind::Expected("integer type"))); } @@ -1781,7 +1827,7 @@ where let value = bump!(self); match value { - Token::Number { value, raw, .. } => Ok(Number { + Token::Number(box NumberToken { value, raw, .. }) => Ok(Number { span, value, raw: Some(raw), @@ -1805,7 +1851,7 @@ where } match bump!(self) { - Token::Ident { value, raw } => { + Token::Ident(box IdentToken { value, raw, .. }) => { match &*value.to_ascii_lowercase() { "initial" | "inherit" | "unset" | "revert" | "default" => { return Err(Error::new(span, ErrorKind::InvalidCustomIdent(value))); @@ -1838,7 +1884,7 @@ where } match bump!(self) { - Token::Ident { value, raw } => { + Token::Ident(box IdentToken { value, raw, .. }) => { if !value.starts_with("--") { return Err(Error::new( span, @@ -1878,7 +1924,7 @@ where } match bump!(self) { - Token::Ident { value, raw } => { + Token::Ident(box IdentToken { value, raw, .. }) => { if !value.starts_with("--") { return Err(Error::new( span, @@ -1916,7 +1962,7 @@ where } match bump!(self) { - Token::Ident { value, raw } => Ok(Ident { + Token::Ident(box IdentToken { value, raw, .. }) => Ok(Ident { span, value, raw: Some(raw), @@ -1940,7 +1986,7 @@ where } match cur!(self) { - Token::Dimension { unit, .. } => { + Token::Dimension(box DimensionToken { unit, .. }) => { match unit { // unit if is_length_unit(unit) @@ -1980,9 +2026,9 @@ where } match bump!(self) { - Token::Dimension { + Token::Dimension(box DimensionToken { value, unit, raw, .. - } => { + }) => { // TODO validate let unit_len = raw.1.len() as u32; @@ -2020,9 +2066,9 @@ where } match bump!(self) { - Token::Dimension { + Token::Dimension(box DimensionToken { value, unit, raw, .. - } => { + }) => { if !is_angle_unit(&unit) { return Err(Error::new( span, @@ -2065,9 +2111,9 @@ where } match bump!(self) { - Token::Dimension { + Token::Dimension(box DimensionToken { value, unit, raw, .. - } => { + }) => { if !is_time_unit(&unit) { return Err(Error::new(span, ErrorKind::Expected("'s' or 'ms' units"))); } @@ -2107,9 +2153,9 @@ where } match bump!(self) { - Token::Dimension { + Token::Dimension(box DimensionToken { value, unit, raw, .. - } => { + }) => { if !is_frequency_unit(&unit) { return Err(Error::new(span, ErrorKind::Expected("'Hz' or 'kHz' units"))); } @@ -2149,9 +2195,9 @@ where } match bump!(self) { - Token::Dimension { + Token::Dimension(box DimensionToken { value, unit, raw, .. - } => { + }) => { if !is_resolution_unit(&unit) { return Err(Error::new( span, @@ -2194,9 +2240,9 @@ where } match bump!(self) { - Token::Dimension { + Token::Dimension(box DimensionToken { value, unit, raw, .. - } => { + }) => { if !is_flex_unit(&unit) { return Err(Error::new(span, ErrorKind::Expected("'fr' unit"))); } @@ -2236,9 +2282,9 @@ where } match bump!(self) { - Token::Dimension { + Token::Dimension(box DimensionToken { value, unit, raw, .. - } => { + }) => { let unit_len = raw.1.len() as u32; Ok(UnknownDimension { @@ -2271,14 +2317,16 @@ where match cur!(self) { // currentcolor | - Token::Ident { value, .. } + Token::Ident(box IdentToken { value, .. }) if value.as_ref().eq_ignore_ascii_case("currentcolor") || is_system_color(value) => { Ok(Color::CurrentColorOrSystemColor(self.parse()?)) } // - Token::Function { value, .. } if value.as_ref().eq_ignore_ascii_case("device-cmyk") => { + Token::Function(box FunctionToken { value, .. }) + if value.as_ref().eq_ignore_ascii_case("device-cmyk") => + { Ok(Color::Function(self.parse()?)) } // @@ -2307,7 +2355,7 @@ where match cur!(self) { tok!("#") => Ok(AbsoluteColorBase::HexColor(self.parse()?)), - Token::Ident { value, .. } => { + Token::Ident(box IdentToken { value, .. }) => { if !(is_named_color(value) || value.as_ref().eq_ignore_ascii_case("transparent")) { let span = self.input.cur_span(); @@ -2319,7 +2367,9 @@ where Ok(AbsoluteColorBase::NamedColorOrTransparent(self.parse()?)) } - Token::Function { value, .. } if is_absolute_color_base_function(value) => { + Token::Function(box FunctionToken { value, .. }) + if is_absolute_color_base_function(value) => + { Ok(AbsoluteColorBase::Function(self.parse()?)) } _ => { @@ -2347,7 +2397,7 @@ where } match bump!(self) { - Token::Hash { value, raw, .. } => Ok(HexColor { + Token::Hash(box HashToken { value, raw, .. }) => Ok(HexColor { span, value, raw: Some(raw), @@ -2424,7 +2474,7 @@ where match cur!(self) { tok!("number") => Ok(CmykComponent::Number(self.parse()?)), tok!("percentage") => Ok(CmykComponent::Percentage(self.parse()?)), - Token::Function { value, .. } => { + Token::Function(box FunctionToken { value, .. }) => { if !is_math_function(value) { let span = self.input.cur_span(); @@ -2452,7 +2502,7 @@ where } match bump!(self) { - Token::Percentage { value, raw } => { + Token::Percentage(box PercentageToken { value, raw }) => { let value = Number { span: Span::new(span.lo, span.hi - BytePos(1), Default::default()), value, @@ -2480,7 +2530,7 @@ where } match bump!(self) { - Token::String { value, raw } => Ok(Str { + Token::String(box StringToken { value, raw }) => Ok(Str { span, value, raw: Some(raw), @@ -2507,7 +2557,7 @@ where } match bump!(self) { - Token::Url { name, value, raw } => { + Token::Url(box UrlToken { name, value, raw }) => { let name_length = raw.0.len() as u32; let name = Ident { span: Span::new(span.lo, span.lo + BytePos(name_length), Default::default()), @@ -2531,10 +2581,10 @@ where modifiers: None, }) } - Token::Function { + Token::Function(box FunctionToken { value: function_name, raw: raw_function_name, - } => { + }) => { if &*function_name.to_ascii_lowercase() != "url" && &*function_name.to_ascii_lowercase() != "src" { @@ -2616,9 +2666,9 @@ where // should start with `u` or `U` match cur!(self) { - Token::Ident { value, .. } if &*value.to_ascii_lowercase() == "u" => { + Token::Ident(box IdentToken { value, .. }) if &*value.to_ascii_lowercase() == "u" => { let ident = match bump!(self) { - Token::Ident { value, .. } => value, + Token::Ident(box IdentToken { value, .. }) => value, _ => { unreachable!(); } @@ -2634,9 +2684,9 @@ where match cur!(self) { // u '+' '?'* // u '+' '?'+ - Token::Delim { value } if *value == '+' => { + Token::Delim(box DelimToken { value }) if *value == '+' => { let plus = match bump!(self) { - Token::Delim { value } => value, + Token::Delim(box DelimToken { value }) => value, _ => { unreachable!(); } @@ -2646,7 +2696,7 @@ where if is!(self, Ident) { let ident = match bump!(self) { - Token::Ident { value, .. } => value, + Token::Ident(box IdentToken { value, .. }) => value, _ => { unreachable!(); } @@ -2660,7 +2710,7 @@ where } let question = match bump!(self) { - Token::Delim { value } => value, + Token::Delim(box DelimToken { value }) => value, _ => { unreachable!(); } @@ -2670,7 +2720,7 @@ where } } else { let question = match bump!(self) { - Token::Delim { value } if value == '?' => value, + Token::Delim(box DelimToken { value }) if value == '?' => value, _ => { return Err(Error::new(span, ErrorKind::Expected("'?' delim token"))); } @@ -2684,7 +2734,7 @@ where } let question = match bump!(self) { - Token::Delim { value } => value, + Token::Delim(box DelimToken { value }) => value, _ => { unreachable!(); } @@ -2699,7 +2749,7 @@ where // u tok!("number") => { let number = match bump!(self) { - Token::Number { raw, .. } => raw, + Token::Number(box NumberToken { raw, .. }) => raw, _ => { unreachable!(); } @@ -2711,7 +2761,7 @@ where match cur!(self) { tok!("?") => { let question = match bump!(self) { - Token::Delim { value } => value, + Token::Delim(box DelimToken { value }) => value, _ => { unreachable!(); } @@ -2725,7 +2775,7 @@ where } let question = match bump!(self) { - Token::Delim { value } => value, + Token::Delim(box DelimToken { value }) => value, _ => { unreachable!(); } @@ -2736,7 +2786,7 @@ where } tok!("dimension") => { let raw = match bump!(self) { - Token::Dimension { raw, .. } => raw, + Token::Dimension(box DimensionToken { raw, .. }) => raw, _ => { unreachable!(); } @@ -2747,7 +2797,7 @@ where } tok!("number") => { let number = match bump!(self) { - Token::Number { raw, .. } => raw, + Token::Number(box NumberToken { raw, .. }) => raw, _ => { unreachable!(); } @@ -2762,7 +2812,7 @@ where // u '?'* tok!("dimension") => { let raw = match bump!(self) { - Token::Dimension { raw, .. } => raw, + Token::Dimension(box DimensionToken { raw, .. }) => raw, _ => { unreachable!(); } @@ -2777,7 +2827,7 @@ where } let question = match bump!(self) { - Token::Delim { value } => value, + Token::Delim(box DelimToken { value }) => value, _ => { unreachable!(); } @@ -3166,7 +3216,7 @@ where tok!("number") => Ok(CalcValue::Number(self.parse()?)), tok!("dimension") => Ok(CalcValue::Dimension(self.parse()?)), tok!("percentage") => Ok(CalcValue::Percentage(self.parse()?)), - Token::Ident { value, .. } => { + Token::Ident(box IdentToken { value, .. }) => { match &*value.to_ascii_lowercase() { "e" | "pi" | "infinity" | "-infinity" | "nan" => {} _ => { diff --git a/crates/swc_css_parser/tests/fixture/at-rule/container/span.swc-stderr b/crates/swc_css_parser/tests/fixture/at-rule/container/span.swc-stderr index f8062d1e617a..81ab1eb0382f 100644 --- a/crates/swc_css_parser/tests/fixture/at-rule/container/span.swc-stderr +++ b/crates/swc_css_parser/tests/fixture/at-rule/container/span.swc-stderr @@ -2220,7 +2220,7 @@ 43 | .card { margin-block: 2em; } `---- - x Ident { value: Atom('--responsive' type=dynamic), raw: "--responsive" } + x Ident(IdentToken { value: Atom('--responsive' type=dynamic), raw: "--responsive" }) ,-[$DIR/tests/fixture/at-rule/container/input.css:41:1] 41 | 42 | @container card (inline-size > 30em) and style(--responsive: true) { @@ -2252,7 +2252,7 @@ 43 | .card { margin-block: 2em; } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/container/input.css:41:1] 41 | 42 | @container card (inline-size > 30em) and style(--responsive: true) { @@ -2268,7 +2268,7 @@ 43 | .card { margin-block: 2em; } `---- - x Ident { value: Atom('true' type=static), raw: "true" } + x Ident(IdentToken { value: Atom('true' type=static), raw: "true" }) ,-[$DIR/tests/fixture/at-rule/container/input.css:41:1] 41 | 42 | @container card (inline-size > 30em) and style(--responsive: true) { @@ -2572,7 +2572,7 @@ 47 | .card { margin-block: 2em; } `---- - x Ident { value: Atom('--responsive' type=dynamic), raw: "--responsive" } + x Ident(IdentToken { value: Atom('--responsive' type=dynamic), raw: "--responsive" }) ,-[$DIR/tests/fixture/at-rule/container/input.css:45:1] 45 | 46 | @container card (inline-size > 30em) or style(--responsive: true) { @@ -2604,7 +2604,7 @@ 47 | .card { margin-block: 2em; } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/container/input.css:45:1] 45 | 46 | @container card (inline-size > 30em) or style(--responsive: true) { @@ -2620,7 +2620,7 @@ 47 | .card { margin-block: 2em; } `---- - x Ident { value: Atom('true' type=static), raw: "true" } + x Ident(IdentToken { value: Atom('true' type=static), raw: "true" }) ,-[$DIR/tests/fixture/at-rule/container/input.css:45:1] 45 | 46 | @container card (inline-size > 30em) or style(--responsive: true) { @@ -7402,7 +7402,7 @@ 114 | #inner { `---- - x Ident { value: Atom('--responsive' type=dynamic), raw: "--responsive" } + x Ident(IdentToken { value: Atom('--responsive' type=dynamic), raw: "--responsive" }) ,-[$DIR/tests/fixture/at-rule/container/input.css:112:1] 112 | 113 | @container test style(--responsive: true) { @@ -7434,7 +7434,7 @@ 114 | #inner { `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/container/input.css:112:1] 112 | 113 | @container test style(--responsive: true) { @@ -7450,7 +7450,7 @@ 114 | #inner { `---- - x Ident { value: Atom('true' type=static), raw: "true" } + x Ident(IdentToken { value: Atom('true' type=static), raw: "true" }) ,-[$DIR/tests/fixture/at-rule/container/input.css:112:1] 112 | 113 | @container test style(--responsive: true) { @@ -7684,7 +7684,7 @@ 120 | #inner { `---- - x Ident { value: Atom('--responsive' type=dynamic), raw: "--responsive" } + x Ident(IdentToken { value: Atom('--responsive' type=dynamic), raw: "--responsive" }) ,-[$DIR/tests/fixture/at-rule/container/input.css:118:1] 118 | 119 | @container style(--responsive: true) { @@ -7716,7 +7716,7 @@ 120 | #inner { `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/container/input.css:118:1] 118 | 119 | @container style(--responsive: true) { @@ -7732,7 +7732,7 @@ 120 | #inner { `---- - x Ident { value: Atom('true' type=static), raw: "true" } + x Ident(IdentToken { value: Atom('true' type=static), raw: "true" }) ,-[$DIR/tests/fixture/at-rule/container/input.css:118:1] 118 | 119 | @container style(--responsive: true) { @@ -8087,7 +8087,7 @@ 127 | #inner { `---- - x Ident { value: Atom('--responsive' type=dynamic), raw: "--responsive" } + x Ident(IdentToken { value: Atom('--responsive' type=dynamic), raw: "--responsive" }) ,-[$DIR/tests/fixture/at-rule/container/input.css:125:1] 125 | @container card (inline-size > 30em) { 126 | @container style(--responsive: true) { @@ -8119,7 +8119,7 @@ 127 | #inner { `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/container/input.css:125:1] 125 | @container card (inline-size > 30em) { 126 | @container style(--responsive: true) { @@ -8135,7 +8135,7 @@ 127 | #inner { `---- - x Ident { value: Atom('true' type=static), raw: "true" } + x Ident(IdentToken { value: Atom('true' type=static), raw: "true" }) ,-[$DIR/tests/fixture/at-rule/container/input.css:125:1] 125 | @container card (inline-size > 30em) { 126 | @container style(--responsive: true) { diff --git a/crates/swc_css_parser/tests/fixture/at-rule/media/span.swc-stderr b/crates/swc_css_parser/tests/fixture/at-rule/media/span.swc-stderr index 73d967be2cd4..c4cc4d0a99e1 100644 --- a/crates/swc_css_parser/tests/fixture/at-rule/media/span.swc-stderr +++ b/crates/swc_css_parser/tests/fixture/at-rule/media/span.swc-stderr @@ -21363,7 +21363,7 @@ 143 | @media (height foo bar) {} `---- - x Ident { value: Atom('height' type=inline), raw: "height" } + x Ident(IdentToken { value: Atom('height' type=inline), raw: "height" }) ,-[$DIR/tests/fixture/at-rule/media/input.css:141:1] 141 | 142 | @media (height << 600px) {} @@ -21379,7 +21379,7 @@ 143 | @media (height foo bar) {} `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/media/input.css:141:1] 141 | 142 | @media (height << 600px) {} @@ -21395,7 +21395,7 @@ 143 | @media (height foo bar) {} `---- - x Delim { value: '<' } + x Delim(DelimToken { value: '<' }) ,-[$DIR/tests/fixture/at-rule/media/input.css:141:1] 141 | 142 | @media (height << 600px) {} @@ -21411,7 +21411,7 @@ 143 | @media (height foo bar) {} `---- - x Delim { value: '<' } + x Delim(DelimToken { value: '<' }) ,-[$DIR/tests/fixture/at-rule/media/input.css:141:1] 141 | 142 | @media (height << 600px) {} @@ -21427,7 +21427,7 @@ 143 | @media (height foo bar) {} `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/media/input.css:141:1] 141 | 142 | @media (height << 600px) {} @@ -21443,7 +21443,7 @@ 143 | @media (height foo bar) {} `---- - x Dimension { value: 600.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("600", "px") } + x Dimension(DimensionToken { value: 600.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("600", "px") }) ,-[$DIR/tests/fixture/at-rule/media/input.css:141:1] 141 | 142 | @media (height << 600px) {} @@ -21563,7 +21563,7 @@ 144 | @media (height foo("bar")) {} `---- - x Ident { value: Atom('height' type=inline), raw: "height" } + x Ident(IdentToken { value: Atom('height' type=inline), raw: "height" }) ,-[$DIR/tests/fixture/at-rule/media/input.css:142:1] 142 | @media (height << 600px) {} 143 | @media (height foo bar) {} @@ -21579,7 +21579,7 @@ 144 | @media (height foo("bar")) {} `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/media/input.css:142:1] 142 | @media (height << 600px) {} 143 | @media (height foo bar) {} @@ -21595,7 +21595,7 @@ 144 | @media (height foo("bar")) {} `---- - x Ident { value: Atom('foo' type=inline), raw: "foo" } + x Ident(IdentToken { value: Atom('foo' type=inline), raw: "foo" }) ,-[$DIR/tests/fixture/at-rule/media/input.css:142:1] 142 | @media (height << 600px) {} 143 | @media (height foo bar) {} @@ -21611,7 +21611,7 @@ 144 | @media (height foo("bar")) {} `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/media/input.css:142:1] 142 | @media (height << 600px) {} 143 | @media (height foo bar) {} @@ -21627,7 +21627,7 @@ 144 | @media (height foo("bar")) {} `---- - x Ident { value: Atom('bar' type=inline), raw: "bar" } + x Ident(IdentToken { value: Atom('bar' type=inline), raw: "bar" }) ,-[$DIR/tests/fixture/at-rule/media/input.css:142:1] 142 | @media (height << 600px) {} 143 | @media (height foo bar) {} @@ -21747,7 +21747,7 @@ 145 | @media (height + 600px) {} `---- - x Ident { value: Atom('height' type=inline), raw: "height" } + x Ident(IdentToken { value: Atom('height' type=inline), raw: "height" }) ,-[$DIR/tests/fixture/at-rule/media/input.css:143:1] 143 | @media (height foo bar) {} 144 | @media (height foo("bar")) {} @@ -21763,7 +21763,7 @@ 145 | @media (height + 600px) {} `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/media/input.css:143:1] 143 | @media (height foo bar) {} 144 | @media (height foo("bar")) {} @@ -21803,7 +21803,7 @@ 145 | @media (height + 600px) {} `---- - x String { value: Atom('bar' type=inline), raw: "\"bar\"" } + x String(StringToken { value: Atom('bar' type=inline), raw: "\"bar\"" }) ,-[$DIR/tests/fixture/at-rule/media/input.css:143:1] 143 | @media (height foo bar) {} 144 | @media (height foo("bar")) {} @@ -21923,7 +21923,7 @@ 146 | @media screen and (min-width: ) {} `---- - x Ident { value: Atom('height' type=inline), raw: "height" } + x Ident(IdentToken { value: Atom('height' type=inline), raw: "height" }) ,-[$DIR/tests/fixture/at-rule/media/input.css:144:1] 144 | @media (height foo("bar")) {} 145 | @media (height + 600px) {} @@ -21939,7 +21939,7 @@ 146 | @media screen and (min-width: ) {} `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/media/input.css:144:1] 144 | @media (height foo("bar")) {} 145 | @media (height + 600px) {} @@ -21955,7 +21955,7 @@ 146 | @media screen and (min-width: ) {} `---- - x Delim { value: '+' } + x Delim(DelimToken { value: '+' }) ,-[$DIR/tests/fixture/at-rule/media/input.css:144:1] 144 | @media (height foo("bar")) {} 145 | @media (height + 600px) {} @@ -21971,7 +21971,7 @@ 146 | @media screen and (min-width: ) {} `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/media/input.css:144:1] 144 | @media (height foo("bar")) {} 145 | @media (height + 600px) {} @@ -21987,7 +21987,7 @@ 146 | @media screen and (min-width: ) {} `---- - x Dimension { value: 600.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("600", "px") } + x Dimension(DimensionToken { value: 600.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("600", "px") }) ,-[$DIR/tests/fixture/at-rule/media/input.css:144:1] 144 | @media (height foo("bar")) {} 145 | @media (height + 600px) {} @@ -22131,7 +22131,7 @@ 147 | @media (aspect-ratio: 12/) {} `---- - x Ident { value: Atom('min-width' type=dynamic), raw: "min-width" } + x Ident(IdentToken { value: Atom('min-width' type=dynamic), raw: "min-width" }) ,-[$DIR/tests/fixture/at-rule/media/input.css:145:1] 145 | @media (height + 600px) {} 146 | @media screen and (min-width: ) {} @@ -22163,7 +22163,7 @@ 147 | @media (aspect-ratio: 12/) {} `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/media/input.css:145:1] 145 | @media (height + 600px) {} 146 | @media screen and (min-width: ) {} @@ -22283,7 +22283,7 @@ 148 | @media func(100px) {} `---- - x Ident { value: Atom('aspect-ratio' type=dynamic), raw: "aspect-ratio" } + x Ident(IdentToken { value: Atom('aspect-ratio' type=dynamic), raw: "aspect-ratio" }) ,-[$DIR/tests/fixture/at-rule/media/input.css:146:1] 146 | @media screen and (min-width: ) {} 147 | @media (aspect-ratio: 12/) {} @@ -22315,7 +22315,7 @@ 148 | @media func(100px) {} `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/media/input.css:146:1] 146 | @media screen and (min-width: ) {} 147 | @media (aspect-ratio: 12/) {} @@ -22331,7 +22331,7 @@ 148 | @media func(100px) {} `---- - x Number { value: 12.0, raw: "12", type_flag: Integer } + x Number(NumberToken { value: 12.0, raw: "12", type_flag: Integer }) ,-[$DIR/tests/fixture/at-rule/media/input.css:146:1] 146 | @media screen and (min-width: ) {} 147 | @media (aspect-ratio: 12/) {} @@ -22347,7 +22347,7 @@ 148 | @media func(100px) {} `---- - x Delim { value: '/' } + x Delim(DelimToken { value: '/' }) ,-[$DIR/tests/fixture/at-rule/media/input.css:146:1] 146 | @media screen and (min-width: ) {} 147 | @media (aspect-ratio: 12/) {} @@ -22467,7 +22467,7 @@ 149 | @media screen and func(100px) {} `---- - x Dimension { value: 100.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("100", "px") } + x Dimension(DimensionToken { value: 100.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("100", "px") }) ,-[$DIR/tests/fixture/at-rule/media/input.css:147:1] 147 | @media (aspect-ratio: 12/) {} 148 | @media func(100px) {} @@ -22611,7 +22611,7 @@ 150 | @media(min-width:calc(10px + 10px)) {} `---- - x Dimension { value: 100.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("100", "px") } + x Dimension(DimensionToken { value: 100.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("100", "px") }) ,-[$DIR/tests/fixture/at-rule/media/input.css:148:1] 148 | @media func(100px) {} 149 | @media screen and func(100px) {} diff --git a/crates/swc_css_parser/tests/fixture/at-rule/supports/span.swc-stderr b/crates/swc_css_parser/tests/fixture/at-rule/supports/span.swc-stderr index bfc26c77f9b9..94edf2aa0b60 100644 --- a/crates/swc_css_parser/tests/fixture/at-rule/supports/span.swc-stderr +++ b/crates/swc_css_parser/tests/fixture/at-rule/supports/span.swc-stderr @@ -6442,7 +6442,7 @@ 52 | [--self] { `---- - x String { value: Atom('.minwidth' type=dynamic), raw: "\".minwidth\"" } + x String(StringToken { value: Atom('.minwidth' type=dynamic), raw: "\".minwidth\"" }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:50:1] 50 | 51 | @supports (--element(".minwidth")) { @@ -7240,7 +7240,7 @@ 66 | * { background: red; } `---- - x Ident { value: Atom('ident' type=inline), raw: "ident" } + x Ident(IdentToken { value: Atom('ident' type=inline), raw: "ident" }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:64:1] 64 | 65 | @supports (ident "str") { @@ -7256,7 +7256,7 @@ 66 | * { background: red; } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:64:1] 64 | 65 | @supports (ident "str") { @@ -7272,7 +7272,7 @@ 66 | * { background: red; } `---- - x String { value: Atom('str' type=inline), raw: "\"str\"" } + x String(StringToken { value: Atom('str' type=inline), raw: "\"str\"" }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:64:1] 64 | 65 | @supports (ident "str") { @@ -7520,7 +7520,7 @@ 70 | * { background: red; } `---- - x Ident { value: Atom('ident' type=inline), raw: "ident" } + x Ident(IdentToken { value: Atom('ident' type=inline), raw: "ident" }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:68:1] 68 | 69 | @supports ((ident "str")) { @@ -7536,7 +7536,7 @@ 70 | * { background: red; } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:68:1] 68 | 69 | @supports ((ident "str")) { @@ -7552,7 +7552,7 @@ 70 | * { background: red; } `---- - x String { value: Atom('str' type=inline), raw: "\"str\"" } + x String(StringToken { value: Atom('str' type=inline), raw: "\"str\"" }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:68:1] 68 | 69 | @supports ((ident "str")) { @@ -7792,7 +7792,7 @@ 74 | * { background: red; } `---- - x Number { value: 10.0, raw: "10", type_flag: Integer } + x Number(NumberToken { value: 10.0, raw: "10", type_flag: Integer }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:72:1] 72 | 73 | @supports func(10, 20, 40) { @@ -7824,7 +7824,7 @@ 74 | * { background: red; } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:72:1] 72 | 73 | @supports func(10, 20, 40) { @@ -7840,7 +7840,7 @@ 74 | * { background: red; } `---- - x Number { value: 20.0, raw: "20", type_flag: Integer } + x Number(NumberToken { value: 20.0, raw: "20", type_flag: Integer }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:72:1] 72 | 73 | @supports func(10, 20, 40) { @@ -7872,7 +7872,7 @@ 74 | * { background: red; } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:72:1] 72 | 73 | @supports func(10, 20, 40) { @@ -7888,7 +7888,7 @@ 74 | * { background: red; } `---- - x Number { value: 40.0, raw: "40", type_flag: Integer } + x Number(NumberToken { value: 40.0, raw: "40", type_flag: Integer }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:72:1] 72 | 73 | @supports func(10, 20, 40) { @@ -8136,7 +8136,7 @@ 78 | * { background: red; } `---- - x Number { value: 10.0, raw: "10", type_flag: Integer } + x Number(NumberToken { value: 10.0, raw: "10", type_flag: Integer }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:76:1] 76 | 77 | @supports (func(10, 20, 40)) { @@ -8168,7 +8168,7 @@ 78 | * { background: red; } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:76:1] 76 | 77 | @supports (func(10, 20, 40)) { @@ -8184,7 +8184,7 @@ 78 | * { background: red; } `---- - x Number { value: 20.0, raw: "20", type_flag: Integer } + x Number(NumberToken { value: 20.0, raw: "20", type_flag: Integer }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:76:1] 76 | 77 | @supports (func(10, 20, 40)) { @@ -8216,7 +8216,7 @@ 78 | * { background: red; } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:76:1] 76 | 77 | @supports (func(10, 20, 40)) { @@ -8232,7 +8232,7 @@ 78 | * { background: red; } `---- - x Number { value: 40.0, raw: "40", type_flag: Integer } + x Number(NumberToken { value: 40.0, raw: "40", type_flag: Integer }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:76:1] 76 | 77 | @supports (func(10, 20, 40)) { @@ -8480,7 +8480,7 @@ 82 | * { background: red; } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:80:1] 80 | 81 | @supports ( func( 10 , 20 , 40 ) ) { @@ -8496,7 +8496,7 @@ 82 | * { background: red; } `---- - x Number { value: 10.0, raw: "10", type_flag: Integer } + x Number(NumberToken { value: 10.0, raw: "10", type_flag: Integer }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:80:1] 80 | 81 | @supports ( func( 10 , 20 , 40 ) ) { @@ -8512,7 +8512,7 @@ 82 | * { background: red; } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:80:1] 80 | 81 | @supports ( func( 10 , 20 , 40 ) ) { @@ -8544,7 +8544,7 @@ 82 | * { background: red; } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:80:1] 80 | 81 | @supports ( func( 10 , 20 , 40 ) ) { @@ -8560,7 +8560,7 @@ 82 | * { background: red; } `---- - x Number { value: 20.0, raw: "20", type_flag: Integer } + x Number(NumberToken { value: 20.0, raw: "20", type_flag: Integer }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:80:1] 80 | 81 | @supports ( func( 10 , 20 , 40 ) ) { @@ -8576,7 +8576,7 @@ 82 | * { background: red; } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:80:1] 80 | 81 | @supports ( func( 10 , 20 , 40 ) ) { @@ -8608,7 +8608,7 @@ 82 | * { background: red; } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:80:1] 80 | 81 | @supports ( func( 10 , 20 , 40 ) ) { @@ -8624,7 +8624,7 @@ 82 | * { background: red; } `---- - x Number { value: 40.0, raw: "40", type_flag: Integer } + x Number(NumberToken { value: 40.0, raw: "40", type_flag: Integer }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:80:1] 80 | 81 | @supports ( func( 10 , 20 , 40 ) ) { @@ -8640,7 +8640,7 @@ 82 | * { background: red; } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:80:1] 80 | 81 | @supports ( func( 10 , 20 , 40 ) ) { @@ -9007,7 +9007,7 @@ 87 | from { `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:85:1] 85 | @supports (animation-name: test) { 86 | @-custom-keyframe anim { @@ -9023,7 +9023,7 @@ 87 | from { `---- - x Ident { value: Atom('anim' type=inline), raw: "anim" } + x Ident(IdentToken { value: Atom('anim' type=inline), raw: "anim" }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:85:1] 85 | @supports (animation-name: test) { 86 | @-custom-keyframe anim { @@ -9039,7 +9039,7 @@ 87 | from { `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:85:1] 85 | @supports (animation-name: test) { 86 | @-custom-keyframe anim { @@ -9077,7 +9077,7 @@ 88 | color: black; `---- - x WhiteSpace { value: "\n " } + x WhiteSpace(WhiteSpaceToken { value: "\n " }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:85:1] 85 | @supports (animation-name: test) { 86 | ,-> @-custom-keyframe anim { @@ -9093,7 +9093,7 @@ 88 | color: black; `---- - x Ident { value: Atom('from' type=static), raw: "from" } + x Ident(IdentToken { value: Atom('from' type=static), raw: "from" }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:86:1] 86 | @-custom-keyframe anim { 87 | from { @@ -9109,7 +9109,7 @@ 88 | color: black; `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:86:1] 86 | @-custom-keyframe anim { 87 | from { @@ -9151,7 +9151,7 @@ 89 | } `---- - x WhiteSpace { value: "\n " } + x WhiteSpace(WhiteSpaceToken { value: "\n " }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:86:1] 86 | @-custom-keyframe anim { 87 | ,-> from { @@ -9167,7 +9167,7 @@ 89 | } `---- - x Ident { value: Atom('color' type=static), raw: "color" } + x Ident(IdentToken { value: Atom('color' type=static), raw: "color" }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:87:1] 87 | from { 88 | color: black; @@ -9199,7 +9199,7 @@ 89 | } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:87:1] 87 | from { 88 | color: black; @@ -9215,7 +9215,7 @@ 89 | } `---- - x Ident { value: Atom('black' type=inline), raw: "black" } + x Ident(IdentToken { value: Atom('black' type=inline), raw: "black" }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:87:1] 87 | from { 88 | color: black; @@ -9247,7 +9247,7 @@ 90 | to { `---- - x WhiteSpace { value: "\n " } + x WhiteSpace(WhiteSpaceToken { value: "\n " }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:87:1] 87 | from { 88 | ,-> color: black; @@ -9263,7 +9263,7 @@ 91 | color: white `---- - x WhiteSpace { value: "\n " } + x WhiteSpace(WhiteSpaceToken { value: "\n " }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:88:1] 88 | color: black; 89 | ,-> } @@ -9279,7 +9279,7 @@ 91 | color: white `---- - x Ident { value: Atom('to' type=static), raw: "to" } + x Ident(IdentToken { value: Atom('to' type=static), raw: "to" }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:89:1] 89 | } 90 | to { @@ -9295,7 +9295,7 @@ 91 | color: white `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:89:1] 89 | } 90 | to { @@ -9337,7 +9337,7 @@ 92 | } `---- - x WhiteSpace { value: "\n " } + x WhiteSpace(WhiteSpaceToken { value: "\n " }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:89:1] 89 | } 90 | ,-> to { @@ -9353,7 +9353,7 @@ 92 | } `---- - x Ident { value: Atom('color' type=static), raw: "color" } + x Ident(IdentToken { value: Atom('color' type=static), raw: "color" }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:90:1] 90 | to { 91 | color: white @@ -9385,7 +9385,7 @@ 92 | } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:90:1] 90 | to { 91 | color: white @@ -9401,7 +9401,7 @@ 92 | } `---- - x Ident { value: Atom('white' type=inline), raw: "white" } + x Ident(IdentToken { value: Atom('white' type=inline), raw: "white" }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:90:1] 90 | to { 91 | color: white @@ -9417,7 +9417,7 @@ 93 | } `---- - x WhiteSpace { value: "\n " } + x WhiteSpace(WhiteSpaceToken { value: "\n " }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:90:1] 90 | to { 91 | ,-> color: white @@ -9433,7 +9433,7 @@ 94 | } `---- - x WhiteSpace { value: "\n " } + x WhiteSpace(WhiteSpaceToken { value: "\n " }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:91:1] 91 | color: white 92 | ,-> } @@ -9521,7 +9521,7 @@ 97 | * { background: red; } `---- - x Ident { value: Atom('--var' type=inline), raw: "--var" } + x Ident(IdentToken { value: Atom('--var' type=inline), raw: "--var" }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:95:1] 95 | 96 | @supports (--var) { @@ -9781,7 +9781,7 @@ 101 | body { `---- - x Ident { value: Atom('green' type=inline), raw: "green" } + x Ident(IdentToken { value: Atom('green' type=inline), raw: "green" }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:99:1] 99 | 100 | @supports (--foo: green) { @@ -11608,7 +11608,7 @@ 124 | from { `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:122:1] 122 | @supports (animation-name: test) { 123 | @-custom-keyframe anim { @@ -11624,7 +11624,7 @@ 124 | from { `---- - x Ident { value: Atom('anim' type=inline), raw: "anim" } + x Ident(IdentToken { value: Atom('anim' type=inline), raw: "anim" }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:122:1] 122 | @supports (animation-name: test) { 123 | @-custom-keyframe anim { @@ -11640,7 +11640,7 @@ 124 | from { `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:122:1] 122 | @supports (animation-name: test) { 123 | @-custom-keyframe anim { @@ -11678,7 +11678,7 @@ 125 | color: black; `---- - x WhiteSpace { value: "\n " } + x WhiteSpace(WhiteSpaceToken { value: "\n " }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:122:1] 122 | @supports (animation-name: test) { 123 | ,-> @-custom-keyframe anim { @@ -11694,7 +11694,7 @@ 125 | color: black; `---- - x Ident { value: Atom('from' type=static), raw: "from" } + x Ident(IdentToken { value: Atom('from' type=static), raw: "from" }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:123:1] 123 | @-custom-keyframe anim { 124 | from { @@ -11710,7 +11710,7 @@ 125 | color: black; `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:123:1] 123 | @-custom-keyframe anim { 124 | from { @@ -11752,7 +11752,7 @@ 126 | } `---- - x WhiteSpace { value: "\n " } + x WhiteSpace(WhiteSpaceToken { value: "\n " }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:123:1] 123 | @-custom-keyframe anim { 124 | ,-> from { @@ -11768,7 +11768,7 @@ 126 | } `---- - x Ident { value: Atom('color' type=static), raw: "color" } + x Ident(IdentToken { value: Atom('color' type=static), raw: "color" }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:124:1] 124 | from { 125 | color: black; @@ -11800,7 +11800,7 @@ 126 | } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:124:1] 124 | from { 125 | color: black; @@ -11816,7 +11816,7 @@ 126 | } `---- - x Ident { value: Atom('black' type=inline), raw: "black" } + x Ident(IdentToken { value: Atom('black' type=inline), raw: "black" }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:124:1] 124 | from { 125 | color: black; @@ -11848,7 +11848,7 @@ 127 | to { `---- - x WhiteSpace { value: "\n " } + x WhiteSpace(WhiteSpaceToken { value: "\n " }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:124:1] 124 | from { 125 | ,-> color: black; @@ -11864,7 +11864,7 @@ 128 | color: white `---- - x WhiteSpace { value: "\n " } + x WhiteSpace(WhiteSpaceToken { value: "\n " }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:125:1] 125 | color: black; 126 | ,-> } @@ -11880,7 +11880,7 @@ 128 | color: white `---- - x Ident { value: Atom('to' type=static), raw: "to" } + x Ident(IdentToken { value: Atom('to' type=static), raw: "to" }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:126:1] 126 | } 127 | to { @@ -11896,7 +11896,7 @@ 128 | color: white `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:126:1] 126 | } 127 | to { @@ -11938,7 +11938,7 @@ 129 | } `---- - x WhiteSpace { value: "\n " } + x WhiteSpace(WhiteSpaceToken { value: "\n " }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:126:1] 126 | } 127 | ,-> to { @@ -11954,7 +11954,7 @@ 129 | } `---- - x Ident { value: Atom('color' type=static), raw: "color" } + x Ident(IdentToken { value: Atom('color' type=static), raw: "color" }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:127:1] 127 | to { 128 | color: white @@ -11986,7 +11986,7 @@ 129 | } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:127:1] 127 | to { 128 | color: white @@ -12002,7 +12002,7 @@ 129 | } `---- - x Ident { value: Atom('white' type=inline), raw: "white" } + x Ident(IdentToken { value: Atom('white' type=inline), raw: "white" }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:127:1] 127 | to { 128 | color: white @@ -12018,7 +12018,7 @@ 130 | } `---- - x WhiteSpace { value: "\n " } + x WhiteSpace(WhiteSpaceToken { value: "\n " }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:127:1] 127 | to { 128 | ,-> color: white @@ -12034,7 +12034,7 @@ 131 | } `---- - x WhiteSpace { value: "\n " } + x WhiteSpace(WhiteSpaceToken { value: "\n " }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:128:1] 128 | color: white 129 | ,-> } @@ -12910,7 +12910,7 @@ 146 | * { background: red; } `---- - x String { value: Atom('example' type=inline), raw: "\"example\"" } + x String(StringToken { value: Atom('example' type=inline), raw: "\"example\"" }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:144:1] 144 | 145 | @supports (func("example": 1)) { @@ -12942,7 +12942,7 @@ 146 | * { background: red; } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:144:1] 144 | 145 | @supports (func("example": 1)) { @@ -12958,7 +12958,7 @@ 146 | * { background: red; } `---- - x Number { value: 1.0, raw: "1", type_flag: Integer } + x Number(NumberToken { value: 1.0, raw: "1", type_flag: Integer }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:144:1] 144 | 145 | @supports (func("example": 1)) { @@ -13198,7 +13198,7 @@ 150 | * { background: red; } `---- - x Ident { value: Atom('--var' type=inline), raw: "--var" } + x Ident(IdentToken { value: Atom('--var' type=inline), raw: "--var" }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:148:1] 148 | 149 | @supports (--var) { @@ -13888,7 +13888,7 @@ 160 | * { background: red; } `---- - x String { value: Atom('example' type=inline), raw: "\"example\"" } + x String(StringToken { value: Atom('example' type=inline), raw: "\"example\"" }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:158:1] 158 | 159 | @supports ( func("example": 1) ) { @@ -13920,7 +13920,7 @@ 160 | * { background: red; } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:158:1] 158 | 159 | @supports ( func("example": 1) ) { @@ -13936,7 +13936,7 @@ 160 | * { background: red; } `---- - x Number { value: 1.0, raw: "1", type_flag: Integer } + x Number(NumberToken { value: 1.0, raw: "1", type_flag: Integer }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:158:1] 158 | 159 | @supports ( func("example": 1) ) { @@ -14176,7 +14176,7 @@ 164 | * { background: red; } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:162:1] 162 | 163 | @supports ( --var ) { @@ -14192,7 +14192,7 @@ 164 | * { background: red; } `---- - x Ident { value: Atom('--var' type=inline), raw: "--var" } + x Ident(IdentToken { value: Atom('--var' type=inline), raw: "--var" }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:162:1] 162 | 163 | @supports ( --var ) { @@ -14208,7 +14208,7 @@ 164 | * { background: red; } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:162:1] 162 | 163 | @supports ( --var ) { @@ -14448,7 +14448,7 @@ 168 | * { background: red; } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:166:1] 166 | 167 | @supports ( --var "test" ) { @@ -14464,7 +14464,7 @@ 168 | * { background: red; } `---- - x Ident { value: Atom('--var' type=inline), raw: "--var" } + x Ident(IdentToken { value: Atom('--var' type=inline), raw: "--var" }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:166:1] 166 | 167 | @supports ( --var "test" ) { @@ -14480,7 +14480,7 @@ 168 | * { background: red; } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:166:1] 166 | 167 | @supports ( --var "test" ) { @@ -14496,7 +14496,7 @@ 168 | * { background: red; } `---- - x String { value: Atom('test' type=inline), raw: "\"test\"" } + x String(StringToken { value: Atom('test' type=inline), raw: "\"test\"" }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:166:1] 166 | 167 | @supports ( --var "test" ) { @@ -14512,7 +14512,7 @@ 168 | * { background: red; } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/supports/input.css:166:1] 166 | 167 | @supports ( --var "test" ) { diff --git a/crates/swc_css_parser/tests/fixture/at-rule/unknown/span.swc-stderr b/crates/swc_css_parser/tests/fixture/at-rule/unknown/span.swc-stderr index bf4c6699d98a..ada307362210 100644 --- a/crates/swc_css_parser/tests/fixture/at-rule/unknown/span.swc-stderr +++ b/crates/swc_css_parser/tests/fixture/at-rule/unknown/span.swc-stderr @@ -136,7 +136,7 @@ 3 | @unknown "blah"; `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:1:1] 1 | @unknown; 2 | @unknown x y; @@ -152,7 +152,7 @@ 3 | @unknown "blah"; `---- - x Ident { value: Atom('x' type=static), raw: "x" } + x Ident(IdentToken { value: Atom('x' type=static), raw: "x" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:1:1] 1 | @unknown; 2 | @unknown x y; @@ -168,7 +168,7 @@ 3 | @unknown "blah"; `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:1:1] 1 | @unknown; 2 | @unknown x y; @@ -184,7 +184,7 @@ 3 | @unknown "blah"; `---- - x Ident { value: Atom('y' type=inline), raw: "y" } + x Ident(IdentToken { value: Atom('y' type=inline), raw: "y" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:1:1] 1 | @unknown; 2 | @unknown x y; @@ -232,7 +232,7 @@ 4 | @unknown \"blah\"; `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:2:1] 2 | @unknown x y; 3 | @unknown "blah"; @@ -248,7 +248,7 @@ 4 | @unknown \"blah\"; `---- - x String { value: Atom('blah' type=inline), raw: "\"blah\"" } + x String(StringToken { value: Atom('blah' type=inline), raw: "\"blah\"" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:2:1] 2 | @unknown x y; 3 | @unknown "blah"; @@ -296,7 +296,7 @@ 5 | @unknown /*test*/; `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:3:1] 3 | @unknown "blah"; 4 | @unknown \"blah\"; @@ -312,7 +312,7 @@ 5 | @unknown /*test*/; `---- - x Ident { value: Atom('"blah"' type=inline), raw: "\\\"blah\\\"" } + x Ident(IdentToken { value: Atom('"blah"' type=inline), raw: "\\\"blah\\\"" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:3:1] 3 | @unknown "blah"; 4 | @unknown \"blah\"; @@ -360,7 +360,7 @@ 6 | @unknown /*test*/x/*test*/ y; `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:4:1] 4 | @unknown \"blah\"; 5 | @unknown /*test*/; @@ -408,7 +408,7 @@ 7 | @unknown ; `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:5:1] 5 | @unknown /*test*/; 6 | @unknown /*test*/x/*test*/ y; @@ -424,7 +424,7 @@ 7 | @unknown ; `---- - x Ident { value: Atom('x' type=static), raw: "x" } + x Ident(IdentToken { value: Atom('x' type=static), raw: "x" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:5:1] 5 | @unknown /*test*/; 6 | @unknown /*test*/x/*test*/ y; @@ -440,7 +440,7 @@ 7 | @unknown ; `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:5:1] 5 | @unknown /*test*/; 6 | @unknown /*test*/x/*test*/ y; @@ -456,7 +456,7 @@ 7 | @unknown ; `---- - x Ident { value: Atom('y' type=inline), raw: "y" } + x Ident(IdentToken { value: Atom('y' type=inline), raw: "y" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:5:1] 5 | @unknown /*test*/; 6 | @unknown /*test*/x/*test*/ y; @@ -504,7 +504,7 @@ 8 | @unknown x y; `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:6:1] 6 | @unknown /*test*/x/*test*/ y; 7 | @unknown ; @@ -547,7 +547,7 @@ : ^^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:7:1] 7 | @unknown ; 8 | @unknown x y; @@ -561,7 +561,7 @@ : ^ `---- - x Ident { value: Atom('x' type=static), raw: "x" } + x Ident(IdentToken { value: Atom('x' type=static), raw: "x" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:7:1] 7 | @unknown ; 8 | @unknown x y; @@ -575,7 +575,7 @@ : ^^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:7:1] 7 | @unknown ; 8 | @unknown x y; @@ -589,7 +589,7 @@ : ^ `---- - x Ident { value: Atom('y' type=inline), raw: "y" } + x Ident(IdentToken { value: Atom('y' type=inline), raw: "y" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:7:1] 7 | @unknown ; 8 | @unknown x y; @@ -636,7 +636,7 @@ 11 | @\unknown {} `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:9:1] 9 | 10 | @unknown {} @@ -700,7 +700,7 @@ 12 | @unknown a b {} `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:10:1] 10 | @unknown {} 11 | @\unknown {} @@ -764,7 +764,7 @@ 13 | @unknown {p:v} `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:11:1] 11 | @\unknown {} 12 | @unknown a b {} @@ -780,7 +780,7 @@ 13 | @unknown {p:v} `---- - x Ident { value: Atom('a' type=static), raw: "a" } + x Ident(IdentToken { value: Atom('a' type=static), raw: "a" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:11:1] 11 | @\unknown {} 12 | @unknown a b {} @@ -796,7 +796,7 @@ 13 | @unknown {p:v} `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:11:1] 11 | @\unknown {} 12 | @unknown a b {} @@ -812,7 +812,7 @@ 13 | @unknown {p:v} `---- - x Ident { value: Atom('b' type=static), raw: "b" } + x Ident(IdentToken { value: Atom('b' type=static), raw: "b" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:11:1] 11 | @\unknown {} 12 | @unknown a b {} @@ -828,7 +828,7 @@ 13 | @unknown {p:v} `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:11:1] 11 | @\unknown {} 12 | @unknown a b {} @@ -892,7 +892,7 @@ 14 | @unknown x y {p:v} `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:12:1] 12 | @unknown a b {} 13 | @unknown {p:v} @@ -924,7 +924,7 @@ 14 | @unknown x y {p:v} `---- - x Ident { value: Atom('p' type=static), raw: "p" } + x Ident(IdentToken { value: Atom('p' type=static), raw: "p" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:12:1] 12 | @unknown a b {} 13 | @unknown {p:v} @@ -956,7 +956,7 @@ 14 | @unknown x y {p:v} `---- - x Ident { value: Atom('v' type=inline), raw: "v" } + x Ident(IdentToken { value: Atom('v' type=inline), raw: "v" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:12:1] 12 | @unknown a b {} 13 | @unknown {p:v} @@ -1004,7 +1004,7 @@ 15 | @unknown x, y x(1) {p:v} `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:13:1] 13 | @unknown {p:v} 14 | @unknown x y {p:v} @@ -1020,7 +1020,7 @@ 15 | @unknown x, y x(1) {p:v} `---- - x Ident { value: Atom('x' type=static), raw: "x" } + x Ident(IdentToken { value: Atom('x' type=static), raw: "x" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:13:1] 13 | @unknown {p:v} 14 | @unknown x y {p:v} @@ -1036,7 +1036,7 @@ 15 | @unknown x, y x(1) {p:v} `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:13:1] 13 | @unknown {p:v} 14 | @unknown x y {p:v} @@ -1052,7 +1052,7 @@ 15 | @unknown x, y x(1) {p:v} `---- - x Ident { value: Atom('y' type=inline), raw: "y" } + x Ident(IdentToken { value: Atom('y' type=inline), raw: "y" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:13:1] 13 | @unknown {p:v} 14 | @unknown x y {p:v} @@ -1068,7 +1068,7 @@ 15 | @unknown x, y x(1) {p:v} `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:13:1] 13 | @unknown {p:v} 14 | @unknown x y {p:v} @@ -1100,7 +1100,7 @@ 15 | @unknown x, y x(1) {p:v} `---- - x Ident { value: Atom('p' type=static), raw: "p" } + x Ident(IdentToken { value: Atom('p' type=static), raw: "p" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:13:1] 13 | @unknown {p:v} 14 | @unknown x y {p:v} @@ -1132,7 +1132,7 @@ 15 | @unknown x, y x(1) {p:v} `---- - x Ident { value: Atom('v' type=inline), raw: "v" } + x Ident(IdentToken { value: Atom('v' type=inline), raw: "v" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:13:1] 13 | @unknown {p:v} 14 | @unknown x y {p:v} @@ -1180,7 +1180,7 @@ 16 | @unknown x, y x(1+2) {p:v} `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:14:1] 14 | @unknown x y {p:v} 15 | @unknown x, y x(1) {p:v} @@ -1196,7 +1196,7 @@ 16 | @unknown x, y x(1+2) {p:v} `---- - x Ident { value: Atom('x' type=static), raw: "x" } + x Ident(IdentToken { value: Atom('x' type=static), raw: "x" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:14:1] 14 | @unknown x y {p:v} 15 | @unknown x, y x(1) {p:v} @@ -1228,7 +1228,7 @@ 16 | @unknown x, y x(1+2) {p:v} `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:14:1] 14 | @unknown x y {p:v} 15 | @unknown x, y x(1) {p:v} @@ -1244,7 +1244,7 @@ 16 | @unknown x, y x(1+2) {p:v} `---- - x Ident { value: Atom('y' type=inline), raw: "y" } + x Ident(IdentToken { value: Atom('y' type=inline), raw: "y" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:14:1] 14 | @unknown x y {p:v} 15 | @unknown x, y x(1) {p:v} @@ -1260,7 +1260,7 @@ 16 | @unknown x, y x(1+2) {p:v} `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:14:1] 14 | @unknown x y {p:v} 15 | @unknown x, y x(1) {p:v} @@ -1300,7 +1300,7 @@ 16 | @unknown x, y x(1+2) {p:v} `---- - x Number { value: 1.0, raw: "1", type_flag: Integer } + x Number(NumberToken { value: 1.0, raw: "1", type_flag: Integer }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:14:1] 14 | @unknown x y {p:v} 15 | @unknown x, y x(1) {p:v} @@ -1316,7 +1316,7 @@ 16 | @unknown x, y x(1+2) {p:v} `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:14:1] 14 | @unknown x y {p:v} 15 | @unknown x, y x(1) {p:v} @@ -1348,7 +1348,7 @@ 16 | @unknown x, y x(1+2) {p:v} `---- - x Ident { value: Atom('p' type=static), raw: "p" } + x Ident(IdentToken { value: Atom('p' type=static), raw: "p" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:14:1] 14 | @unknown x y {p:v} 15 | @unknown x, y x(1) {p:v} @@ -1380,7 +1380,7 @@ 16 | @unknown x, y x(1+2) {p:v} `---- - x Ident { value: Atom('v' type=inline), raw: "v" } + x Ident(IdentToken { value: Atom('v' type=inline), raw: "v" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:14:1] 14 | @unknown x y {p:v} 15 | @unknown x, y x(1) {p:v} @@ -1428,7 +1428,7 @@ 17 | @unknown/*test*/{/*test*/p/*test*/:/*test*/v/*test*/} `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:15:1] 15 | @unknown x, y x(1) {p:v} 16 | @unknown x, y x(1+2) {p:v} @@ -1444,7 +1444,7 @@ 17 | @unknown/*test*/{/*test*/p/*test*/:/*test*/v/*test*/} `---- - x Ident { value: Atom('x' type=static), raw: "x" } + x Ident(IdentToken { value: Atom('x' type=static), raw: "x" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:15:1] 15 | @unknown x, y x(1) {p:v} 16 | @unknown x, y x(1+2) {p:v} @@ -1476,7 +1476,7 @@ 17 | @unknown/*test*/{/*test*/p/*test*/:/*test*/v/*test*/} `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:15:1] 15 | @unknown x, y x(1) {p:v} 16 | @unknown x, y x(1+2) {p:v} @@ -1492,7 +1492,7 @@ 17 | @unknown/*test*/{/*test*/p/*test*/:/*test*/v/*test*/} `---- - x Ident { value: Atom('y' type=inline), raw: "y" } + x Ident(IdentToken { value: Atom('y' type=inline), raw: "y" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:15:1] 15 | @unknown x, y x(1) {p:v} 16 | @unknown x, y x(1+2) {p:v} @@ -1508,7 +1508,7 @@ 17 | @unknown/*test*/{/*test*/p/*test*/:/*test*/v/*test*/} `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:15:1] 15 | @unknown x, y x(1) {p:v} 16 | @unknown x, y x(1+2) {p:v} @@ -1548,7 +1548,7 @@ 17 | @unknown/*test*/{/*test*/p/*test*/:/*test*/v/*test*/} `---- - x Number { value: 1.0, raw: "1", type_flag: Integer } + x Number(NumberToken { value: 1.0, raw: "1", type_flag: Integer }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:15:1] 15 | @unknown x, y x(1) {p:v} 16 | @unknown x, y x(1+2) {p:v} @@ -1564,7 +1564,7 @@ 17 | @unknown/*test*/{/*test*/p/*test*/:/*test*/v/*test*/} `---- - x Number { value: 2.0, raw: "+2", type_flag: Integer } + x Number(NumberToken { value: 2.0, raw: "+2", type_flag: Integer }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:15:1] 15 | @unknown x, y x(1) {p:v} 16 | @unknown x, y x(1+2) {p:v} @@ -1580,7 +1580,7 @@ 17 | @unknown/*test*/{/*test*/p/*test*/:/*test*/v/*test*/} `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:15:1] 15 | @unknown x, y x(1) {p:v} 16 | @unknown x, y x(1+2) {p:v} @@ -1612,7 +1612,7 @@ 17 | @unknown/*test*/{/*test*/p/*test*/:/*test*/v/*test*/} `---- - x Ident { value: Atom('p' type=static), raw: "p" } + x Ident(IdentToken { value: Atom('p' type=static), raw: "p" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:15:1] 15 | @unknown x, y x(1) {p:v} 16 | @unknown x, y x(1+2) {p:v} @@ -1644,7 +1644,7 @@ 17 | @unknown/*test*/{/*test*/p/*test*/:/*test*/v/*test*/} `---- - x Ident { value: Atom('v' type=inline), raw: "v" } + x Ident(IdentToken { value: Atom('v' type=inline), raw: "v" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:15:1] 15 | @unknown x, y x(1) {p:v} 16 | @unknown x, y x(1+2) {p:v} @@ -1708,7 +1708,7 @@ 18 | @unknown /*test*/x/*test*/ y/*test*/{/*test*/p/*test*/:/*test*/v/*test*/} `---- - x Ident { value: Atom('p' type=static), raw: "p" } + x Ident(IdentToken { value: Atom('p' type=static), raw: "p" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:16:1] 16 | @unknown x, y x(1+2) {p:v} 17 | @unknown/*test*/{/*test*/p/*test*/:/*test*/v/*test*/} @@ -1740,7 +1740,7 @@ 18 | @unknown /*test*/x/*test*/ y/*test*/{/*test*/p/*test*/:/*test*/v/*test*/} `---- - x Ident { value: Atom('v' type=inline), raw: "v" } + x Ident(IdentToken { value: Atom('v' type=inline), raw: "v" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:16:1] 16 | @unknown x, y x(1+2) {p:v} 17 | @unknown/*test*/{/*test*/p/*test*/:/*test*/v/*test*/} @@ -1788,7 +1788,7 @@ 19 | /*@unknown !*test*!x!*test*!,!*test*!y!*test*! x(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}*/ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:17:1] 17 | @unknown/*test*/{/*test*/p/*test*/:/*test*/v/*test*/} 18 | @unknown /*test*/x/*test*/ y/*test*/{/*test*/p/*test*/:/*test*/v/*test*/} @@ -1804,7 +1804,7 @@ 19 | /*@unknown !*test*!x!*test*!,!*test*!y!*test*! x(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}*/ `---- - x Ident { value: Atom('x' type=static), raw: "x" } + x Ident(IdentToken { value: Atom('x' type=static), raw: "x" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:17:1] 17 | @unknown/*test*/{/*test*/p/*test*/:/*test*/v/*test*/} 18 | @unknown /*test*/x/*test*/ y/*test*/{/*test*/p/*test*/:/*test*/v/*test*/} @@ -1820,7 +1820,7 @@ 19 | /*@unknown !*test*!x!*test*!,!*test*!y!*test*! x(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}*/ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:17:1] 17 | @unknown/*test*/{/*test*/p/*test*/:/*test*/v/*test*/} 18 | @unknown /*test*/x/*test*/ y/*test*/{/*test*/p/*test*/:/*test*/v/*test*/} @@ -1836,7 +1836,7 @@ 19 | /*@unknown !*test*!x!*test*!,!*test*!y!*test*! x(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}*/ `---- - x Ident { value: Atom('y' type=inline), raw: "y" } + x Ident(IdentToken { value: Atom('y' type=inline), raw: "y" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:17:1] 17 | @unknown/*test*/{/*test*/p/*test*/:/*test*/v/*test*/} 18 | @unknown /*test*/x/*test*/ y/*test*/{/*test*/p/*test*/:/*test*/v/*test*/} @@ -1868,7 +1868,7 @@ 19 | /*@unknown !*test*!x!*test*!,!*test*!y!*test*! x(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}*/ `---- - x Ident { value: Atom('p' type=static), raw: "p" } + x Ident(IdentToken { value: Atom('p' type=static), raw: "p" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:17:1] 17 | @unknown/*test*/{/*test*/p/*test*/:/*test*/v/*test*/} 18 | @unknown /*test*/x/*test*/ y/*test*/{/*test*/p/*test*/:/*test*/v/*test*/} @@ -1900,7 +1900,7 @@ 19 | /*@unknown !*test*!x!*test*!,!*test*!y!*test*! x(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}*/ `---- - x Ident { value: Atom('v' type=inline), raw: "v" } + x Ident(IdentToken { value: Atom('v' type=inline), raw: "v" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:17:1] 17 | @unknown/*test*/{/*test*/p/*test*/:/*test*/v/*test*/} 18 | @unknown /*test*/x/*test*/ y/*test*/{/*test*/p/*test*/:/*test*/v/*test*/} @@ -1948,7 +1948,7 @@ 21 | @unknown x y { p : v } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:19:1] 19 | /*@unknown !*test*!x!*test*!,!*test*!y!*test*! x(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}*/ 20 | @unknown { p : v } @@ -1980,7 +1980,7 @@ 21 | @unknown x y { p : v } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:19:1] 19 | /*@unknown !*test*!x!*test*!,!*test*!y!*test*! x(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}*/ 20 | @unknown { p : v } @@ -1996,7 +1996,7 @@ 21 | @unknown x y { p : v } `---- - x Ident { value: Atom('p' type=static), raw: "p" } + x Ident(IdentToken { value: Atom('p' type=static), raw: "p" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:19:1] 19 | /*@unknown !*test*!x!*test*!,!*test*!y!*test*! x(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}*/ 20 | @unknown { p : v } @@ -2012,7 +2012,7 @@ 21 | @unknown x y { p : v } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:19:1] 19 | /*@unknown !*test*!x!*test*!,!*test*!y!*test*! x(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}*/ 20 | @unknown { p : v } @@ -2044,7 +2044,7 @@ 21 | @unknown x y { p : v } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:19:1] 19 | /*@unknown !*test*!x!*test*!,!*test*!y!*test*! x(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}*/ 20 | @unknown { p : v } @@ -2060,7 +2060,7 @@ 21 | @unknown x y { p : v } `---- - x Ident { value: Atom('v' type=inline), raw: "v" } + x Ident(IdentToken { value: Atom('v' type=inline), raw: "v" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:19:1] 19 | /*@unknown !*test*!x!*test*!,!*test*!y!*test*! x(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}*/ 20 | @unknown { p : v } @@ -2076,7 +2076,7 @@ 21 | @unknown x y { p : v } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:19:1] 19 | /*@unknown !*test*!x!*test*!,!*test*!y!*test*! x(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}*/ 20 | @unknown { p : v } @@ -2124,7 +2124,7 @@ 22 | @unknown x , y x( 1 + 2 ) { p : v } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:20:1] 20 | @unknown { p : v } 21 | @unknown x y { p : v } @@ -2140,7 +2140,7 @@ 22 | @unknown x , y x( 1 + 2 ) { p : v } `---- - x Ident { value: Atom('x' type=static), raw: "x" } + x Ident(IdentToken { value: Atom('x' type=static), raw: "x" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:20:1] 20 | @unknown { p : v } 21 | @unknown x y { p : v } @@ -2156,7 +2156,7 @@ 22 | @unknown x , y x( 1 + 2 ) { p : v } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:20:1] 20 | @unknown { p : v } 21 | @unknown x y { p : v } @@ -2172,7 +2172,7 @@ 22 | @unknown x , y x( 1 + 2 ) { p : v } `---- - x Ident { value: Atom('y' type=inline), raw: "y" } + x Ident(IdentToken { value: Atom('y' type=inline), raw: "y" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:20:1] 20 | @unknown { p : v } 21 | @unknown x y { p : v } @@ -2188,7 +2188,7 @@ 22 | @unknown x , y x( 1 + 2 ) { p : v } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:20:1] 20 | @unknown { p : v } 21 | @unknown x y { p : v } @@ -2220,7 +2220,7 @@ 22 | @unknown x , y x( 1 + 2 ) { p : v } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:20:1] 20 | @unknown { p : v } 21 | @unknown x y { p : v } @@ -2236,7 +2236,7 @@ 22 | @unknown x , y x( 1 + 2 ) { p : v } `---- - x Ident { value: Atom('p' type=static), raw: "p" } + x Ident(IdentToken { value: Atom('p' type=static), raw: "p" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:20:1] 20 | @unknown { p : v } 21 | @unknown x y { p : v } @@ -2252,7 +2252,7 @@ 22 | @unknown x , y x( 1 + 2 ) { p : v } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:20:1] 20 | @unknown { p : v } 21 | @unknown x y { p : v } @@ -2284,7 +2284,7 @@ 22 | @unknown x , y x( 1 + 2 ) { p : v } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:20:1] 20 | @unknown { p : v } 21 | @unknown x y { p : v } @@ -2300,7 +2300,7 @@ 22 | @unknown x , y x( 1 + 2 ) { p : v } `---- - x Ident { value: Atom('v' type=inline), raw: "v" } + x Ident(IdentToken { value: Atom('v' type=inline), raw: "v" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:20:1] 20 | @unknown { p : v } 21 | @unknown x y { p : v } @@ -2316,7 +2316,7 @@ 22 | @unknown x , y x( 1 + 2 ) { p : v } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:20:1] 20 | @unknown { p : v } 21 | @unknown x y { p : v } @@ -2359,7 +2359,7 @@ : ^^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:21:1] 21 | @unknown x y { p : v } 22 | @unknown x , y x( 1 + 2 ) { p : v } @@ -2373,7 +2373,7 @@ : ^ `---- - x Ident { value: Atom('x' type=static), raw: "x" } + x Ident(IdentToken { value: Atom('x' type=static), raw: "x" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:21:1] 21 | @unknown x y { p : v } 22 | @unknown x , y x( 1 + 2 ) { p : v } @@ -2387,7 +2387,7 @@ : ^^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:21:1] 21 | @unknown x y { p : v } 22 | @unknown x , y x( 1 + 2 ) { p : v } @@ -2415,7 +2415,7 @@ : ^^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:21:1] 21 | @unknown x y { p : v } 22 | @unknown x , y x( 1 + 2 ) { p : v } @@ -2429,7 +2429,7 @@ : ^ `---- - x Ident { value: Atom('y' type=inline), raw: "y" } + x Ident(IdentToken { value: Atom('y' type=inline), raw: "y" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:21:1] 21 | @unknown x y { p : v } 22 | @unknown x , y x( 1 + 2 ) { p : v } @@ -2443,7 +2443,7 @@ : ^^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:21:1] 21 | @unknown x y { p : v } 22 | @unknown x , y x( 1 + 2 ) { p : v } @@ -2478,7 +2478,7 @@ : ^^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:21:1] 21 | @unknown x y { p : v } 22 | @unknown x , y x( 1 + 2 ) { p : v } @@ -2492,7 +2492,7 @@ : ^ `---- - x Number { value: 1.0, raw: "1", type_flag: Integer } + x Number(NumberToken { value: 1.0, raw: "1", type_flag: Integer }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:21:1] 21 | @unknown x y { p : v } 22 | @unknown x , y x( 1 + 2 ) { p : v } @@ -2506,7 +2506,7 @@ : ^^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:21:1] 21 | @unknown x y { p : v } 22 | @unknown x , y x( 1 + 2 ) { p : v } @@ -2520,7 +2520,7 @@ : ^ `---- - x Delim { value: '+' } + x Delim(DelimToken { value: '+' }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:21:1] 21 | @unknown x y { p : v } 22 | @unknown x , y x( 1 + 2 ) { p : v } @@ -2534,7 +2534,7 @@ : ^^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:21:1] 21 | @unknown x y { p : v } 22 | @unknown x , y x( 1 + 2 ) { p : v } @@ -2548,7 +2548,7 @@ : ^ `---- - x Number { value: 2.0, raw: "2", type_flag: Integer } + x Number(NumberToken { value: 2.0, raw: "2", type_flag: Integer }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:21:1] 21 | @unknown x y { p : v } 22 | @unknown x , y x( 1 + 2 ) { p : v } @@ -2562,7 +2562,7 @@ : ^^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:21:1] 21 | @unknown x y { p : v } 22 | @unknown x , y x( 1 + 2 ) { p : v } @@ -2576,7 +2576,7 @@ : ^^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:21:1] 21 | @unknown x y { p : v } 22 | @unknown x , y x( 1 + 2 ) { p : v } @@ -2604,7 +2604,7 @@ : ^^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:21:1] 21 | @unknown x y { p : v } 22 | @unknown x , y x( 1 + 2 ) { p : v } @@ -2618,7 +2618,7 @@ : ^ `---- - x Ident { value: Atom('p' type=static), raw: "p" } + x Ident(IdentToken { value: Atom('p' type=static), raw: "p" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:21:1] 21 | @unknown x y { p : v } 22 | @unknown x , y x( 1 + 2 ) { p : v } @@ -2632,7 +2632,7 @@ : ^^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:21:1] 21 | @unknown x y { p : v } 22 | @unknown x , y x( 1 + 2 ) { p : v } @@ -2660,7 +2660,7 @@ : ^^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:21:1] 21 | @unknown x y { p : v } 22 | @unknown x , y x( 1 + 2 ) { p : v } @@ -2674,7 +2674,7 @@ : ^ `---- - x Ident { value: Atom('v' type=inline), raw: "v" } + x Ident(IdentToken { value: Atom('v' type=inline), raw: "v" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:21:1] 21 | @unknown x y { p : v } 22 | @unknown x , y x( 1 + 2 ) { p : v } @@ -2688,7 +2688,7 @@ : ^^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:21:1] 21 | @unknown x y { p : v } 22 | @unknown x , y x( 1 + 2 ) { p : v } @@ -2735,7 +2735,7 @@ 25 | @unknown x y {s{p:v}} `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:23:1] 23 | 24 | @unknown {s{p:v}} @@ -2767,7 +2767,7 @@ 25 | @unknown x y {s{p:v}} `---- - x Ident { value: Atom('s' type=static), raw: "s" } + x Ident(IdentToken { value: Atom('s' type=static), raw: "s" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:23:1] 23 | 24 | @unknown {s{p:v}} @@ -2807,7 +2807,7 @@ 25 | @unknown x y {s{p:v}} `---- - x Ident { value: Atom('p' type=static), raw: "p" } + x Ident(IdentToken { value: Atom('p' type=static), raw: "p" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:23:1] 23 | 24 | @unknown {s{p:v}} @@ -2839,7 +2839,7 @@ 25 | @unknown x y {s{p:v}} `---- - x Ident { value: Atom('v' type=inline), raw: "v" } + x Ident(IdentToken { value: Atom('v' type=inline), raw: "v" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:23:1] 23 | 24 | @unknown {s{p:v}} @@ -2887,7 +2887,7 @@ 26 | @unknown x, y f(1) {s{p:v}} `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:24:1] 24 | @unknown {s{p:v}} 25 | @unknown x y {s{p:v}} @@ -2903,7 +2903,7 @@ 26 | @unknown x, y f(1) {s{p:v}} `---- - x Ident { value: Atom('x' type=static), raw: "x" } + x Ident(IdentToken { value: Atom('x' type=static), raw: "x" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:24:1] 24 | @unknown {s{p:v}} 25 | @unknown x y {s{p:v}} @@ -2919,7 +2919,7 @@ 26 | @unknown x, y f(1) {s{p:v}} `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:24:1] 24 | @unknown {s{p:v}} 25 | @unknown x y {s{p:v}} @@ -2935,7 +2935,7 @@ 26 | @unknown x, y f(1) {s{p:v}} `---- - x Ident { value: Atom('y' type=inline), raw: "y" } + x Ident(IdentToken { value: Atom('y' type=inline), raw: "y" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:24:1] 24 | @unknown {s{p:v}} 25 | @unknown x y {s{p:v}} @@ -2951,7 +2951,7 @@ 26 | @unknown x, y f(1) {s{p:v}} `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:24:1] 24 | @unknown {s{p:v}} 25 | @unknown x y {s{p:v}} @@ -2983,7 +2983,7 @@ 26 | @unknown x, y f(1) {s{p:v}} `---- - x Ident { value: Atom('s' type=static), raw: "s" } + x Ident(IdentToken { value: Atom('s' type=static), raw: "s" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:24:1] 24 | @unknown {s{p:v}} 25 | @unknown x y {s{p:v}} @@ -3023,7 +3023,7 @@ 26 | @unknown x, y f(1) {s{p:v}} `---- - x Ident { value: Atom('p' type=static), raw: "p" } + x Ident(IdentToken { value: Atom('p' type=static), raw: "p" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:24:1] 24 | @unknown {s{p:v}} 25 | @unknown x y {s{p:v}} @@ -3055,7 +3055,7 @@ 26 | @unknown x, y f(1) {s{p:v}} `---- - x Ident { value: Atom('v' type=inline), raw: "v" } + x Ident(IdentToken { value: Atom('v' type=inline), raw: "v" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:24:1] 24 | @unknown {s{p:v}} 25 | @unknown x y {s{p:v}} @@ -3103,7 +3103,7 @@ 27 | @unknown x, y f(1+2) {s{p:v}} `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:25:1] 25 | @unknown x y {s{p:v}} 26 | @unknown x, y f(1) {s{p:v}} @@ -3119,7 +3119,7 @@ 27 | @unknown x, y f(1+2) {s{p:v}} `---- - x Ident { value: Atom('x' type=static), raw: "x" } + x Ident(IdentToken { value: Atom('x' type=static), raw: "x" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:25:1] 25 | @unknown x y {s{p:v}} 26 | @unknown x, y f(1) {s{p:v}} @@ -3151,7 +3151,7 @@ 27 | @unknown x, y f(1+2) {s{p:v}} `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:25:1] 25 | @unknown x y {s{p:v}} 26 | @unknown x, y f(1) {s{p:v}} @@ -3167,7 +3167,7 @@ 27 | @unknown x, y f(1+2) {s{p:v}} `---- - x Ident { value: Atom('y' type=inline), raw: "y" } + x Ident(IdentToken { value: Atom('y' type=inline), raw: "y" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:25:1] 25 | @unknown x y {s{p:v}} 26 | @unknown x, y f(1) {s{p:v}} @@ -3183,7 +3183,7 @@ 27 | @unknown x, y f(1+2) {s{p:v}} `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:25:1] 25 | @unknown x y {s{p:v}} 26 | @unknown x, y f(1) {s{p:v}} @@ -3223,7 +3223,7 @@ 27 | @unknown x, y f(1+2) {s{p:v}} `---- - x Number { value: 1.0, raw: "1", type_flag: Integer } + x Number(NumberToken { value: 1.0, raw: "1", type_flag: Integer }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:25:1] 25 | @unknown x y {s{p:v}} 26 | @unknown x, y f(1) {s{p:v}} @@ -3239,7 +3239,7 @@ 27 | @unknown x, y f(1+2) {s{p:v}} `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:25:1] 25 | @unknown x y {s{p:v}} 26 | @unknown x, y f(1) {s{p:v}} @@ -3271,7 +3271,7 @@ 27 | @unknown x, y f(1+2) {s{p:v}} `---- - x Ident { value: Atom('s' type=static), raw: "s" } + x Ident(IdentToken { value: Atom('s' type=static), raw: "s" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:25:1] 25 | @unknown x y {s{p:v}} 26 | @unknown x, y f(1) {s{p:v}} @@ -3311,7 +3311,7 @@ 27 | @unknown x, y f(1+2) {s{p:v}} `---- - x Ident { value: Atom('p' type=static), raw: "p" } + x Ident(IdentToken { value: Atom('p' type=static), raw: "p" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:25:1] 25 | @unknown x y {s{p:v}} 26 | @unknown x, y f(1) {s{p:v}} @@ -3343,7 +3343,7 @@ 27 | @unknown x, y f(1+2) {s{p:v}} `---- - x Ident { value: Atom('v' type=inline), raw: "v" } + x Ident(IdentToken { value: Atom('v' type=inline), raw: "v" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:25:1] 25 | @unknown x y {s{p:v}} 26 | @unknown x, y f(1) {s{p:v}} @@ -3391,7 +3391,7 @@ 28 | @unknown { .a { p: v; } .b { p: v } } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:26:1] 26 | @unknown x, y f(1) {s{p:v}} 27 | @unknown x, y f(1+2) {s{p:v}} @@ -3407,7 +3407,7 @@ 28 | @unknown { .a { p: v; } .b { p: v } } `---- - x Ident { value: Atom('x' type=static), raw: "x" } + x Ident(IdentToken { value: Atom('x' type=static), raw: "x" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:26:1] 26 | @unknown x, y f(1) {s{p:v}} 27 | @unknown x, y f(1+2) {s{p:v}} @@ -3439,7 +3439,7 @@ 28 | @unknown { .a { p: v; } .b { p: v } } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:26:1] 26 | @unknown x, y f(1) {s{p:v}} 27 | @unknown x, y f(1+2) {s{p:v}} @@ -3455,7 +3455,7 @@ 28 | @unknown { .a { p: v; } .b { p: v } } `---- - x Ident { value: Atom('y' type=inline), raw: "y" } + x Ident(IdentToken { value: Atom('y' type=inline), raw: "y" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:26:1] 26 | @unknown x, y f(1) {s{p:v}} 27 | @unknown x, y f(1+2) {s{p:v}} @@ -3471,7 +3471,7 @@ 28 | @unknown { .a { p: v; } .b { p: v } } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:26:1] 26 | @unknown x, y f(1) {s{p:v}} 27 | @unknown x, y f(1+2) {s{p:v}} @@ -3511,7 +3511,7 @@ 28 | @unknown { .a { p: v; } .b { p: v } } `---- - x Number { value: 1.0, raw: "1", type_flag: Integer } + x Number(NumberToken { value: 1.0, raw: "1", type_flag: Integer }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:26:1] 26 | @unknown x, y f(1) {s{p:v}} 27 | @unknown x, y f(1+2) {s{p:v}} @@ -3527,7 +3527,7 @@ 28 | @unknown { .a { p: v; } .b { p: v } } `---- - x Number { value: 2.0, raw: "+2", type_flag: Integer } + x Number(NumberToken { value: 2.0, raw: "+2", type_flag: Integer }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:26:1] 26 | @unknown x, y f(1) {s{p:v}} 27 | @unknown x, y f(1+2) {s{p:v}} @@ -3543,7 +3543,7 @@ 28 | @unknown { .a { p: v; } .b { p: v } } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:26:1] 26 | @unknown x, y f(1) {s{p:v}} 27 | @unknown x, y f(1+2) {s{p:v}} @@ -3575,7 +3575,7 @@ 28 | @unknown { .a { p: v; } .b { p: v } } `---- - x Ident { value: Atom('s' type=static), raw: "s" } + x Ident(IdentToken { value: Atom('s' type=static), raw: "s" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:26:1] 26 | @unknown x, y f(1) {s{p:v}} 27 | @unknown x, y f(1+2) {s{p:v}} @@ -3615,7 +3615,7 @@ 28 | @unknown { .a { p: v; } .b { p: v } } `---- - x Ident { value: Atom('p' type=static), raw: "p" } + x Ident(IdentToken { value: Atom('p' type=static), raw: "p" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:26:1] 26 | @unknown x, y f(1) {s{p:v}} 27 | @unknown x, y f(1+2) {s{p:v}} @@ -3647,7 +3647,7 @@ 28 | @unknown { .a { p: v; } .b { p: v } } `---- - x Ident { value: Atom('v' type=inline), raw: "v" } + x Ident(IdentToken { value: Atom('v' type=inline), raw: "v" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:26:1] 26 | @unknown x, y f(1) {s{p:v}} 27 | @unknown x, y f(1+2) {s{p:v}} @@ -3695,7 +3695,7 @@ 29 | @unknown/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:27:1] 27 | @unknown x, y f(1+2) {s{p:v}} 28 | @unknown { .a { p: v; } .b { p: v } } @@ -3727,7 +3727,7 @@ 29 | @unknown/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:27:1] 27 | @unknown x, y f(1+2) {s{p:v}} 28 | @unknown { .a { p: v; } .b { p: v } } @@ -3743,7 +3743,7 @@ 29 | @unknown/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} `---- - x Delim { value: '.' } + x Delim(DelimToken { value: '.' }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:27:1] 27 | @unknown x, y f(1+2) {s{p:v}} 28 | @unknown { .a { p: v; } .b { p: v } } @@ -3759,7 +3759,7 @@ 29 | @unknown/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} `---- - x Ident { value: Atom('a' type=static), raw: "a" } + x Ident(IdentToken { value: Atom('a' type=static), raw: "a" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:27:1] 27 | @unknown x, y f(1+2) {s{p:v}} 28 | @unknown { .a { p: v; } .b { p: v } } @@ -3775,7 +3775,7 @@ 29 | @unknown/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:27:1] 27 | @unknown x, y f(1+2) {s{p:v}} 28 | @unknown { .a { p: v; } .b { p: v } } @@ -3815,7 +3815,7 @@ 29 | @unknown/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:27:1] 27 | @unknown x, y f(1+2) {s{p:v}} 28 | @unknown { .a { p: v; } .b { p: v } } @@ -3831,7 +3831,7 @@ 29 | @unknown/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} `---- - x Ident { value: Atom('p' type=static), raw: "p" } + x Ident(IdentToken { value: Atom('p' type=static), raw: "p" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:27:1] 27 | @unknown x, y f(1+2) {s{p:v}} 28 | @unknown { .a { p: v; } .b { p: v } } @@ -3863,7 +3863,7 @@ 29 | @unknown/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:27:1] 27 | @unknown x, y f(1+2) {s{p:v}} 28 | @unknown { .a { p: v; } .b { p: v } } @@ -3879,7 +3879,7 @@ 29 | @unknown/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} `---- - x Ident { value: Atom('v' type=inline), raw: "v" } + x Ident(IdentToken { value: Atom('v' type=inline), raw: "v" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:27:1] 27 | @unknown x, y f(1+2) {s{p:v}} 28 | @unknown { .a { p: v; } .b { p: v } } @@ -3911,7 +3911,7 @@ 29 | @unknown/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:27:1] 27 | @unknown x, y f(1+2) {s{p:v}} 28 | @unknown { .a { p: v; } .b { p: v } } @@ -3927,7 +3927,7 @@ 29 | @unknown/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:27:1] 27 | @unknown x, y f(1+2) {s{p:v}} 28 | @unknown { .a { p: v; } .b { p: v } } @@ -3943,7 +3943,7 @@ 29 | @unknown/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} `---- - x Delim { value: '.' } + x Delim(DelimToken { value: '.' }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:27:1] 27 | @unknown x, y f(1+2) {s{p:v}} 28 | @unknown { .a { p: v; } .b { p: v } } @@ -3959,7 +3959,7 @@ 29 | @unknown/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} `---- - x Ident { value: Atom('b' type=static), raw: "b" } + x Ident(IdentToken { value: Atom('b' type=static), raw: "b" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:27:1] 27 | @unknown x, y f(1+2) {s{p:v}} 28 | @unknown { .a { p: v; } .b { p: v } } @@ -3975,7 +3975,7 @@ 29 | @unknown/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:27:1] 27 | @unknown x, y f(1+2) {s{p:v}} 28 | @unknown { .a { p: v; } .b { p: v } } @@ -4015,7 +4015,7 @@ 29 | @unknown/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:27:1] 27 | @unknown x, y f(1+2) {s{p:v}} 28 | @unknown { .a { p: v; } .b { p: v } } @@ -4031,7 +4031,7 @@ 29 | @unknown/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} `---- - x Ident { value: Atom('p' type=static), raw: "p" } + x Ident(IdentToken { value: Atom('p' type=static), raw: "p" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:27:1] 27 | @unknown x, y f(1+2) {s{p:v}} 28 | @unknown { .a { p: v; } .b { p: v } } @@ -4063,7 +4063,7 @@ 29 | @unknown/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:27:1] 27 | @unknown x, y f(1+2) {s{p:v}} 28 | @unknown { .a { p: v; } .b { p: v } } @@ -4079,7 +4079,7 @@ 29 | @unknown/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} `---- - x Ident { value: Atom('v' type=inline), raw: "v" } + x Ident(IdentToken { value: Atom('v' type=inline), raw: "v" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:27:1] 27 | @unknown x, y f(1+2) {s{p:v}} 28 | @unknown { .a { p: v; } .b { p: v } } @@ -4095,7 +4095,7 @@ 29 | @unknown/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:27:1] 27 | @unknown x, y f(1+2) {s{p:v}} 28 | @unknown { .a { p: v; } .b { p: v } } @@ -4111,7 +4111,7 @@ 29 | @unknown/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:27:1] 27 | @unknown x, y f(1+2) {s{p:v}} 28 | @unknown { .a { p: v; } .b { p: v } } @@ -4175,7 +4175,7 @@ 30 | @unknown /*test*/x/*test*/ y/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} `---- - x Ident { value: Atom('s' type=static), raw: "s" } + x Ident(IdentToken { value: Atom('s' type=static), raw: "s" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:28:1] 28 | @unknown { .a { p: v; } .b { p: v } } 29 | @unknown/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} @@ -4215,7 +4215,7 @@ 30 | @unknown /*test*/x/*test*/ y/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} `---- - x Ident { value: Atom('p' type=static), raw: "p" } + x Ident(IdentToken { value: Atom('p' type=static), raw: "p" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:28:1] 28 | @unknown { .a { p: v; } .b { p: v } } 29 | @unknown/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} @@ -4247,7 +4247,7 @@ 30 | @unknown /*test*/x/*test*/ y/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} `---- - x Ident { value: Atom('v' type=inline), raw: "v" } + x Ident(IdentToken { value: Atom('v' type=inline), raw: "v" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:28:1] 28 | @unknown { .a { p: v; } .b { p: v } } 29 | @unknown/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} @@ -4295,7 +4295,7 @@ 31 | /*@unknown !*test*!x!*test*!,!*test*!y!*test*! f(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!s!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}!*test*!}*/ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:29:1] 29 | @unknown/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} 30 | @unknown /*test*/x/*test*/ y/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} @@ -4311,7 +4311,7 @@ 31 | /*@unknown !*test*!x!*test*!,!*test*!y!*test*! f(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!s!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}!*test*!}*/ `---- - x Ident { value: Atom('x' type=static), raw: "x" } + x Ident(IdentToken { value: Atom('x' type=static), raw: "x" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:29:1] 29 | @unknown/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} 30 | @unknown /*test*/x/*test*/ y/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} @@ -4327,7 +4327,7 @@ 31 | /*@unknown !*test*!x!*test*!,!*test*!y!*test*! f(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!s!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}!*test*!}*/ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:29:1] 29 | @unknown/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} 30 | @unknown /*test*/x/*test*/ y/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} @@ -4343,7 +4343,7 @@ 31 | /*@unknown !*test*!x!*test*!,!*test*!y!*test*! f(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!s!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}!*test*!}*/ `---- - x Ident { value: Atom('y' type=inline), raw: "y" } + x Ident(IdentToken { value: Atom('y' type=inline), raw: "y" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:29:1] 29 | @unknown/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} 30 | @unknown /*test*/x/*test*/ y/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} @@ -4375,7 +4375,7 @@ 31 | /*@unknown !*test*!x!*test*!,!*test*!y!*test*! f(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!s!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}!*test*!}*/ `---- - x Ident { value: Atom('s' type=static), raw: "s" } + x Ident(IdentToken { value: Atom('s' type=static), raw: "s" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:29:1] 29 | @unknown/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} 30 | @unknown /*test*/x/*test*/ y/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} @@ -4415,7 +4415,7 @@ 31 | /*@unknown !*test*!x!*test*!,!*test*!y!*test*! f(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!s!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}!*test*!}*/ `---- - x Ident { value: Atom('p' type=static), raw: "p" } + x Ident(IdentToken { value: Atom('p' type=static), raw: "p" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:29:1] 29 | @unknown/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} 30 | @unknown /*test*/x/*test*/ y/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} @@ -4447,7 +4447,7 @@ 31 | /*@unknown !*test*!x!*test*!,!*test*!y!*test*! f(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!s!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}!*test*!}*/ `---- - x Ident { value: Atom('v' type=inline), raw: "v" } + x Ident(IdentToken { value: Atom('v' type=inline), raw: "v" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:29:1] 29 | @unknown/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} 30 | @unknown /*test*/x/*test*/ y/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} @@ -4495,7 +4495,7 @@ 33 | @unknown x y { s { p : v } } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:31:1] 31 | /*@unknown !*test*!x!*test*!,!*test*!y!*test*! f(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!s!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}!*test*!}*/ 32 | @unknown { s { p : v } } @@ -4527,7 +4527,7 @@ 33 | @unknown x y { s { p : v } } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:31:1] 31 | /*@unknown !*test*!x!*test*!,!*test*!y!*test*! f(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!s!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}!*test*!}*/ 32 | @unknown { s { p : v } } @@ -4543,7 +4543,7 @@ 33 | @unknown x y { s { p : v } } `---- - x Ident { value: Atom('s' type=static), raw: "s" } + x Ident(IdentToken { value: Atom('s' type=static), raw: "s" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:31:1] 31 | /*@unknown !*test*!x!*test*!,!*test*!y!*test*! f(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!s!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}!*test*!}*/ 32 | @unknown { s { p : v } } @@ -4559,7 +4559,7 @@ 33 | @unknown x y { s { p : v } } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:31:1] 31 | /*@unknown !*test*!x!*test*!,!*test*!y!*test*! f(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!s!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}!*test*!}*/ 32 | @unknown { s { p : v } } @@ -4599,7 +4599,7 @@ 33 | @unknown x y { s { p : v } } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:31:1] 31 | /*@unknown !*test*!x!*test*!,!*test*!y!*test*! f(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!s!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}!*test*!}*/ 32 | @unknown { s { p : v } } @@ -4615,7 +4615,7 @@ 33 | @unknown x y { s { p : v } } `---- - x Ident { value: Atom('p' type=static), raw: "p" } + x Ident(IdentToken { value: Atom('p' type=static), raw: "p" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:31:1] 31 | /*@unknown !*test*!x!*test*!,!*test*!y!*test*! f(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!s!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}!*test*!}*/ 32 | @unknown { s { p : v } } @@ -4631,7 +4631,7 @@ 33 | @unknown x y { s { p : v } } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:31:1] 31 | /*@unknown !*test*!x!*test*!,!*test*!y!*test*! f(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!s!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}!*test*!}*/ 32 | @unknown { s { p : v } } @@ -4663,7 +4663,7 @@ 33 | @unknown x y { s { p : v } } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:31:1] 31 | /*@unknown !*test*!x!*test*!,!*test*!y!*test*! f(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!s!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}!*test*!}*/ 32 | @unknown { s { p : v } } @@ -4679,7 +4679,7 @@ 33 | @unknown x y { s { p : v } } `---- - x Ident { value: Atom('v' type=inline), raw: "v" } + x Ident(IdentToken { value: Atom('v' type=inline), raw: "v" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:31:1] 31 | /*@unknown !*test*!x!*test*!,!*test*!y!*test*! f(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!s!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}!*test*!}*/ 32 | @unknown { s { p : v } } @@ -4695,7 +4695,7 @@ 33 | @unknown x y { s { p : v } } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:31:1] 31 | /*@unknown !*test*!x!*test*!,!*test*!y!*test*! f(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!s!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}!*test*!}*/ 32 | @unknown { s { p : v } } @@ -4711,7 +4711,7 @@ 33 | @unknown x y { s { p : v } } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:31:1] 31 | /*@unknown !*test*!x!*test*!,!*test*!y!*test*! f(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!s!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}!*test*!}*/ 32 | @unknown { s { p : v } } @@ -4759,7 +4759,7 @@ 34 | @unknown x , y f( 1 ) { s { p : v } } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:32:1] 32 | @unknown { s { p : v } } 33 | @unknown x y { s { p : v } } @@ -4775,7 +4775,7 @@ 34 | @unknown x , y f( 1 ) { s { p : v } } `---- - x Ident { value: Atom('x' type=static), raw: "x" } + x Ident(IdentToken { value: Atom('x' type=static), raw: "x" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:32:1] 32 | @unknown { s { p : v } } 33 | @unknown x y { s { p : v } } @@ -4791,7 +4791,7 @@ 34 | @unknown x , y f( 1 ) { s { p : v } } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:32:1] 32 | @unknown { s { p : v } } 33 | @unknown x y { s { p : v } } @@ -4807,7 +4807,7 @@ 34 | @unknown x , y f( 1 ) { s { p : v } } `---- - x Ident { value: Atom('y' type=inline), raw: "y" } + x Ident(IdentToken { value: Atom('y' type=inline), raw: "y" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:32:1] 32 | @unknown { s { p : v } } 33 | @unknown x y { s { p : v } } @@ -4823,7 +4823,7 @@ 34 | @unknown x , y f( 1 ) { s { p : v } } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:32:1] 32 | @unknown { s { p : v } } 33 | @unknown x y { s { p : v } } @@ -4855,7 +4855,7 @@ 34 | @unknown x , y f( 1 ) { s { p : v } } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:32:1] 32 | @unknown { s { p : v } } 33 | @unknown x y { s { p : v } } @@ -4871,7 +4871,7 @@ 34 | @unknown x , y f( 1 ) { s { p : v } } `---- - x Ident { value: Atom('s' type=static), raw: "s" } + x Ident(IdentToken { value: Atom('s' type=static), raw: "s" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:32:1] 32 | @unknown { s { p : v } } 33 | @unknown x y { s { p : v } } @@ -4887,7 +4887,7 @@ 34 | @unknown x , y f( 1 ) { s { p : v } } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:32:1] 32 | @unknown { s { p : v } } 33 | @unknown x y { s { p : v } } @@ -4927,7 +4927,7 @@ 34 | @unknown x , y f( 1 ) { s { p : v } } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:32:1] 32 | @unknown { s { p : v } } 33 | @unknown x y { s { p : v } } @@ -4943,7 +4943,7 @@ 34 | @unknown x , y f( 1 ) { s { p : v } } `---- - x Ident { value: Atom('p' type=static), raw: "p" } + x Ident(IdentToken { value: Atom('p' type=static), raw: "p" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:32:1] 32 | @unknown { s { p : v } } 33 | @unknown x y { s { p : v } } @@ -4959,7 +4959,7 @@ 34 | @unknown x , y f( 1 ) { s { p : v } } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:32:1] 32 | @unknown { s { p : v } } 33 | @unknown x y { s { p : v } } @@ -4991,7 +4991,7 @@ 34 | @unknown x , y f( 1 ) { s { p : v } } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:32:1] 32 | @unknown { s { p : v } } 33 | @unknown x y { s { p : v } } @@ -5007,7 +5007,7 @@ 34 | @unknown x , y f( 1 ) { s { p : v } } `---- - x Ident { value: Atom('v' type=inline), raw: "v" } + x Ident(IdentToken { value: Atom('v' type=inline), raw: "v" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:32:1] 32 | @unknown { s { p : v } } 33 | @unknown x y { s { p : v } } @@ -5023,7 +5023,7 @@ 34 | @unknown x , y f( 1 ) { s { p : v } } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:32:1] 32 | @unknown { s { p : v } } 33 | @unknown x y { s { p : v } } @@ -5039,7 +5039,7 @@ 34 | @unknown x , y f( 1 ) { s { p : v } } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:32:1] 32 | @unknown { s { p : v } } 33 | @unknown x y { s { p : v } } @@ -5087,7 +5087,7 @@ 35 | @unknown x , y f( 1 2 ) { s { p : v } } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:33:1] 33 | @unknown x y { s { p : v } } 34 | @unknown x , y f( 1 ) { s { p : v } } @@ -5103,7 +5103,7 @@ 35 | @unknown x , y f( 1 2 ) { s { p : v } } `---- - x Ident { value: Atom('x' type=static), raw: "x" } + x Ident(IdentToken { value: Atom('x' type=static), raw: "x" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:33:1] 33 | @unknown x y { s { p : v } } 34 | @unknown x , y f( 1 ) { s { p : v } } @@ -5119,7 +5119,7 @@ 35 | @unknown x , y f( 1 2 ) { s { p : v } } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:33:1] 33 | @unknown x y { s { p : v } } 34 | @unknown x , y f( 1 ) { s { p : v } } @@ -5151,7 +5151,7 @@ 35 | @unknown x , y f( 1 2 ) { s { p : v } } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:33:1] 33 | @unknown x y { s { p : v } } 34 | @unknown x , y f( 1 ) { s { p : v } } @@ -5167,7 +5167,7 @@ 35 | @unknown x , y f( 1 2 ) { s { p : v } } `---- - x Ident { value: Atom('y' type=inline), raw: "y" } + x Ident(IdentToken { value: Atom('y' type=inline), raw: "y" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:33:1] 33 | @unknown x y { s { p : v } } 34 | @unknown x , y f( 1 ) { s { p : v } } @@ -5183,7 +5183,7 @@ 35 | @unknown x , y f( 1 2 ) { s { p : v } } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:33:1] 33 | @unknown x y { s { p : v } } 34 | @unknown x , y f( 1 ) { s { p : v } } @@ -5223,7 +5223,7 @@ 35 | @unknown x , y f( 1 2 ) { s { p : v } } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:33:1] 33 | @unknown x y { s { p : v } } 34 | @unknown x , y f( 1 ) { s { p : v } } @@ -5239,7 +5239,7 @@ 35 | @unknown x , y f( 1 2 ) { s { p : v } } `---- - x Number { value: 1.0, raw: "1", type_flag: Integer } + x Number(NumberToken { value: 1.0, raw: "1", type_flag: Integer }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:33:1] 33 | @unknown x y { s { p : v } } 34 | @unknown x , y f( 1 ) { s { p : v } } @@ -5255,7 +5255,7 @@ 35 | @unknown x , y f( 1 2 ) { s { p : v } } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:33:1] 33 | @unknown x y { s { p : v } } 34 | @unknown x , y f( 1 ) { s { p : v } } @@ -5271,7 +5271,7 @@ 35 | @unknown x , y f( 1 2 ) { s { p : v } } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:33:1] 33 | @unknown x y { s { p : v } } 34 | @unknown x , y f( 1 ) { s { p : v } } @@ -5303,7 +5303,7 @@ 35 | @unknown x , y f( 1 2 ) { s { p : v } } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:33:1] 33 | @unknown x y { s { p : v } } 34 | @unknown x , y f( 1 ) { s { p : v } } @@ -5319,7 +5319,7 @@ 35 | @unknown x , y f( 1 2 ) { s { p : v } } `---- - x Ident { value: Atom('s' type=static), raw: "s" } + x Ident(IdentToken { value: Atom('s' type=static), raw: "s" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:33:1] 33 | @unknown x y { s { p : v } } 34 | @unknown x , y f( 1 ) { s { p : v } } @@ -5335,7 +5335,7 @@ 35 | @unknown x , y f( 1 2 ) { s { p : v } } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:33:1] 33 | @unknown x y { s { p : v } } 34 | @unknown x , y f( 1 ) { s { p : v } } @@ -5375,7 +5375,7 @@ 35 | @unknown x , y f( 1 2 ) { s { p : v } } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:33:1] 33 | @unknown x y { s { p : v } } 34 | @unknown x , y f( 1 ) { s { p : v } } @@ -5391,7 +5391,7 @@ 35 | @unknown x , y f( 1 2 ) { s { p : v } } `---- - x Ident { value: Atom('p' type=static), raw: "p" } + x Ident(IdentToken { value: Atom('p' type=static), raw: "p" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:33:1] 33 | @unknown x y { s { p : v } } 34 | @unknown x , y f( 1 ) { s { p : v } } @@ -5407,7 +5407,7 @@ 35 | @unknown x , y f( 1 2 ) { s { p : v } } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:33:1] 33 | @unknown x y { s { p : v } } 34 | @unknown x , y f( 1 ) { s { p : v } } @@ -5439,7 +5439,7 @@ 35 | @unknown x , y f( 1 2 ) { s { p : v } } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:33:1] 33 | @unknown x y { s { p : v } } 34 | @unknown x , y f( 1 ) { s { p : v } } @@ -5455,7 +5455,7 @@ 35 | @unknown x , y f( 1 2 ) { s { p : v } } `---- - x Ident { value: Atom('v' type=inline), raw: "v" } + x Ident(IdentToken { value: Atom('v' type=inline), raw: "v" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:33:1] 33 | @unknown x y { s { p : v } } 34 | @unknown x , y f( 1 ) { s { p : v } } @@ -5471,7 +5471,7 @@ 35 | @unknown x , y f( 1 2 ) { s { p : v } } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:33:1] 33 | @unknown x y { s { p : v } } 34 | @unknown x , y f( 1 ) { s { p : v } } @@ -5487,7 +5487,7 @@ 35 | @unknown x , y f( 1 2 ) { s { p : v } } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:33:1] 33 | @unknown x y { s { p : v } } 34 | @unknown x , y f( 1 ) { s { p : v } } @@ -5530,7 +5530,7 @@ : ^^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:34:1] 34 | @unknown x , y f( 1 ) { s { p : v } } 35 | @unknown x , y f( 1 2 ) { s { p : v } } @@ -5544,7 +5544,7 @@ : ^ `---- - x Ident { value: Atom('x' type=static), raw: "x" } + x Ident(IdentToken { value: Atom('x' type=static), raw: "x" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:34:1] 34 | @unknown x , y f( 1 ) { s { p : v } } 35 | @unknown x , y f( 1 2 ) { s { p : v } } @@ -5558,7 +5558,7 @@ : ^^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:34:1] 34 | @unknown x , y f( 1 ) { s { p : v } } 35 | @unknown x , y f( 1 2 ) { s { p : v } } @@ -5586,7 +5586,7 @@ : ^^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:34:1] 34 | @unknown x , y f( 1 ) { s { p : v } } 35 | @unknown x , y f( 1 2 ) { s { p : v } } @@ -5600,7 +5600,7 @@ : ^ `---- - x Ident { value: Atom('y' type=inline), raw: "y" } + x Ident(IdentToken { value: Atom('y' type=inline), raw: "y" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:34:1] 34 | @unknown x , y f( 1 ) { s { p : v } } 35 | @unknown x , y f( 1 2 ) { s { p : v } } @@ -5614,7 +5614,7 @@ : ^^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:34:1] 34 | @unknown x , y f( 1 ) { s { p : v } } 35 | @unknown x , y f( 1 2 ) { s { p : v } } @@ -5649,7 +5649,7 @@ : ^^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:34:1] 34 | @unknown x , y f( 1 ) { s { p : v } } 35 | @unknown x , y f( 1 2 ) { s { p : v } } @@ -5663,7 +5663,7 @@ : ^ `---- - x Number { value: 1.0, raw: "1", type_flag: Integer } + x Number(NumberToken { value: 1.0, raw: "1", type_flag: Integer }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:34:1] 34 | @unknown x , y f( 1 ) { s { p : v } } 35 | @unknown x , y f( 1 2 ) { s { p : v } } @@ -5677,7 +5677,7 @@ : ^^^^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:34:1] 34 | @unknown x , y f( 1 ) { s { p : v } } 35 | @unknown x , y f( 1 2 ) { s { p : v } } @@ -5691,7 +5691,7 @@ : ^ `---- - x Number { value: 2.0, raw: "2", type_flag: Integer } + x Number(NumberToken { value: 2.0, raw: "2", type_flag: Integer }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:34:1] 34 | @unknown x , y f( 1 ) { s { p : v } } 35 | @unknown x , y f( 1 2 ) { s { p : v } } @@ -5705,7 +5705,7 @@ : ^^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:34:1] 34 | @unknown x , y f( 1 ) { s { p : v } } 35 | @unknown x , y f( 1 2 ) { s { p : v } } @@ -5719,7 +5719,7 @@ : ^^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:34:1] 34 | @unknown x , y f( 1 ) { s { p : v } } 35 | @unknown x , y f( 1 2 ) { s { p : v } } @@ -5747,7 +5747,7 @@ : ^^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:34:1] 34 | @unknown x , y f( 1 ) { s { p : v } } 35 | @unknown x , y f( 1 2 ) { s { p : v } } @@ -5761,7 +5761,7 @@ : ^ `---- - x Ident { value: Atom('s' type=static), raw: "s" } + x Ident(IdentToken { value: Atom('s' type=static), raw: "s" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:34:1] 34 | @unknown x , y f( 1 ) { s { p : v } } 35 | @unknown x , y f( 1 2 ) { s { p : v } } @@ -5775,7 +5775,7 @@ : ^^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:34:1] 34 | @unknown x , y f( 1 ) { s { p : v } } 35 | @unknown x , y f( 1 2 ) { s { p : v } } @@ -5810,7 +5810,7 @@ : ^^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:34:1] 34 | @unknown x , y f( 1 ) { s { p : v } } 35 | @unknown x , y f( 1 2 ) { s { p : v } } @@ -5824,7 +5824,7 @@ : ^ `---- - x Ident { value: Atom('p' type=static), raw: "p" } + x Ident(IdentToken { value: Atom('p' type=static), raw: "p" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:34:1] 34 | @unknown x , y f( 1 ) { s { p : v } } 35 | @unknown x , y f( 1 2 ) { s { p : v } } @@ -5838,7 +5838,7 @@ : ^^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:34:1] 34 | @unknown x , y f( 1 ) { s { p : v } } 35 | @unknown x , y f( 1 2 ) { s { p : v } } @@ -5866,7 +5866,7 @@ : ^^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:34:1] 34 | @unknown x , y f( 1 ) { s { p : v } } 35 | @unknown x , y f( 1 2 ) { s { p : v } } @@ -5880,7 +5880,7 @@ : ^ `---- - x Ident { value: Atom('v' type=inline), raw: "v" } + x Ident(IdentToken { value: Atom('v' type=inline), raw: "v" }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:34:1] 34 | @unknown x , y f( 1 ) { s { p : v } } 35 | @unknown x , y f( 1 2 ) { s { p : v } } @@ -5894,7 +5894,7 @@ : ^^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:34:1] 34 | @unknown x , y f( 1 ) { s { p : v } } 35 | @unknown x , y f( 1 2 ) { s { p : v } } @@ -5908,7 +5908,7 @@ : ^^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:34:1] 34 | @unknown x , y f( 1 ) { s { p : v } } 35 | @unknown x , y f( 1 2 ) { s { p : v } } @@ -5957,7 +5957,7 @@ 38 | --> {} `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:36:1] 36 | 37 | @unknown { @@ -5990,7 +5990,7 @@ 39 | {} @@ -6062,7 +6062,7 @@ 40 | } `---- - x WhiteSpace { value: "\n " } + x WhiteSpace(WhiteSpaceToken { value: "\n " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:37:1] 37 | @unknown { 38 | ,-> --> {} @@ -6094,7 +6094,7 @@ 40 | } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/fixture/at-rule/unknown/input.css:38:1] 38 | --> {} 39 | {} 39 | : ^^^ @@ -93,7 +93,7 @@ : ^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/cdo-and-cdc/input.css:1:1] 1 | : ^ @@ -119,7 +119,7 @@ 4 | color: red; `---- - x WhiteSpace { value: "\n\n" } + x WhiteSpace(WhiteSpaceToken { value: "\n\n" }) ,-[$DIR/tests/recovery/cdo-and-cdc/input.css:1:1] 1 | ,-> 2 | `-> @@ -135,7 +135,7 @@ 4 | color: red; `---- - x Ident { value: Atom('div' type=static), raw: "div" } + x Ident(IdentToken { value: Atom('div' type=static), raw: "div" }) ,-[$DIR/tests/recovery/cdo-and-cdc/input.css:2:1] 2 | 3 | div { @@ -151,7 +151,7 @@ 4 | color: red; `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/cdo-and-cdc/input.css:2:1] 2 | 3 | div { @@ -280,7 +280,7 @@ 7 | test `---- - x WhiteSpace { value: "\n\n" } + x WhiteSpace(WhiteSpaceToken { value: "\n\n" }) ,-[$DIR/tests/recovery/cdo-and-cdc/input.css:4:1] 4 | color: red; 5 | ,-> @@ -565,7 +565,7 @@ 16 | test `---- - x WhiteSpace { value: "\n\n" } + x WhiteSpace(WhiteSpaceToken { value: "\n\n" }) ,-[$DIR/tests/recovery/cdo-and-cdc/input.css:13:1] 13 | color: red; 14 | ,-> `---- - x WhiteSpace { value: "\n\n" } + x WhiteSpace(WhiteSpaceToken { value: "\n\n" }) ,-[$DIR/tests/recovery/cdo-and-cdc/input.css:15:1] 15 | 16 | ,-> test @@ -626,7 +626,7 @@ 21 | } `---- - x WhiteSpace { value: "\n\n " } + x WhiteSpace(WhiteSpaceToken { value: "\n\n " }) ,-[$DIR/tests/recovery/cdo-and-cdc/input.css:17:1] 17 | 18 | ,-> --> @@ -643,7 +643,7 @@ 21 | } `---- - x Ident { value: Atom('color' type=static), raw: "color" } + x Ident(IdentToken { value: Atom('color' type=static), raw: "color" }) ,-[$DIR/tests/recovery/cdo-and-cdc/input.css:19:1] 19 | 20 | color: blue; @@ -675,7 +675,7 @@ 21 | } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/cdo-and-cdc/input.css:19:1] 19 | 20 | color: blue; @@ -691,7 +691,7 @@ 21 | } `---- - x Ident { value: Atom('blue' type=inline), raw: "blue" } + x Ident(IdentToken { value: Atom('blue' type=inline), raw: "blue" }) ,-[$DIR/tests/recovery/cdo-and-cdc/input.css:19:1] 19 | 20 | color: blue; @@ -922,7 +922,7 @@ 27 | test `---- - x WhiteSpace { value: "\n\n" } + x WhiteSpace(WhiteSpaceToken { value: "\n\n" }) ,-[$DIR/tests/recovery/cdo-and-cdc/input.css:24:1] 24 | color: red; 25 | ,-> ; `---- - x WhiteSpace { value: "\n\n" } + x WhiteSpace(WhiteSpaceToken { value: "\n\n" }) ,-[$DIR/tests/recovery/cdo-and-cdc/input.css:26:1] 26 | 27 | ,-> test @@ -1189,7 +1189,7 @@ 36 | color: red; `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/cdo-and-cdc/input.css:34:1] 34 | a { 35 | @@ -1452,7 +1452,7 @@ 43 | 90% { left: 300px; } `---- - x WhiteSpace { value: "\n " } + x WhiteSpace(WhiteSpaceToken { value: "\n " }) ,-[$DIR/tests/recovery/cdo-and-cdc/input.css:40:1] 40 | @keyframes box { 41 | ,-> @@ -1468,7 +1468,7 @@ 43 | 90% { left: 300px; } `---- - x Percentage { value: 50.0, raw: "50" } + x Percentage(PercentageToken { value: 50.0, raw: "50" }) ,-[$DIR/tests/recovery/cdo-and-cdc/input.css:41:1] 41 | 42 | 50% { left: 0; } @@ -1484,7 +1484,7 @@ 43 | 90% { left: 300px; } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/cdo-and-cdc/input.css:41:1] 41 | 42 | 50% { left: 0; } diff --git a/crates/swc_css_parser/tests/recovery/comments/bad-comment-1/span.swc-stderr b/crates/swc_css_parser/tests/recovery/comments/bad-comment-1/span.swc-stderr index 052ad78b351c..9a07a2cbc5a7 100644 --- a/crates/swc_css_parser/tests/recovery/comments/bad-comment-1/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/comments/bad-comment-1/span.swc-stderr @@ -17,7 +17,7 @@ : ^ `---- - x Delim { value: '/' } + x Delim(DelimToken { value: '/' }) ,-[$DIR/tests/recovery/comments/bad-comment-1/input.css:1:1] 1 | // comment : ^ @@ -29,7 +29,7 @@ : ^ `---- - x Delim { value: '/' } + x Delim(DelimToken { value: '/' }) ,-[$DIR/tests/recovery/comments/bad-comment-1/input.css:1:1] 1 | // comment : ^ @@ -41,7 +41,7 @@ : ^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/comments/bad-comment-1/input.css:1:1] 1 | // comment : ^ @@ -53,7 +53,7 @@ : ^^^^^^^ `---- - x Ident { value: Atom('comment' type=inline), raw: "comment" } + x Ident(IdentToken { value: Atom('comment' type=inline), raw: "comment" }) ,-[$DIR/tests/recovery/comments/bad-comment-1/input.css:1:1] 1 | // comment : ^^^^^^^ diff --git a/crates/swc_css_parser/tests/recovery/comments/declaration/span.swc-stderr b/crates/swc_css_parser/tests/recovery/comments/declaration/span.swc-stderr index 54035356b409..a45f3efc44e8 100644 --- a/crates/swc_css_parser/tests/recovery/comments/declaration/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/comments/declaration/span.swc-stderr @@ -159,7 +159,7 @@ 3 | /* comment */: `---- - x String { value: Atom('test' type=inline), raw: "\"test\"" } + x String(StringToken { value: Atom('test' type=inline), raw: "\"test\"" }) ,-[$DIR/tests/recovery/comments/declaration/input.css:1:1] 1 | a { 2 | prop: url("test") /* comment */ /* comment */ @@ -175,7 +175,7 @@ 3 | /* comment */: `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/comments/declaration/input.css:1:1] 1 | a { 2 | prop: url("test") /* comment */ /* comment */ @@ -191,7 +191,7 @@ 3 | /* comment */: `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/comments/declaration/input.css:1:1] 1 | a { 2 | prop: url("test") /* comment */ /* comment */ @@ -207,7 +207,7 @@ 4 | } `---- - x WhiteSpace { value: "\n " } + x WhiteSpace(WhiteSpaceToken { value: "\n " }) ,-[$DIR/tests/recovery/comments/declaration/input.css:1:1] 1 | a { 2 | ,-> prop: url("test") /* comment */ /* comment */ diff --git a/crates/swc_css_parser/tests/recovery/declaration/bad-value-1/span.swc-stderr b/crates/swc_css_parser/tests/recovery/declaration/bad-value-1/span.swc-stderr index 8823d3655d44..1ffd5a65f2b8 100644 --- a/crates/swc_css_parser/tests/recovery/declaration/bad-value-1/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/declaration/bad-value-1/span.swc-stderr @@ -166,7 +166,7 @@ 3 | } `---- - x WhiteSpace { value: "\n" } + x WhiteSpace(WhiteSpaceToken { value: "\n" }) ,-[$DIR/tests/recovery/declaration/bad-value-1/input.css:1:1] 1 | a { 2 | --var: [; diff --git a/crates/swc_css_parser/tests/recovery/declaration/bad-value-2/span.swc-stderr b/crates/swc_css_parser/tests/recovery/declaration/bad-value-2/span.swc-stderr index e8665e187363..a518fa3b6340 100644 --- a/crates/swc_css_parser/tests/recovery/declaration/bad-value-2/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/declaration/bad-value-2/span.swc-stderr @@ -166,7 +166,7 @@ 3 | } `---- - x WhiteSpace { value: "\n" } + x WhiteSpace(WhiteSpaceToken { value: "\n" }) ,-[$DIR/tests/recovery/declaration/bad-value-2/input.css:1:1] 1 | a { 2 | --var: (; diff --git a/crates/swc_css_parser/tests/recovery/declaration/bad-value/span.swc-stderr b/crates/swc_css_parser/tests/recovery/declaration/bad-value/span.swc-stderr index 15e5f454ac22..e176a0ad209f 100644 --- a/crates/swc_css_parser/tests/recovery/declaration/bad-value/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/declaration/bad-value/span.swc-stderr @@ -287,7 +287,7 @@ 5 | --foo: !; `---- - x BadUrl { raw: ("url", "test test") } + x BadUrl(BadUrlToken { raw: ("url", "test test") }) ,-[$DIR/tests/recovery/declaration/bad-value/input.css:3:1] 3 | value: ]; 4 | value: url(test test); @@ -343,7 +343,7 @@ 6 | --foo: ); `---- - x Delim { value: '!' } + x Delim(DelimToken { value: '!' }) ,-[$DIR/tests/recovery/declaration/bad-value/input.css:4:1] 4 | value: url(test test); 5 | --foo: !; @@ -511,7 +511,7 @@ 9 | value: !!; `---- - x Delim { value: '!' } + x Delim(DelimToken { value: '!' }) ,-[$DIR/tests/recovery/declaration/bad-value/input.css:7:1] 7 | --foo: ]; 8 | --foo: !; @@ -567,7 +567,7 @@ 10 | value: ! !important; `---- - x Delim { value: '!' } + x Delim(DelimToken { value: '!' }) ,-[$DIR/tests/recovery/declaration/bad-value/input.css:8:1] 8 | --foo: !; 9 | value: !!; @@ -583,7 +583,7 @@ 10 | value: ! !important; `---- - x Delim { value: '!' } + x Delim(DelimToken { value: '!' }) ,-[$DIR/tests/recovery/declaration/bad-value/input.css:8:1] 8 | --foo: !; 9 | value: !!; @@ -639,7 +639,7 @@ 11 | value: ! !important unknown; `---- - x Delim { value: '!' } + x Delim(DelimToken { value: '!' }) ,-[$DIR/tests/recovery/declaration/bad-value/input.css:9:1] 9 | value: !!; 10 | value: ! !important; @@ -655,7 +655,7 @@ 11 | value: ! !important unknown; `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/declaration/bad-value/input.css:9:1] 9 | value: !!; 10 | value: ! !important; @@ -727,7 +727,7 @@ 12 | value: ! unknown; `---- - x Delim { value: '!' } + x Delim(DelimToken { value: '!' }) ,-[$DIR/tests/recovery/declaration/bad-value/input.css:10:1] 10 | value: ! !important; 11 | value: ! !important unknown; @@ -743,7 +743,7 @@ 12 | value: ! unknown; `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/declaration/bad-value/input.css:10:1] 10 | value: ! !important; 11 | value: ! !important unknown; @@ -759,7 +759,7 @@ 12 | value: ! unknown; `---- - x Delim { value: '!' } + x Delim(DelimToken { value: '!' }) ,-[$DIR/tests/recovery/declaration/bad-value/input.css:10:1] 10 | value: ! !important; 11 | value: ! !important unknown; @@ -775,7 +775,7 @@ 12 | value: ! unknown; `---- - x Ident { value: Atom('important' type=static), raw: "important" } + x Ident(IdentToken { value: Atom('important' type=static), raw: "important" }) ,-[$DIR/tests/recovery/declaration/bad-value/input.css:10:1] 10 | value: ! !important; 11 | value: ! !important unknown; @@ -791,7 +791,7 @@ 12 | value: ! unknown; `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/declaration/bad-value/input.css:10:1] 10 | value: ! !important; 11 | value: ! !important unknown; @@ -807,7 +807,7 @@ 12 | value: ! unknown; `---- - x Ident { value: Atom('unknown' type=static), raw: "unknown" } + x Ident(IdentToken { value: Atom('unknown' type=static), raw: "unknown" }) ,-[$DIR/tests/recovery/declaration/bad-value/input.css:10:1] 10 | value: ! !important; 11 | value: ! !important unknown; @@ -863,7 +863,7 @@ 13 | value: ! ! !; `---- - x Delim { value: '!' } + x Delim(DelimToken { value: '!' }) ,-[$DIR/tests/recovery/declaration/bad-value/input.css:11:1] 11 | value: ! !important unknown; 12 | value: ! unknown; @@ -879,7 +879,7 @@ 13 | value: ! ! !; `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/declaration/bad-value/input.css:11:1] 11 | value: ! !important unknown; 12 | value: ! unknown; @@ -895,7 +895,7 @@ 13 | value: ! ! !; `---- - x Ident { value: Atom('unknown' type=static), raw: "unknown" } + x Ident(IdentToken { value: Atom('unknown' type=static), raw: "unknown" }) ,-[$DIR/tests/recovery/declaration/bad-value/input.css:11:1] 11 | value: ! !important unknown; 12 | value: ! unknown; @@ -951,7 +951,7 @@ 14 | } `---- - x Delim { value: '!' } + x Delim(DelimToken { value: '!' }) ,-[$DIR/tests/recovery/declaration/bad-value/input.css:12:1] 12 | value: ! unknown; 13 | value: ! ! !; @@ -967,7 +967,7 @@ 14 | } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/declaration/bad-value/input.css:12:1] 12 | value: ! unknown; 13 | value: ! ! !; @@ -983,7 +983,7 @@ 14 | } `---- - x Delim { value: '!' } + x Delim(DelimToken { value: '!' }) ,-[$DIR/tests/recovery/declaration/bad-value/input.css:12:1] 12 | value: ! unknown; 13 | value: ! ! !; @@ -999,7 +999,7 @@ 14 | } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/declaration/bad-value/input.css:12:1] 12 | value: ! unknown; 13 | value: ! ! !; @@ -1015,7 +1015,7 @@ 14 | } `---- - x Delim { value: '!' } + x Delim(DelimToken { value: '!' }) ,-[$DIR/tests/recovery/declaration/bad-value/input.css:12:1] 12 | value: ! unknown; 13 | value: ! ! !; diff --git a/crates/swc_css_parser/tests/recovery/declaration/basic/span.swc-stderr b/crates/swc_css_parser/tests/recovery/declaration/basic/span.swc-stderr index 73f9651b93ac..59eecb104e32 100644 --- a/crates/swc_css_parser/tests/recovery/declaration/basic/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/declaration/basic/span.swc-stderr @@ -317,7 +317,7 @@ 8 | color: red; `---- - x Delim { value: '!' } + x Delim(DelimToken { value: '!' }) ,-[$DIR/tests/recovery/declaration/basic/input.css:6:1] 6 | .class { 7 | prop: !!; @@ -333,7 +333,7 @@ 8 | color: red; `---- - x Delim { value: '!' } + x Delim(DelimToken { value: '!' }) ,-[$DIR/tests/recovery/declaration/basic/input.css:6:1] 6 | .class { 7 | prop: !!; @@ -512,7 +512,7 @@ 13 | color: red; `---- - x Ident { value: Atom('test' type=inline), raw: "test" } + x Ident(IdentToken { value: Atom('test' type=inline), raw: "test" }) ,-[$DIR/tests/recovery/declaration/basic/input.css:11:1] 11 | a { 12 | test; diff --git a/crates/swc_css_parser/tests/recovery/declaration/important-1/span.swc-stderr b/crates/swc_css_parser/tests/recovery/declaration/important-1/span.swc-stderr index 5ec7ae64149b..298b1474cffd 100644 --- a/crates/swc_css_parser/tests/recovery/declaration/important-1/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/declaration/important-1/span.swc-stderr @@ -131,7 +131,7 @@ 3 | } `---- - x Ident { value: Atom('red' type=inline), raw: "red" } + x Ident(IdentToken { value: Atom('red' type=inline), raw: "red" }) ,-[$DIR/tests/recovery/declaration/important-1/input.css:1:1] 1 | a { 2 | color: red !importan; @@ -147,7 +147,7 @@ 3 | } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/declaration/important-1/input.css:1:1] 1 | a { 2 | color: red !importan; @@ -163,7 +163,7 @@ 3 | } `---- - x Delim { value: '!' } + x Delim(DelimToken { value: '!' }) ,-[$DIR/tests/recovery/declaration/important-1/input.css:1:1] 1 | a { 2 | color: red !importan; @@ -179,7 +179,7 @@ 3 | } `---- - x Ident { value: Atom('importan' type=dynamic), raw: "importan" } + x Ident(IdentToken { value: Atom('importan' type=dynamic), raw: "importan" }) ,-[$DIR/tests/recovery/declaration/important-1/input.css:1:1] 1 | a { 2 | color: red !importan; diff --git a/crates/swc_css_parser/tests/recovery/declaration/important/span.swc-stderr b/crates/swc_css_parser/tests/recovery/declaration/important/span.swc-stderr index 1ce40ab94d45..6ae782c37a3b 100644 --- a/crates/swc_css_parser/tests/recovery/declaration/important/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/declaration/important/span.swc-stderr @@ -144,7 +144,7 @@ 3 | } `---- - x Ident { value: Atom('white' type=inline), raw: "white" } + x Ident(IdentToken { value: Atom('white' type=inline), raw: "white" }) ,-[$DIR/tests/recovery/declaration/important/input.css:1:1] 1 | .a { 2 | color: white !!important; @@ -160,7 +160,7 @@ 3 | } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/declaration/important/input.css:1:1] 1 | .a { 2 | color: white !!important; @@ -176,7 +176,7 @@ 3 | } `---- - x Delim { value: '!' } + x Delim(DelimToken { value: '!' }) ,-[$DIR/tests/recovery/declaration/important/input.css:1:1] 1 | .a { 2 | color: white !!important; @@ -328,7 +328,7 @@ 7 | } `---- - x Ident { value: Atom('red' type=inline), raw: "red" } + x Ident(IdentToken { value: Atom('red' type=inline), raw: "red" }) ,-[$DIR/tests/recovery/declaration/important/input.css:5:1] 5 | .class { 6 | color: red red red !important !important; @@ -344,7 +344,7 @@ 7 | } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/declaration/important/input.css:5:1] 5 | .class { 6 | color: red red red !important !important; @@ -360,7 +360,7 @@ 7 | } `---- - x Ident { value: Atom('red' type=inline), raw: "red" } + x Ident(IdentToken { value: Atom('red' type=inline), raw: "red" }) ,-[$DIR/tests/recovery/declaration/important/input.css:5:1] 5 | .class { 6 | color: red red red !important !important; @@ -376,7 +376,7 @@ 7 | } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/declaration/important/input.css:5:1] 5 | .class { 6 | color: red red red !important !important; @@ -392,7 +392,7 @@ 7 | } `---- - x Ident { value: Atom('red' type=inline), raw: "red" } + x Ident(IdentToken { value: Atom('red' type=inline), raw: "red" }) ,-[$DIR/tests/recovery/declaration/important/input.css:5:1] 5 | .class { 6 | color: red red red !important !important; @@ -408,7 +408,7 @@ 7 | } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/declaration/important/input.css:5:1] 5 | .class { 6 | color: red red red !important !important; @@ -424,7 +424,7 @@ 7 | } `---- - x Delim { value: '!' } + x Delim(DelimToken { value: '!' }) ,-[$DIR/tests/recovery/declaration/important/input.css:5:1] 5 | .class { 6 | color: red red red !important !important; @@ -440,7 +440,7 @@ 7 | } `---- - x Ident { value: Atom('important' type=static), raw: "important" } + x Ident(IdentToken { value: Atom('important' type=static), raw: "important" }) ,-[$DIR/tests/recovery/declaration/important/input.css:5:1] 5 | .class { 6 | color: red red red !important !important; @@ -592,7 +592,7 @@ 11 | } `---- - x Ident { value: Atom('red' type=inline), raw: "red" } + x Ident(IdentToken { value: Atom('red' type=inline), raw: "red" }) ,-[$DIR/tests/recovery/declaration/important/input.css:9:1] 9 | .class { 10 | color: red red red !important!important ; @@ -608,7 +608,7 @@ 11 | } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/declaration/important/input.css:9:1] 9 | .class { 10 | color: red red red !important!important ; @@ -624,7 +624,7 @@ 11 | } `---- - x Ident { value: Atom('red' type=inline), raw: "red" } + x Ident(IdentToken { value: Atom('red' type=inline), raw: "red" }) ,-[$DIR/tests/recovery/declaration/important/input.css:9:1] 9 | .class { 10 | color: red red red !important!important ; @@ -640,7 +640,7 @@ 11 | } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/declaration/important/input.css:9:1] 9 | .class { 10 | color: red red red !important!important ; @@ -656,7 +656,7 @@ 11 | } `---- - x Ident { value: Atom('red' type=inline), raw: "red" } + x Ident(IdentToken { value: Atom('red' type=inline), raw: "red" }) ,-[$DIR/tests/recovery/declaration/important/input.css:9:1] 9 | .class { 10 | color: red red red !important!important ; @@ -672,7 +672,7 @@ 11 | } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/declaration/important/input.css:9:1] 9 | .class { 10 | color: red red red !important!important ; @@ -688,7 +688,7 @@ 11 | } `---- - x Delim { value: '!' } + x Delim(DelimToken { value: '!' }) ,-[$DIR/tests/recovery/declaration/important/input.css:9:1] 9 | .class { 10 | color: red red red !important!important ; @@ -704,7 +704,7 @@ 11 | } `---- - x Ident { value: Atom('important' type=static), raw: "important" } + x Ident(IdentToken { value: Atom('important' type=static), raw: "important" }) ,-[$DIR/tests/recovery/declaration/important/input.css:9:1] 9 | .class { 10 | color: red red red !important!important ; @@ -856,7 +856,7 @@ 15 | } `---- - x Ident { value: Atom('red' type=inline), raw: "red" } + x Ident(IdentToken { value: Atom('red' type=inline), raw: "red" }) ,-[$DIR/tests/recovery/declaration/important/input.css:13:1] 13 | .class { 14 | color: red red red /* test*/ !important /*test*/ !important /*test*/ ; @@ -872,7 +872,7 @@ 15 | } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/declaration/important/input.css:13:1] 13 | .class { 14 | color: red red red /* test*/ !important /*test*/ !important /*test*/ ; @@ -888,7 +888,7 @@ 15 | } `---- - x Ident { value: Atom('red' type=inline), raw: "red" } + x Ident(IdentToken { value: Atom('red' type=inline), raw: "red" }) ,-[$DIR/tests/recovery/declaration/important/input.css:13:1] 13 | .class { 14 | color: red red red /* test*/ !important /*test*/ !important /*test*/ ; @@ -904,7 +904,7 @@ 15 | } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/declaration/important/input.css:13:1] 13 | .class { 14 | color: red red red /* test*/ !important /*test*/ !important /*test*/ ; @@ -920,7 +920,7 @@ 15 | } `---- - x Ident { value: Atom('red' type=inline), raw: "red" } + x Ident(IdentToken { value: Atom('red' type=inline), raw: "red" }) ,-[$DIR/tests/recovery/declaration/important/input.css:13:1] 13 | .class { 14 | color: red red red /* test*/ !important /*test*/ !important /*test*/ ; @@ -936,7 +936,7 @@ 15 | } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/declaration/important/input.css:13:1] 13 | .class { 14 | color: red red red /* test*/ !important /*test*/ !important /*test*/ ; @@ -952,7 +952,7 @@ 15 | } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/declaration/important/input.css:13:1] 13 | .class { 14 | color: red red red /* test*/ !important /*test*/ !important /*test*/ ; @@ -968,7 +968,7 @@ 15 | } `---- - x Delim { value: '!' } + x Delim(DelimToken { value: '!' }) ,-[$DIR/tests/recovery/declaration/important/input.css:13:1] 13 | .class { 14 | color: red red red /* test*/ !important /*test*/ !important /*test*/ ; @@ -984,7 +984,7 @@ 15 | } `---- - x Ident { value: Atom('important' type=static), raw: "important" } + x Ident(IdentToken { value: Atom('important' type=static), raw: "important" }) ,-[$DIR/tests/recovery/declaration/important/input.css:13:1] 13 | .class { 14 | color: red red red /* test*/ !important /*test*/ !important /*test*/ ; @@ -1136,7 +1136,7 @@ 19 | } `---- - x Ident { value: Atom('red' type=inline), raw: "red" } + x Ident(IdentToken { value: Atom('red' type=inline), raw: "red" }) ,-[$DIR/tests/recovery/declaration/important/input.css:17:1] 17 | .class { 18 | color: red red red !important !important!important; @@ -1152,7 +1152,7 @@ 19 | } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/declaration/important/input.css:17:1] 17 | .class { 18 | color: red red red !important !important!important; @@ -1168,7 +1168,7 @@ 19 | } `---- - x Ident { value: Atom('red' type=inline), raw: "red" } + x Ident(IdentToken { value: Atom('red' type=inline), raw: "red" }) ,-[$DIR/tests/recovery/declaration/important/input.css:17:1] 17 | .class { 18 | color: red red red !important !important!important; @@ -1184,7 +1184,7 @@ 19 | } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/declaration/important/input.css:17:1] 17 | .class { 18 | color: red red red !important !important!important; @@ -1200,7 +1200,7 @@ 19 | } `---- - x Ident { value: Atom('red' type=inline), raw: "red" } + x Ident(IdentToken { value: Atom('red' type=inline), raw: "red" }) ,-[$DIR/tests/recovery/declaration/important/input.css:17:1] 17 | .class { 18 | color: red red red !important !important!important; @@ -1216,7 +1216,7 @@ 19 | } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/declaration/important/input.css:17:1] 17 | .class { 18 | color: red red red !important !important!important; @@ -1232,7 +1232,7 @@ 19 | } `---- - x Delim { value: '!' } + x Delim(DelimToken { value: '!' }) ,-[$DIR/tests/recovery/declaration/important/input.css:17:1] 17 | .class { 18 | color: red red red !important !important!important; @@ -1248,7 +1248,7 @@ 19 | } `---- - x Ident { value: Atom('important' type=static), raw: "important" } + x Ident(IdentToken { value: Atom('important' type=static), raw: "important" }) ,-[$DIR/tests/recovery/declaration/important/input.css:17:1] 17 | .class { 18 | color: red red red !important !important!important; @@ -1264,7 +1264,7 @@ 19 | } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/declaration/important/input.css:17:1] 17 | .class { 18 | color: red red red !important !important!important; @@ -1280,7 +1280,7 @@ 19 | } `---- - x Delim { value: '!' } + x Delim(DelimToken { value: '!' }) ,-[$DIR/tests/recovery/declaration/important/input.css:17:1] 17 | .class { 18 | color: red red red !important !important!important; @@ -1296,7 +1296,7 @@ 19 | } `---- - x Ident { value: Atom('important' type=static), raw: "important" } + x Ident(IdentToken { value: Atom('important' type=static), raw: "important" }) ,-[$DIR/tests/recovery/declaration/important/input.css:17:1] 17 | .class { 18 | color: red red red !important !important!important; @@ -1448,7 +1448,7 @@ 23 | } `---- - x Ident { value: Atom('red' type=inline), raw: "red" } + x Ident(IdentToken { value: Atom('red' type=inline), raw: "red" }) ,-[$DIR/tests/recovery/declaration/important/input.css:21:1] 21 | .class { 22 | color: red red red /* test */ ! /*test */ important /* test */ ! /* test */ important /* test */; @@ -1464,7 +1464,7 @@ 23 | } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/declaration/important/input.css:21:1] 21 | .class { 22 | color: red red red /* test */ ! /*test */ important /* test */ ! /* test */ important /* test */; @@ -1480,7 +1480,7 @@ 23 | } `---- - x Ident { value: Atom('red' type=inline), raw: "red" } + x Ident(IdentToken { value: Atom('red' type=inline), raw: "red" }) ,-[$DIR/tests/recovery/declaration/important/input.css:21:1] 21 | .class { 22 | color: red red red /* test */ ! /*test */ important /* test */ ! /* test */ important /* test */; @@ -1496,7 +1496,7 @@ 23 | } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/declaration/important/input.css:21:1] 21 | .class { 22 | color: red red red /* test */ ! /*test */ important /* test */ ! /* test */ important /* test */; @@ -1512,7 +1512,7 @@ 23 | } `---- - x Ident { value: Atom('red' type=inline), raw: "red" } + x Ident(IdentToken { value: Atom('red' type=inline), raw: "red" }) ,-[$DIR/tests/recovery/declaration/important/input.css:21:1] 21 | .class { 22 | color: red red red /* test */ ! /*test */ important /* test */ ! /* test */ important /* test */; @@ -1528,7 +1528,7 @@ 23 | } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/declaration/important/input.css:21:1] 21 | .class { 22 | color: red red red /* test */ ! /*test */ important /* test */ ! /* test */ important /* test */; @@ -1544,7 +1544,7 @@ 23 | } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/declaration/important/input.css:21:1] 21 | .class { 22 | color: red red red /* test */ ! /*test */ important /* test */ ! /* test */ important /* test */; @@ -1560,7 +1560,7 @@ 23 | } `---- - x Delim { value: '!' } + x Delim(DelimToken { value: '!' }) ,-[$DIR/tests/recovery/declaration/important/input.css:21:1] 21 | .class { 22 | color: red red red /* test */ ! /*test */ important /* test */ ! /* test */ important /* test */; @@ -1576,7 +1576,7 @@ 23 | } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/declaration/important/input.css:21:1] 21 | .class { 22 | color: red red red /* test */ ! /*test */ important /* test */ ! /* test */ important /* test */; @@ -1592,7 +1592,7 @@ 23 | } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/declaration/important/input.css:21:1] 21 | .class { 22 | color: red red red /* test */ ! /*test */ important /* test */ ! /* test */ important /* test */; @@ -1608,7 +1608,7 @@ 23 | } `---- - x Ident { value: Atom('important' type=static), raw: "important" } + x Ident(IdentToken { value: Atom('important' type=static), raw: "important" }) ,-[$DIR/tests/recovery/declaration/important/input.css:21:1] 21 | .class { 22 | color: red red red /* test */ ! /*test */ important /* test */ ! /* test */ important /* test */; diff --git a/crates/swc_css_parser/tests/recovery/declaration/wrong-name-3/span.swc-stderr b/crates/swc_css_parser/tests/recovery/declaration/wrong-name-3/span.swc-stderr index 4c971af23813..2ecf408320e6 100644 --- a/crates/swc_css_parser/tests/recovery/declaration/wrong-name-3/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/declaration/wrong-name-3/span.swc-stderr @@ -131,7 +131,7 @@ 3 | } `---- - x Dimension { value: 20.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("20", "px") } + x Dimension(DimensionToken { value: 20.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("20", "px") }) ,-[$DIR/tests/recovery/declaration/wrong-name-3/input.css:1:1] 1 | a { 2 | func(20px); diff --git a/crates/swc_css_parser/tests/recovery/declaration/wrong-name/span.swc-stderr b/crates/swc_css_parser/tests/recovery/declaration/wrong-name/span.swc-stderr index 7cc2ce7c63d2..05747ce5c88d 100644 --- a/crates/swc_css_parser/tests/recovery/declaration/wrong-name/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/declaration/wrong-name/span.swc-stderr @@ -107,7 +107,7 @@ 3 | } `---- - x Number { value: 20.0, raw: "20", type_flag: Integer } + x Number(NumberToken { value: 20.0, raw: "20", type_flag: Integer }) ,-[$DIR/tests/recovery/declaration/wrong-name/input.css:1:1] 1 | a { 2 | 20: red; @@ -139,7 +139,7 @@ 3 | } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/declaration/wrong-name/input.css:1:1] 1 | a { 2 | 20: red; @@ -155,7 +155,7 @@ 3 | } `---- - x Ident { value: Atom('red' type=inline), raw: "red" } + x Ident(IdentToken { value: Atom('red' type=inline), raw: "red" }) ,-[$DIR/tests/recovery/declaration/wrong-name/input.css:1:1] 1 | a { 2 | 20: red; diff --git a/crates/swc_css_parser/tests/recovery/delim-token/ampersand/span.swc-stderr b/crates/swc_css_parser/tests/recovery/delim-token/ampersand/span.swc-stderr index fb4ac21a02ab..201737098d4f 100644 --- a/crates/swc_css_parser/tests/recovery/delim-token/ampersand/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/delim-token/ampersand/span.swc-stderr @@ -131,7 +131,7 @@ 3 | } `---- - x Delim { value: '&' } + x Delim(DelimToken { value: '&' }) ,-[$DIR/tests/recovery/delim-token/ampersand/input.css:1:1] 1 | a { 2 | prop: &; diff --git a/crates/swc_css_parser/tests/recovery/delim-token/asterisk/span.swc-stderr b/crates/swc_css_parser/tests/recovery/delim-token/asterisk/span.swc-stderr index 618b61893932..fdb02ded2550 100644 --- a/crates/swc_css_parser/tests/recovery/delim-token/asterisk/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/delim-token/asterisk/span.swc-stderr @@ -131,7 +131,7 @@ 3 | } `---- - x Delim { value: '*' } + x Delim(DelimToken { value: '*' }) ,-[$DIR/tests/recovery/delim-token/asterisk/input.css:1:1] 1 | a { 2 | color: *; diff --git a/crates/swc_css_parser/tests/recovery/delim-token/at-sign/span.swc-stderr b/crates/swc_css_parser/tests/recovery/delim-token/at-sign/span.swc-stderr index cc2ebaf35761..53e7e4aed888 100644 --- a/crates/swc_css_parser/tests/recovery/delim-token/at-sign/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/delim-token/at-sign/span.swc-stderr @@ -131,7 +131,7 @@ 3 | } `---- - x Delim { value: '@' } + x Delim(DelimToken { value: '@' }) ,-[$DIR/tests/recovery/delim-token/at-sign/input.css:1:1] 1 | a { 2 | color: @ red; @@ -147,7 +147,7 @@ 3 | } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/delim-token/at-sign/input.css:1:1] 1 | a { 2 | color: @ red; @@ -163,7 +163,7 @@ 3 | } `---- - x Ident { value: Atom('red' type=inline), raw: "red" } + x Ident(IdentToken { value: Atom('red' type=inline), raw: "red" }) ,-[$DIR/tests/recovery/delim-token/at-sign/input.css:1:1] 1 | a { 2 | color: @ red; diff --git a/crates/swc_css_parser/tests/recovery/delim-token/bang/span.swc-stderr b/crates/swc_css_parser/tests/recovery/delim-token/bang/span.swc-stderr index dd87acd69774..ba625523e41c 100644 --- a/crates/swc_css_parser/tests/recovery/delim-token/bang/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/delim-token/bang/span.swc-stderr @@ -131,7 +131,7 @@ 3 | } `---- - x Delim { value: '!' } + x Delim(DelimToken { value: '!' }) ,-[$DIR/tests/recovery/delim-token/bang/input.css:1:1] 1 | a { 2 | color: !!; @@ -147,7 +147,7 @@ 3 | } `---- - x Delim { value: '!' } + x Delim(DelimToken { value: '!' }) ,-[$DIR/tests/recovery/delim-token/bang/input.css:1:1] 1 | a { 2 | color: !!; diff --git a/crates/swc_css_parser/tests/recovery/delim-token/bar/span.swc-stderr b/crates/swc_css_parser/tests/recovery/delim-token/bar/span.swc-stderr index 464a92d69c3e..b3ff5dcc2721 100644 --- a/crates/swc_css_parser/tests/recovery/delim-token/bar/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/delim-token/bar/span.swc-stderr @@ -131,7 +131,7 @@ 3 | } `---- - x Delim { value: '|' } + x Delim(DelimToken { value: '|' }) ,-[$DIR/tests/recovery/delim-token/bar/input.css:1:1] 1 | a { 2 | prop: |; diff --git a/crates/swc_css_parser/tests/recovery/delim-token/caret/span.swc-stderr b/crates/swc_css_parser/tests/recovery/delim-token/caret/span.swc-stderr index fe69f57b614a..8e02a47ca80b 100644 --- a/crates/swc_css_parser/tests/recovery/delim-token/caret/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/delim-token/caret/span.swc-stderr @@ -131,7 +131,7 @@ 3 | } `---- - x Delim { value: '^' } + x Delim(DelimToken { value: '^' }) ,-[$DIR/tests/recovery/delim-token/caret/input.css:1:1] 1 | a { 2 | prop: ^; diff --git a/crates/swc_css_parser/tests/recovery/delim-token/dollar/span.swc-stderr b/crates/swc_css_parser/tests/recovery/delim-token/dollar/span.swc-stderr index 4ee4fd64d7d1..793b460a49bc 100644 --- a/crates/swc_css_parser/tests/recovery/delim-token/dollar/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/delim-token/dollar/span.swc-stderr @@ -131,7 +131,7 @@ 3 | } `---- - x Delim { value: '$' } + x Delim(DelimToken { value: '$' }) ,-[$DIR/tests/recovery/delim-token/dollar/input.css:1:1] 1 | a { 2 | prop: $; diff --git a/crates/swc_css_parser/tests/recovery/delim-token/equals/span.swc-stderr b/crates/swc_css_parser/tests/recovery/delim-token/equals/span.swc-stderr index 5ab8158b2ea6..6834e1df94c7 100644 --- a/crates/swc_css_parser/tests/recovery/delim-token/equals/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/delim-token/equals/span.swc-stderr @@ -131,7 +131,7 @@ 3 | } `---- - x Delim { value: '=' } + x Delim(DelimToken { value: '=' }) ,-[$DIR/tests/recovery/delim-token/equals/input.css:1:1] 1 | a { 2 | prop: =; diff --git a/crates/swc_css_parser/tests/recovery/delim-token/greater-than/span.swc-stderr b/crates/swc_css_parser/tests/recovery/delim-token/greater-than/span.swc-stderr index d70137631af2..da944c8d1a51 100644 --- a/crates/swc_css_parser/tests/recovery/delim-token/greater-than/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/delim-token/greater-than/span.swc-stderr @@ -131,7 +131,7 @@ 3 | } `---- - x Delim { value: '>' } + x Delim(DelimToken { value: '>' }) ,-[$DIR/tests/recovery/delim-token/greater-than/input.css:1:1] 1 | a { 2 | prop: >; diff --git a/crates/swc_css_parser/tests/recovery/delim-token/hash/span.swc-stderr b/crates/swc_css_parser/tests/recovery/delim-token/hash/span.swc-stderr index 42806ac3b77a..9ae82e2b4f31 100644 --- a/crates/swc_css_parser/tests/recovery/delim-token/hash/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/delim-token/hash/span.swc-stderr @@ -131,7 +131,7 @@ 3 | } `---- - x Delim { value: '#' } + x Delim(DelimToken { value: '#' }) ,-[$DIR/tests/recovery/delim-token/hash/input.css:1:1] 1 | a { 2 | color: ##; @@ -147,7 +147,7 @@ 3 | } `---- - x Delim { value: '#' } + x Delim(DelimToken { value: '#' }) ,-[$DIR/tests/recovery/delim-token/hash/input.css:1:1] 1 | a { 2 | color: ##; diff --git a/crates/swc_css_parser/tests/recovery/delim-token/less-than/span.swc-stderr b/crates/swc_css_parser/tests/recovery/delim-token/less-than/span.swc-stderr index 37cdc7d91423..38c3e0fee41c 100644 --- a/crates/swc_css_parser/tests/recovery/delim-token/less-than/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/delim-token/less-than/span.swc-stderr @@ -131,7 +131,7 @@ 3 | } `---- - x Delim { value: '<' } + x Delim(DelimToken { value: '<' }) ,-[$DIR/tests/recovery/delim-token/less-than/input.css:1:1] 1 | a { 2 | color: <; diff --git a/crates/swc_css_parser/tests/recovery/delim-token/minus/span.swc-stderr b/crates/swc_css_parser/tests/recovery/delim-token/minus/span.swc-stderr index 48a4895ff447..0a2659226a61 100644 --- a/crates/swc_css_parser/tests/recovery/delim-token/minus/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/delim-token/minus/span.swc-stderr @@ -139,7 +139,7 @@ 3 | prop1: 1 - 2; `---- - x Delim { value: '-' } + x Delim(DelimToken { value: '-' }) ,-[$DIR/tests/recovery/delim-token/minus/input.css:1:1] 1 | a { 2 | prop: -; @@ -195,7 +195,7 @@ 4 | prop2: func(1 - 2); `---- - x Number { value: 1.0, raw: "1", type_flag: Integer } + x Number(NumberToken { value: 1.0, raw: "1", type_flag: Integer }) ,-[$DIR/tests/recovery/delim-token/minus/input.css:2:1] 2 | prop: -; 3 | prop1: 1 - 2; @@ -211,7 +211,7 @@ 4 | prop2: func(1 - 2); `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/delim-token/minus/input.css:2:1] 2 | prop: -; 3 | prop1: 1 - 2; @@ -227,7 +227,7 @@ 4 | prop2: func(1 - 2); `---- - x Delim { value: '-' } + x Delim(DelimToken { value: '-' }) ,-[$DIR/tests/recovery/delim-token/minus/input.css:2:1] 2 | prop: -; 3 | prop1: 1 - 2; @@ -243,7 +243,7 @@ 4 | prop2: func(1 - 2); `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/delim-token/minus/input.css:2:1] 2 | prop: -; 3 | prop1: 1 - 2; @@ -259,7 +259,7 @@ 4 | prop2: func(1 - 2); `---- - x Number { value: 2.0, raw: "2", type_flag: Integer } + x Number(NumberToken { value: 2.0, raw: "2", type_flag: Integer }) ,-[$DIR/tests/recovery/delim-token/minus/input.css:2:1] 2 | prop: -; 3 | prop1: 1 - 2; @@ -339,7 +339,7 @@ 5 | } `---- - x Number { value: 1.0, raw: "1", type_flag: Integer } + x Number(NumberToken { value: 1.0, raw: "1", type_flag: Integer }) ,-[$DIR/tests/recovery/delim-token/minus/input.css:3:1] 3 | prop1: 1 - 2; 4 | prop2: func(1 - 2); @@ -355,7 +355,7 @@ 5 | } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/delim-token/minus/input.css:3:1] 3 | prop1: 1 - 2; 4 | prop2: func(1 - 2); @@ -371,7 +371,7 @@ 5 | } `---- - x Delim { value: '-' } + x Delim(DelimToken { value: '-' }) ,-[$DIR/tests/recovery/delim-token/minus/input.css:3:1] 3 | prop1: 1 - 2; 4 | prop2: func(1 - 2); @@ -387,7 +387,7 @@ 5 | } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/delim-token/minus/input.css:3:1] 3 | prop1: 1 - 2; 4 | prop2: func(1 - 2); @@ -403,7 +403,7 @@ 5 | } `---- - x Number { value: 2.0, raw: "2", type_flag: Integer } + x Number(NumberToken { value: 2.0, raw: "2", type_flag: Integer }) ,-[$DIR/tests/recovery/delim-token/minus/input.css:3:1] 3 | prop1: 1 - 2; 4 | prop2: func(1 - 2); diff --git a/crates/swc_css_parser/tests/recovery/delim-token/percent/span.swc-stderr b/crates/swc_css_parser/tests/recovery/delim-token/percent/span.swc-stderr index 1a9a3b0a9d5e..463818a88432 100644 --- a/crates/swc_css_parser/tests/recovery/delim-token/percent/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/delim-token/percent/span.swc-stderr @@ -131,7 +131,7 @@ 3 | } `---- - x Delim { value: '%' } + x Delim(DelimToken { value: '%' }) ,-[$DIR/tests/recovery/delim-token/percent/input.css:1:1] 1 | a { 2 | prop: %; diff --git a/crates/swc_css_parser/tests/recovery/delim-token/plus/span.swc-stderr b/crates/swc_css_parser/tests/recovery/delim-token/plus/span.swc-stderr index 5d3cd3c80001..4cfe5066d569 100644 --- a/crates/swc_css_parser/tests/recovery/delim-token/plus/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/delim-token/plus/span.swc-stderr @@ -139,7 +139,7 @@ 3 | prop1: 1 + 2; `---- - x Delim { value: '+' } + x Delim(DelimToken { value: '+' }) ,-[$DIR/tests/recovery/delim-token/plus/input.css:1:1] 1 | a { 2 | prop: +; @@ -195,7 +195,7 @@ 4 | prop2: func(1 + 2); `---- - x Number { value: 1.0, raw: "1", type_flag: Integer } + x Number(NumberToken { value: 1.0, raw: "1", type_flag: Integer }) ,-[$DIR/tests/recovery/delim-token/plus/input.css:2:1] 2 | prop: +; 3 | prop1: 1 + 2; @@ -211,7 +211,7 @@ 4 | prop2: func(1 + 2); `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/delim-token/plus/input.css:2:1] 2 | prop: +; 3 | prop1: 1 + 2; @@ -227,7 +227,7 @@ 4 | prop2: func(1 + 2); `---- - x Delim { value: '+' } + x Delim(DelimToken { value: '+' }) ,-[$DIR/tests/recovery/delim-token/plus/input.css:2:1] 2 | prop: +; 3 | prop1: 1 + 2; @@ -243,7 +243,7 @@ 4 | prop2: func(1 + 2); `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/delim-token/plus/input.css:2:1] 2 | prop: +; 3 | prop1: 1 + 2; @@ -259,7 +259,7 @@ 4 | prop2: func(1 + 2); `---- - x Number { value: 2.0, raw: "2", type_flag: Integer } + x Number(NumberToken { value: 2.0, raw: "2", type_flag: Integer }) ,-[$DIR/tests/recovery/delim-token/plus/input.css:2:1] 2 | prop: +; 3 | prop1: 1 + 2; @@ -339,7 +339,7 @@ 5 | } `---- - x Number { value: 1.0, raw: "1", type_flag: Integer } + x Number(NumberToken { value: 1.0, raw: "1", type_flag: Integer }) ,-[$DIR/tests/recovery/delim-token/plus/input.css:3:1] 3 | prop1: 1 + 2; 4 | prop2: func(1 + 2); @@ -355,7 +355,7 @@ 5 | } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/delim-token/plus/input.css:3:1] 3 | prop1: 1 + 2; 4 | prop2: func(1 + 2); @@ -371,7 +371,7 @@ 5 | } `---- - x Delim { value: '+' } + x Delim(DelimToken { value: '+' }) ,-[$DIR/tests/recovery/delim-token/plus/input.css:3:1] 3 | prop1: 1 + 2; 4 | prop2: func(1 + 2); @@ -387,7 +387,7 @@ 5 | } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/delim-token/plus/input.css:3:1] 3 | prop1: 1 + 2; 4 | prop2: func(1 + 2); @@ -403,7 +403,7 @@ 5 | } `---- - x Number { value: 2.0, raw: "2", type_flag: Integer } + x Number(NumberToken { value: 2.0, raw: "2", type_flag: Integer }) ,-[$DIR/tests/recovery/delim-token/plus/input.css:3:1] 3 | prop1: 1 + 2; 4 | prop2: func(1 + 2); diff --git a/crates/swc_css_parser/tests/recovery/delim-token/question-mark/span.swc-stderr b/crates/swc_css_parser/tests/recovery/delim-token/question-mark/span.swc-stderr index cf81f0eef433..f6affc6a4de7 100644 --- a/crates/swc_css_parser/tests/recovery/delim-token/question-mark/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/delim-token/question-mark/span.swc-stderr @@ -131,7 +131,7 @@ 3 | } `---- - x Delim { value: '?' } + x Delim(DelimToken { value: '?' }) ,-[$DIR/tests/recovery/delim-token/question-mark/input.css:1:1] 1 | a { 2 | color: ?; diff --git a/crates/swc_css_parser/tests/recovery/delim-token/star/span.swc-stderr b/crates/swc_css_parser/tests/recovery/delim-token/star/span.swc-stderr index f5d337688f2d..797953b28eff 100644 --- a/crates/swc_css_parser/tests/recovery/delim-token/star/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/delim-token/star/span.swc-stderr @@ -131,7 +131,7 @@ 3 | } `---- - x Delim { value: '*' } + x Delim(DelimToken { value: '*' }) ,-[$DIR/tests/recovery/delim-token/star/input.css:1:1] 1 | a { 2 | color: *; diff --git a/crates/swc_css_parser/tests/recovery/delim-token/tilde/span.swc-stderr b/crates/swc_css_parser/tests/recovery/delim-token/tilde/span.swc-stderr index 78babfaaf057..bd97968a80a9 100644 --- a/crates/swc_css_parser/tests/recovery/delim-token/tilde/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/delim-token/tilde/span.swc-stderr @@ -131,7 +131,7 @@ 3 | } `---- - x Delim { value: '~' } + x Delim(DelimToken { value: '~' }) ,-[$DIR/tests/recovery/delim-token/tilde/input.css:1:1] 1 | a { 2 | color: ~; diff --git a/crates/swc_css_parser/tests/recovery/escaped/declaration-value/span.swc-stderr b/crates/swc_css_parser/tests/recovery/escaped/declaration-value/span.swc-stderr index 76e8a1d3505b..6e4c12a09cee 100644 --- a/crates/swc_css_parser/tests/recovery/escaped/declaration-value/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/escaped/declaration-value/span.swc-stderr @@ -107,7 +107,7 @@ : ^ `---- - x Ident { value: Atom('x' type=static), raw: "x" } + x Ident(IdentToken { value: Atom('x' type=static), raw: "x" }) ,-[$DIR/tests/recovery/escaped/declaration-value/input.css:1:1] 1 | a { value: x } : ^ @@ -119,7 +119,7 @@ : ^ `---- - x Delim { value: '\u{1}' } + x Delim(DelimToken { value: '\u{1}' }) ,-[$DIR/tests/recovery/escaped/declaration-value/input.css:1:1] 1 | a { value: x } : ^ diff --git a/crates/swc_css_parser/tests/recovery/escaped/id-selector/span.swc-stderr b/crates/swc_css_parser/tests/recovery/escaped/id-selector/span.swc-stderr index 3650478a333f..9b73e9d0a303 100644 --- a/crates/swc_css_parser/tests/recovery/escaped/id-selector/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/escaped/id-selector/span.swc-stderr @@ -23,7 +23,7 @@ : ^^^^^^^^^ `---- - x Hash { is_id: false, value: Atom('0,hash' type=inline), raw: "0\\2chash" } + x Hash(HashToken { is_id: false, value: Atom('0,hash' type=inline), raw: "0\\2chash" }) ,-[$DIR/tests/recovery/escaped/id-selector/input.css:1:1] 1 | #0\2chash {} : ^^^^^^^^^ @@ -35,7 +35,7 @@ : ^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/escaped/id-selector/input.css:1:1] 1 | #0\2chash {} : ^ diff --git a/crates/swc_css_parser/tests/recovery/function/bad-comment-2/span.swc-stderr b/crates/swc_css_parser/tests/recovery/function/bad-comment-2/span.swc-stderr index 3f6c7277c931..b0cab4377c08 100644 --- a/crates/swc_css_parser/tests/recovery/function/bad-comment-2/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/function/bad-comment-2/span.swc-stderr @@ -151,7 +151,7 @@ 6 | } `---- - x BadUrl { raw: ("url", "\n /* test */\n \"test.png\"\n ") } + x BadUrl(BadUrlToken { raw: ("url", "\n /* test */\n \"test.png\"\n ") }) ,-[$DIR/tests/recovery/function/bad-comment-2/input.css:1:1] 1 | a { 2 | ,-> background: url( diff --git a/crates/swc_css_parser/tests/recovery/function/bad-comment/span.swc-stderr b/crates/swc_css_parser/tests/recovery/function/bad-comment/span.swc-stderr index 1fe352ff235d..1534719f82e7 100644 --- a/crates/swc_css_parser/tests/recovery/function/bad-comment/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/function/bad-comment/span.swc-stderr @@ -151,7 +151,7 @@ 6 | } `---- - x BadUrl { raw: ("url", "\n /* test */\n test.png\n ") } + x BadUrl(BadUrlToken { raw: ("url", "\n /* test */\n test.png\n ") }) ,-[$DIR/tests/recovery/function/bad-comment/input.css:1:1] 1 | a { 2 | ,-> background: url( diff --git a/crates/swc_css_parser/tests/recovery/function/base/span.swc-stderr b/crates/swc_css_parser/tests/recovery/function/base/span.swc-stderr index 4c7f850d860c..da1bd477e9b1 100644 --- a/crates/swc_css_parser/tests/recovery/function/base/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/function/base/span.swc-stderr @@ -179,7 +179,7 @@ 3 | prop: func(ident.ident); `---- - x Number { value: 1.0, raw: "1", type_flag: Integer } + x Number(NumberToken { value: 1.0, raw: "1", type_flag: Integer }) ,-[$DIR/tests/recovery/function/base/input.css:1:1] 1 | div { 2 | prop: func(1 + 2); @@ -195,7 +195,7 @@ 3 | prop: func(ident.ident); `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/function/base/input.css:1:1] 1 | div { 2 | prop: func(1 + 2); @@ -211,7 +211,7 @@ 3 | prop: func(ident.ident); `---- - x Delim { value: '+' } + x Delim(DelimToken { value: '+' }) ,-[$DIR/tests/recovery/function/base/input.css:1:1] 1 | div { 2 | prop: func(1 + 2); @@ -227,7 +227,7 @@ 3 | prop: func(ident.ident); `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/function/base/input.css:1:1] 1 | div { 2 | prop: func(1 + 2); @@ -243,7 +243,7 @@ 3 | prop: func(ident.ident); `---- - x Number { value: 2.0, raw: "2", type_flag: Integer } + x Number(NumberToken { value: 2.0, raw: "2", type_flag: Integer }) ,-[$DIR/tests/recovery/function/base/input.css:1:1] 1 | div { 2 | prop: func(1 + 2); @@ -323,7 +323,7 @@ 4 | prop: func3( ident.ident ); `---- - x Ident { value: Atom('ident' type=inline), raw: "ident" } + x Ident(IdentToken { value: Atom('ident' type=inline), raw: "ident" }) ,-[$DIR/tests/recovery/function/base/input.css:2:1] 2 | prop: func(1 + 2); 3 | prop: func(ident.ident); @@ -339,7 +339,7 @@ 4 | prop: func3( ident.ident ); `---- - x Delim { value: '.' } + x Delim(DelimToken { value: '.' }) ,-[$DIR/tests/recovery/function/base/input.css:2:1] 2 | prop: func(1 + 2); 3 | prop: func(ident.ident); @@ -355,7 +355,7 @@ 4 | prop: func3( ident.ident ); `---- - x Ident { value: Atom('ident' type=inline), raw: "ident" } + x Ident(IdentToken { value: Atom('ident' type=inline), raw: "ident" }) ,-[$DIR/tests/recovery/function/base/input.css:2:1] 2 | prop: func(1 + 2); 3 | prop: func(ident.ident); @@ -435,7 +435,7 @@ 5 | prop: func([foo bar]); `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/function/base/input.css:3:1] 3 | prop: func(ident.ident); 4 | prop: func3( ident.ident ); @@ -451,7 +451,7 @@ 5 | prop: func([foo bar]); `---- - x Ident { value: Atom('ident' type=inline), raw: "ident" } + x Ident(IdentToken { value: Atom('ident' type=inline), raw: "ident" }) ,-[$DIR/tests/recovery/function/base/input.css:3:1] 3 | prop: func(ident.ident); 4 | prop: func3( ident.ident ); @@ -467,7 +467,7 @@ 5 | prop: func([foo bar]); `---- - x Delim { value: '.' } + x Delim(DelimToken { value: '.' }) ,-[$DIR/tests/recovery/function/base/input.css:3:1] 3 | prop: func(ident.ident); 4 | prop: func3( ident.ident ); @@ -483,7 +483,7 @@ 5 | prop: func([foo bar]); `---- - x Ident { value: Atom('ident' type=inline), raw: "ident" } + x Ident(IdentToken { value: Atom('ident' type=inline), raw: "ident" }) ,-[$DIR/tests/recovery/function/base/input.css:3:1] 3 | prop: func(ident.ident); 4 | prop: func3( ident.ident ); @@ -499,7 +499,7 @@ 5 | prop: func([foo bar]); `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/function/base/input.css:3:1] 3 | prop: func(ident.ident); 4 | prop: func3( ident.ident ); @@ -859,7 +859,7 @@ 8 | prop: func(1, 2); `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/function/base/input.css:6:1] 6 | prop: func((foo, bar)); 7 | prop: func({ foo: bar }); @@ -875,7 +875,7 @@ 8 | prop: func(1, 2); `---- - x Ident { value: Atom('foo' type=inline), raw: "foo" } + x Ident(IdentToken { value: Atom('foo' type=inline), raw: "foo" }) ,-[$DIR/tests/recovery/function/base/input.css:6:1] 6 | prop: func((foo, bar)); 7 | prop: func({ foo: bar }); @@ -907,7 +907,7 @@ 8 | prop: func(1, 2); `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/function/base/input.css:6:1] 6 | prop: func((foo, bar)); 7 | prop: func({ foo: bar }); @@ -923,7 +923,7 @@ 8 | prop: func(1, 2); `---- - x Ident { value: Atom('bar' type=inline), raw: "bar" } + x Ident(IdentToken { value: Atom('bar' type=inline), raw: "bar" }) ,-[$DIR/tests/recovery/function/base/input.css:6:1] 6 | prop: func((foo, bar)); 7 | prop: func({ foo: bar }); @@ -939,7 +939,7 @@ 8 | prop: func(1, 2); `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/function/base/input.css:6:1] 6 | prop: func((foo, bar)); 7 | prop: func({ foo: bar }); diff --git a/crates/swc_css_parser/tests/recovery/function/calc/space/span.swc-stderr b/crates/swc_css_parser/tests/recovery/function/calc/space/span.swc-stderr index db174fda5032..eecc56b85a0b 100644 --- a/crates/swc_css_parser/tests/recovery/function/calc/space/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/function/calc/space/span.swc-stderr @@ -148,7 +148,7 @@ 3 | } `---- - x Dimension { value: 2.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("2", "px") } + x Dimension(DimensionToken { value: 2.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("2", "px") }) ,-[$DIR/tests/recovery/function/calc/space/input.css:1:1] 1 | .style { 2 | width: calc(2px+1px); @@ -164,7 +164,7 @@ 3 | } `---- - x Dimension { value: 1.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("+1", "px") } + x Dimension(DimensionToken { value: 1.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("+1", "px") }) ,-[$DIR/tests/recovery/function/calc/space/input.css:1:1] 1 | .style { 2 | width: calc(2px+1px); diff --git a/crates/swc_css_parser/tests/recovery/function/nested-unclosed/span.swc-stderr b/crates/swc_css_parser/tests/recovery/function/nested-unclosed/span.swc-stderr index 7fa7e0604fe7..e7c770ce45d3 100644 --- a/crates/swc_css_parser/tests/recovery/function/nested-unclosed/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/function/nested-unclosed/span.swc-stderr @@ -155,7 +155,7 @@ 3 | } `---- - x String { value: Atom('test' type=inline), raw: "\"test\"" } + x String(StringToken { value: Atom('test' type=inline), raw: "\"test\"" }) ,-[$DIR/tests/recovery/function/nested-unclosed/input.css:1:1] 1 | a { 2 | prop: url("test") : @@ -171,7 +171,7 @@ 3 | } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/function/nested-unclosed/input.css:1:1] 1 | a { 2 | prop: url("test") : diff --git a/crates/swc_css_parser/tests/recovery/function/rgb/span.swc-stderr b/crates/swc_css_parser/tests/recovery/function/rgb/span.swc-stderr index 695577c755b0..bcd586accbe6 100644 --- a/crates/swc_css_parser/tests/recovery/function/rgb/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/function/rgb/span.swc-stderr @@ -198,7 +198,7 @@ : ^^^^^^ `---- - x String { value: Atom('test' type=inline), raw: "\"test\"" } + x String(StringToken { value: Atom('test' type=inline), raw: "\"test\"" }) ,-[$DIR/tests/recovery/function/rgb/input.css:1:1] 1 | .div { 2 | color: rgb("test"); @@ -285,7 +285,7 @@ 5 | color: rgb(100, "test", 100); `---- - x String { value: Atom('test' type=inline), raw: "\"test\"" } + x String(StringToken { value: Atom('test' type=inline), raw: "\"test\"" }) ,-[$DIR/tests/recovery/function/rgb/input.css:3:1] 3 | 4 | color: rgb("test", 100, 100); @@ -317,7 +317,7 @@ 5 | color: rgb(100, "test", 100); `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/function/rgb/input.css:3:1] 3 | 4 | color: rgb("test", 100, 100); @@ -333,7 +333,7 @@ 5 | color: rgb(100, "test", 100); `---- - x Number { value: 100.0, raw: "100", type_flag: Integer } + x Number(NumberToken { value: 100.0, raw: "100", type_flag: Integer }) ,-[$DIR/tests/recovery/function/rgb/input.css:3:1] 3 | 4 | color: rgb("test", 100, 100); @@ -365,7 +365,7 @@ 5 | color: rgb(100, "test", 100); `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/function/rgb/input.css:3:1] 3 | 4 | color: rgb("test", 100, 100); @@ -381,7 +381,7 @@ 5 | color: rgb(100, "test", 100); `---- - x Number { value: 100.0, raw: "100", type_flag: Integer } + x Number(NumberToken { value: 100.0, raw: "100", type_flag: Integer }) ,-[$DIR/tests/recovery/function/rgb/input.css:3:1] 3 | 4 | color: rgb("test", 100, 100); @@ -469,7 +469,7 @@ 6 | color: rgb(100, 100, "test"); `---- - x Number { value: 100.0, raw: "100", type_flag: Integer } + x Number(NumberToken { value: 100.0, raw: "100", type_flag: Integer }) ,-[$DIR/tests/recovery/function/rgb/input.css:4:1] 4 | color: rgb("test", 100, 100); 5 | color: rgb(100, "test", 100); @@ -501,7 +501,7 @@ 6 | color: rgb(100, 100, "test"); `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/function/rgb/input.css:4:1] 4 | color: rgb("test", 100, 100); 5 | color: rgb(100, "test", 100); @@ -517,7 +517,7 @@ 6 | color: rgb(100, 100, "test"); `---- - x String { value: Atom('test' type=inline), raw: "\"test\"" } + x String(StringToken { value: Atom('test' type=inline), raw: "\"test\"" }) ,-[$DIR/tests/recovery/function/rgb/input.css:4:1] 4 | color: rgb("test", 100, 100); 5 | color: rgb(100, "test", 100); @@ -549,7 +549,7 @@ 6 | color: rgb(100, 100, "test"); `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/function/rgb/input.css:4:1] 4 | color: rgb("test", 100, 100); 5 | color: rgb(100, "test", 100); @@ -565,7 +565,7 @@ 6 | color: rgb(100, 100, "test"); `---- - x Number { value: 100.0, raw: "100", type_flag: Integer } + x Number(NumberToken { value: 100.0, raw: "100", type_flag: Integer }) ,-[$DIR/tests/recovery/function/rgb/input.css:4:1] 4 | color: rgb("test", 100, 100); 5 | color: rgb(100, "test", 100); @@ -653,7 +653,7 @@ 7 | color: rgb(100, 100, 100, "test"); `---- - x Number { value: 100.0, raw: "100", type_flag: Integer } + x Number(NumberToken { value: 100.0, raw: "100", type_flag: Integer }) ,-[$DIR/tests/recovery/function/rgb/input.css:5:1] 5 | color: rgb(100, "test", 100); 6 | color: rgb(100, 100, "test"); @@ -685,7 +685,7 @@ 7 | color: rgb(100, 100, 100, "test"); `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/function/rgb/input.css:5:1] 5 | color: rgb(100, "test", 100); 6 | color: rgb(100, 100, "test"); @@ -701,7 +701,7 @@ 7 | color: rgb(100, 100, 100, "test"); `---- - x Number { value: 100.0, raw: "100", type_flag: Integer } + x Number(NumberToken { value: 100.0, raw: "100", type_flag: Integer }) ,-[$DIR/tests/recovery/function/rgb/input.css:5:1] 5 | color: rgb(100, "test", 100); 6 | color: rgb(100, 100, "test"); @@ -733,7 +733,7 @@ 7 | color: rgb(100, 100, 100, "test"); `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/function/rgb/input.css:5:1] 5 | color: rgb(100, "test", 100); 6 | color: rgb(100, 100, "test"); @@ -749,7 +749,7 @@ 7 | color: rgb(100, 100, 100, "test"); `---- - x String { value: Atom('test' type=inline), raw: "\"test\"" } + x String(StringToken { value: Atom('test' type=inline), raw: "\"test\"" }) ,-[$DIR/tests/recovery/function/rgb/input.css:5:1] 5 | color: rgb(100, "test", 100); 6 | color: rgb(100, 100, "test"); @@ -827,7 +827,7 @@ : ^^^ `---- - x Number { value: 100.0, raw: "100", type_flag: Integer } + x Number(NumberToken { value: 100.0, raw: "100", type_flag: Integer }) ,-[$DIR/tests/recovery/function/rgb/input.css:6:1] 6 | color: rgb(100, 100, "test"); 7 | color: rgb(100, 100, 100, "test"); @@ -855,7 +855,7 @@ : ^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/function/rgb/input.css:6:1] 6 | color: rgb(100, 100, "test"); 7 | color: rgb(100, 100, 100, "test"); @@ -869,7 +869,7 @@ : ^^^ `---- - x Number { value: 100.0, raw: "100", type_flag: Integer } + x Number(NumberToken { value: 100.0, raw: "100", type_flag: Integer }) ,-[$DIR/tests/recovery/function/rgb/input.css:6:1] 6 | color: rgb(100, 100, "test"); 7 | color: rgb(100, 100, 100, "test"); @@ -897,7 +897,7 @@ : ^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/function/rgb/input.css:6:1] 6 | color: rgb(100, 100, "test"); 7 | color: rgb(100, 100, 100, "test"); @@ -911,7 +911,7 @@ : ^^^ `---- - x Number { value: 100.0, raw: "100", type_flag: Integer } + x Number(NumberToken { value: 100.0, raw: "100", type_flag: Integer }) ,-[$DIR/tests/recovery/function/rgb/input.css:6:1] 6 | color: rgb(100, 100, "test"); 7 | color: rgb(100, 100, 100, "test"); @@ -939,7 +939,7 @@ : ^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/function/rgb/input.css:6:1] 6 | color: rgb(100, 100, "test"); 7 | color: rgb(100, 100, 100, "test"); @@ -953,7 +953,7 @@ : ^^^^^^ `---- - x String { value: Atom('test' type=inline), raw: "\"test\"" } + x String(StringToken { value: Atom('test' type=inline), raw: "\"test\"" }) ,-[$DIR/tests/recovery/function/rgb/input.css:6:1] 6 | color: rgb(100, 100, "test"); 7 | color: rgb(100, 100, 100, "test"); @@ -1040,7 +1040,7 @@ 10 | color: rgb(100 "test" 100); `---- - x String { value: Atom('test' type=inline), raw: "\"test\"" } + x String(StringToken { value: Atom('test' type=inline), raw: "\"test\"" }) ,-[$DIR/tests/recovery/function/rgb/input.css:8:1] 8 | 9 | color: rgb("test" 100 100); @@ -1056,7 +1056,7 @@ 10 | color: rgb(100 "test" 100); `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/function/rgb/input.css:8:1] 8 | 9 | color: rgb("test" 100 100); @@ -1072,7 +1072,7 @@ 10 | color: rgb(100 "test" 100); `---- - x Number { value: 100.0, raw: "100", type_flag: Integer } + x Number(NumberToken { value: 100.0, raw: "100", type_flag: Integer }) ,-[$DIR/tests/recovery/function/rgb/input.css:8:1] 8 | 9 | color: rgb("test" 100 100); @@ -1088,7 +1088,7 @@ 10 | color: rgb(100 "test" 100); `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/function/rgb/input.css:8:1] 8 | 9 | color: rgb("test" 100 100); @@ -1104,7 +1104,7 @@ 10 | color: rgb(100 "test" 100); `---- - x Number { value: 100.0, raw: "100", type_flag: Integer } + x Number(NumberToken { value: 100.0, raw: "100", type_flag: Integer }) ,-[$DIR/tests/recovery/function/rgb/input.css:8:1] 8 | 9 | color: rgb("test" 100 100); @@ -1192,7 +1192,7 @@ 11 | color: rgb(100 100 "test"); `---- - x Number { value: 100.0, raw: "100", type_flag: Integer } + x Number(NumberToken { value: 100.0, raw: "100", type_flag: Integer }) ,-[$DIR/tests/recovery/function/rgb/input.css:9:1] 9 | color: rgb("test" 100 100); 10 | color: rgb(100 "test" 100); @@ -1208,7 +1208,7 @@ 11 | color: rgb(100 100 "test"); `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/function/rgb/input.css:9:1] 9 | color: rgb("test" 100 100); 10 | color: rgb(100 "test" 100); @@ -1224,7 +1224,7 @@ 11 | color: rgb(100 100 "test"); `---- - x String { value: Atom('test' type=inline), raw: "\"test\"" } + x String(StringToken { value: Atom('test' type=inline), raw: "\"test\"" }) ,-[$DIR/tests/recovery/function/rgb/input.css:9:1] 9 | color: rgb("test" 100 100); 10 | color: rgb(100 "test" 100); @@ -1240,7 +1240,7 @@ 11 | color: rgb(100 100 "test"); `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/function/rgb/input.css:9:1] 9 | color: rgb("test" 100 100); 10 | color: rgb(100 "test" 100); @@ -1256,7 +1256,7 @@ 11 | color: rgb(100 100 "test"); `---- - x Number { value: 100.0, raw: "100", type_flag: Integer } + x Number(NumberToken { value: 100.0, raw: "100", type_flag: Integer }) ,-[$DIR/tests/recovery/function/rgb/input.css:9:1] 9 | color: rgb("test" 100 100); 10 | color: rgb(100 "test" 100); @@ -1344,7 +1344,7 @@ 12 | color: rgb(100 100 100 / "test"); `---- - x Number { value: 100.0, raw: "100", type_flag: Integer } + x Number(NumberToken { value: 100.0, raw: "100", type_flag: Integer }) ,-[$DIR/tests/recovery/function/rgb/input.css:10:1] 10 | color: rgb(100 "test" 100); 11 | color: rgb(100 100 "test"); @@ -1360,7 +1360,7 @@ 12 | color: rgb(100 100 100 / "test"); `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/function/rgb/input.css:10:1] 10 | color: rgb(100 "test" 100); 11 | color: rgb(100 100 "test"); @@ -1376,7 +1376,7 @@ 12 | color: rgb(100 100 100 / "test"); `---- - x Number { value: 100.0, raw: "100", type_flag: Integer } + x Number(NumberToken { value: 100.0, raw: "100", type_flag: Integer }) ,-[$DIR/tests/recovery/function/rgb/input.css:10:1] 10 | color: rgb(100 "test" 100); 11 | color: rgb(100 100 "test"); @@ -1392,7 +1392,7 @@ 12 | color: rgb(100 100 100 / "test"); `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/function/rgb/input.css:10:1] 10 | color: rgb(100 "test" 100); 11 | color: rgb(100 100 "test"); @@ -1408,7 +1408,7 @@ 12 | color: rgb(100 100 100 / "test"); `---- - x String { value: Atom('test' type=inline), raw: "\"test\"" } + x String(StringToken { value: Atom('test' type=inline), raw: "\"test\"" }) ,-[$DIR/tests/recovery/function/rgb/input.css:10:1] 10 | color: rgb(100 "test" 100); 11 | color: rgb(100 100 "test"); @@ -1486,7 +1486,7 @@ : ^^^ `---- - x Number { value: 100.0, raw: "100", type_flag: Integer } + x Number(NumberToken { value: 100.0, raw: "100", type_flag: Integer }) ,-[$DIR/tests/recovery/function/rgb/input.css:11:1] 11 | color: rgb(100 100 "test"); 12 | color: rgb(100 100 100 / "test"); @@ -1500,7 +1500,7 @@ : ^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/function/rgb/input.css:11:1] 11 | color: rgb(100 100 "test"); 12 | color: rgb(100 100 100 / "test"); @@ -1514,7 +1514,7 @@ : ^^^ `---- - x Number { value: 100.0, raw: "100", type_flag: Integer } + x Number(NumberToken { value: 100.0, raw: "100", type_flag: Integer }) ,-[$DIR/tests/recovery/function/rgb/input.css:11:1] 11 | color: rgb(100 100 "test"); 12 | color: rgb(100 100 100 / "test"); @@ -1528,7 +1528,7 @@ : ^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/function/rgb/input.css:11:1] 11 | color: rgb(100 100 "test"); 12 | color: rgb(100 100 100 / "test"); @@ -1542,7 +1542,7 @@ : ^^^ `---- - x Number { value: 100.0, raw: "100", type_flag: Integer } + x Number(NumberToken { value: 100.0, raw: "100", type_flag: Integer }) ,-[$DIR/tests/recovery/function/rgb/input.css:11:1] 11 | color: rgb(100 100 "test"); 12 | color: rgb(100 100 100 / "test"); @@ -1556,7 +1556,7 @@ : ^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/function/rgb/input.css:11:1] 11 | color: rgb(100 100 "test"); 12 | color: rgb(100 100 100 / "test"); @@ -1570,7 +1570,7 @@ : ^ `---- - x Delim { value: '/' } + x Delim(DelimToken { value: '/' }) ,-[$DIR/tests/recovery/function/rgb/input.css:11:1] 11 | color: rgb(100 100 "test"); 12 | color: rgb(100 100 100 / "test"); @@ -1584,7 +1584,7 @@ : ^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/function/rgb/input.css:11:1] 11 | color: rgb(100 100 "test"); 12 | color: rgb(100 100 100 / "test"); @@ -1598,7 +1598,7 @@ : ^^^^^^ `---- - x String { value: Atom('test' type=inline), raw: "\"test\"" } + x String(StringToken { value: Atom('test' type=inline), raw: "\"test\"" }) ,-[$DIR/tests/recovery/function/rgb/input.css:11:1] 11 | color: rgb(100 100 "test"); 12 | color: rgb(100 100 100 / "test"); diff --git a/crates/swc_css_parser/tests/recovery/function/unclosed-2/span.swc-stderr b/crates/swc_css_parser/tests/recovery/function/unclosed-2/span.swc-stderr index 20312a25ce32..2136c3bb44eb 100644 --- a/crates/swc_css_parser/tests/recovery/function/unclosed-2/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/function/unclosed-2/span.swc-stderr @@ -143,7 +143,7 @@ 3 | } `---- - x Number { value: 4.0, raw: "4", type_flag: Integer } + x Number(NumberToken { value: 4.0, raw: "4", type_flag: Integer }) ,-[$DIR/tests/recovery/function/unclosed-2/input.css:1:1] 1 | .style { 2 | grid-template-columns: repeat(4, [col-start] 12px @@ -175,7 +175,7 @@ 3 | } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/function/unclosed-2/input.css:1:1] 1 | .style { 2 | grid-template-columns: repeat(4, [col-start] 12px @@ -215,7 +215,7 @@ 3 | } `---- - x Ident { value: Atom('col-start' type=dynamic), raw: "col-start" } + x Ident(IdentToken { value: Atom('col-start' type=dynamic), raw: "col-start" }) ,-[$DIR/tests/recovery/function/unclosed-2/input.css:1:1] 1 | .style { 2 | grid-template-columns: repeat(4, [col-start] 12px @@ -231,7 +231,7 @@ 3 | } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/function/unclosed-2/input.css:1:1] 1 | .style { 2 | grid-template-columns: repeat(4, [col-start] 12px @@ -247,7 +247,7 @@ 3 | } `---- - x Dimension { value: 12.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("12", "px") } + x Dimension(DimensionToken { value: 12.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("12", "px") }) ,-[$DIR/tests/recovery/function/unclosed-2/input.css:1:1] 1 | .style { 2 | grid-template-columns: repeat(4, [col-start] 12px @@ -263,7 +263,7 @@ 3 | } `---- - x WhiteSpace { value: "\n" } + x WhiteSpace(WhiteSpaceToken { value: "\n" }) ,-[$DIR/tests/recovery/function/unclosed-2/input.css:1:1] 1 | .style { 2 | grid-template-columns: repeat(4, [col-start] 12px @@ -292,7 +292,7 @@ : ^ `---- - x WhiteSpace { value: "\n" } + x WhiteSpace(WhiteSpaceToken { value: "\n" }) ,-[$DIR/tests/recovery/function/unclosed-2/input.css:2:1] 2 | grid-template-columns: repeat(4, [col-start] 12px 3 | } diff --git a/crates/swc_css_parser/tests/recovery/function/unclosed/span.swc-stderr b/crates/swc_css_parser/tests/recovery/function/unclosed/span.swc-stderr index f6cea90ebde1..faeab716dad5 100644 --- a/crates/swc_css_parser/tests/recovery/function/unclosed/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/function/unclosed/span.swc-stderr @@ -143,7 +143,7 @@ 3 | } `---- - x Dimension { value: 500.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("500", "px") } + x Dimension(DimensionToken { value: 500.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("500", "px") }) ,-[$DIR/tests/recovery/function/unclosed/input.css:1:1] 1 | .style { 2 | width: min(500px; @@ -175,7 +175,7 @@ 3 | } `---- - x WhiteSpace { value: "\n" } + x WhiteSpace(WhiteSpaceToken { value: "\n" }) ,-[$DIR/tests/recovery/function/unclosed/input.css:1:1] 1 | .style { 2 | width: min(500px; @@ -204,7 +204,7 @@ : ^ `---- - x WhiteSpace { value: "\n" } + x WhiteSpace(WhiteSpaceToken { value: "\n" }) ,-[$DIR/tests/recovery/function/unclosed/input.css:2:1] 2 | width: min(500px; 3 | } diff --git a/crates/swc_css_parser/tests/recovery/hacks/span.swc-stderr b/crates/swc_css_parser/tests/recovery/hacks/span.swc-stderr index 9eeb8c537862..b4fe3698520a 100644 --- a/crates/swc_css_parser/tests/recovery/hacks/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/hacks/span.swc-stderr @@ -983,7 +983,7 @@ 14 | .selector { [;property: value;]; } `---- - x Ident { value: Atom('property' type=static), raw: "property" } + x Ident(IdentToken { value: Atom('property' type=static), raw: "property" }) ,-[$DIR/tests/recovery/hacks/input.css:12:1] 12 | 13 | .selector { (;property: value;); } @@ -1015,7 +1015,7 @@ 14 | .selector { [;property: value;]; } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/hacks/input.css:12:1] 12 | 13 | .selector { (;property: value;); } @@ -1031,7 +1031,7 @@ 14 | .selector { [;property: value;]; } `---- - x Ident { value: Atom('value' type=inline), raw: "value" } + x Ident(IdentToken { value: Atom('value' type=inline), raw: "value" }) ,-[$DIR/tests/recovery/hacks/input.css:12:1] 12 | 13 | .selector { (;property: value;); } @@ -1197,7 +1197,7 @@ : ^^^^^^^^ `---- - x Ident { value: Atom('property' type=static), raw: "property" } + x Ident(IdentToken { value: Atom('property' type=static), raw: "property" }) ,-[$DIR/tests/recovery/hacks/input.css:13:1] 13 | .selector { (;property: value;); } 14 | .selector { [;property: value;]; } @@ -1225,7 +1225,7 @@ : ^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/hacks/input.css:13:1] 13 | .selector { (;property: value;); } 14 | .selector { [;property: value;]; } @@ -1239,7 +1239,7 @@ : ^^^^^ `---- - x Ident { value: Atom('value' type=inline), raw: "value" } + x Ident(IdentToken { value: Atom('value' type=inline), raw: "value" }) ,-[$DIR/tests/recovery/hacks/input.css:13:1] 13 | .selector { (;property: value;); } 14 | .selector { [;property: value;]; } @@ -1309,7 +1309,7 @@ : ^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/hacks/input.css:15:1] 15 | 16 | @media \\0 screen {} @@ -1323,7 +1323,7 @@ : ^^^ `---- - x Ident { value: Atom('\0' type=inline), raw: "\\\\0" } + x Ident(IdentToken { value: Atom('\0' type=inline), raw: "\\\\0" }) ,-[$DIR/tests/recovery/hacks/input.css:15:1] 15 | 16 | @media \\0 screen {} @@ -1337,7 +1337,7 @@ : ^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/hacks/input.css:15:1] 15 | 16 | @media \\0 screen {} @@ -1351,7 +1351,7 @@ : ^^^^^^ `---- - x Ident { value: Atom('screen' type=inline), raw: "screen" } + x Ident(IdentToken { value: Atom('screen' type=inline), raw: "screen" }) ,-[$DIR/tests/recovery/hacks/input.css:15:1] 15 | 16 | @media \\0 screen {} @@ -1365,7 +1365,7 @@ : ^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/hacks/input.css:15:1] 15 | 16 | @media \\0 screen {} @@ -6017,7 +6017,7 @@ : ^^^^^ `---- - x Ident { value: Atom('hover' type=inline), raw: "hover" } + x Ident(IdentToken { value: Atom('hover' type=inline), raw: "hover" }) ,-[$DIR/tests/recovery/hacks/input.css:63:1] 63 | 64 | _:-moz-tree-row(hover), .selector {} @@ -9455,7 +9455,7 @@ 105 | color: red; `---- - x Delim { value: '!' } + x Delim(DelimToken { value: '!' }) ,-[$DIR/tests/recovery/hacks/input.css:103:1] 103 | .selector { 104 | !property: value; @@ -9471,7 +9471,7 @@ 105 | color: red; `---- - x Ident { value: Atom('property' type=static), raw: "property" } + x Ident(IdentToken { value: Atom('property' type=static), raw: "property" }) ,-[$DIR/tests/recovery/hacks/input.css:103:1] 103 | .selector { 104 | !property: value; @@ -9503,7 +9503,7 @@ 105 | color: red; `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/hacks/input.css:103:1] 103 | .selector { 104 | !property: value; @@ -9519,7 +9519,7 @@ 105 | color: red; `---- - x Ident { value: Atom('value' type=inline), raw: "value" } + x Ident(IdentToken { value: Atom('value' type=inline), raw: "value" }) ,-[$DIR/tests/recovery/hacks/input.css:103:1] 103 | .selector { 104 | !property: value; @@ -9709,7 +9709,7 @@ 109 | color: red; `---- - x Delim { value: '$' } + x Delim(DelimToken { value: '$' }) ,-[$DIR/tests/recovery/hacks/input.css:107:1] 107 | .selector { 108 | $property: value; @@ -9725,7 +9725,7 @@ 109 | color: red; `---- - x Ident { value: Atom('property' type=static), raw: "property" } + x Ident(IdentToken { value: Atom('property' type=static), raw: "property" }) ,-[$DIR/tests/recovery/hacks/input.css:107:1] 107 | .selector { 108 | $property: value; @@ -9757,7 +9757,7 @@ 109 | color: red; `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/hacks/input.css:107:1] 107 | .selector { 108 | $property: value; @@ -9773,7 +9773,7 @@ 109 | color: red; `---- - x Ident { value: Atom('value' type=inline), raw: "value" } + x Ident(IdentToken { value: Atom('value' type=inline), raw: "value" }) ,-[$DIR/tests/recovery/hacks/input.css:107:1] 107 | .selector { 108 | $property: value; @@ -9963,7 +9963,7 @@ 113 | color: red; `---- - x Delim { value: '&' } + x Delim(DelimToken { value: '&' }) ,-[$DIR/tests/recovery/hacks/input.css:111:1] 111 | .selector { 112 | &property: value; @@ -9979,7 +9979,7 @@ 113 | color: red; `---- - x Ident { value: Atom('property' type=static), raw: "property" } + x Ident(IdentToken { value: Atom('property' type=static), raw: "property" }) ,-[$DIR/tests/recovery/hacks/input.css:111:1] 111 | .selector { 112 | &property: value; @@ -10011,7 +10011,7 @@ 113 | color: red; `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/hacks/input.css:111:1] 111 | .selector { 112 | &property: value; @@ -10027,7 +10027,7 @@ 113 | color: red; `---- - x Ident { value: Atom('value' type=inline), raw: "value" } + x Ident(IdentToken { value: Atom('value' type=inline), raw: "value" }) ,-[$DIR/tests/recovery/hacks/input.css:111:1] 111 | .selector { 112 | &property: value; @@ -10217,7 +10217,7 @@ 117 | color: red; `---- - x Delim { value: '*' } + x Delim(DelimToken { value: '*' }) ,-[$DIR/tests/recovery/hacks/input.css:115:1] 115 | .selector { 116 | *property: value; @@ -10233,7 +10233,7 @@ 117 | color: red; `---- - x Ident { value: Atom('property' type=static), raw: "property" } + x Ident(IdentToken { value: Atom('property' type=static), raw: "property" }) ,-[$DIR/tests/recovery/hacks/input.css:115:1] 115 | .selector { 116 | *property: value; @@ -10265,7 +10265,7 @@ 117 | color: red; `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/hacks/input.css:115:1] 115 | .selector { 116 | *property: value; @@ -10281,7 +10281,7 @@ 117 | color: red; `---- - x Ident { value: Atom('value' type=inline), raw: "value" } + x Ident(IdentToken { value: Atom('value' type=inline), raw: "value" }) ,-[$DIR/tests/recovery/hacks/input.css:115:1] 115 | .selector { 116 | *property: value; @@ -10487,7 +10487,7 @@ 121 | color: red; `---- - x Ident { value: Atom('property' type=static), raw: "property" } + x Ident(IdentToken { value: Atom('property' type=static), raw: "property" }) ,-[$DIR/tests/recovery/hacks/input.css:119:1] 119 | .selector { 120 | )property: value; @@ -10519,7 +10519,7 @@ 121 | color: red; `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/hacks/input.css:119:1] 119 | .selector { 120 | )property: value; @@ -10535,7 +10535,7 @@ 121 | color: red; `---- - x Ident { value: Atom('value' type=inline), raw: "value" } + x Ident(IdentToken { value: Atom('value' type=inline), raw: "value" }) ,-[$DIR/tests/recovery/hacks/input.css:119:1] 119 | .selector { 120 | )property: value; @@ -10725,7 +10725,7 @@ 125 | color: red; `---- - x Delim { value: '=' } + x Delim(DelimToken { value: '=' }) ,-[$DIR/tests/recovery/hacks/input.css:123:1] 123 | .selector { 124 | =property: value; @@ -10741,7 +10741,7 @@ 125 | color: red; `---- - x Ident { value: Atom('property' type=static), raw: "property" } + x Ident(IdentToken { value: Atom('property' type=static), raw: "property" }) ,-[$DIR/tests/recovery/hacks/input.css:123:1] 123 | .selector { 124 | =property: value; @@ -10773,7 +10773,7 @@ 125 | color: red; `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/hacks/input.css:123:1] 123 | .selector { 124 | =property: value; @@ -10789,7 +10789,7 @@ 125 | color: red; `---- - x Ident { value: Atom('value' type=inline), raw: "value" } + x Ident(IdentToken { value: Atom('value' type=inline), raw: "value" }) ,-[$DIR/tests/recovery/hacks/input.css:123:1] 123 | .selector { 124 | =property: value; @@ -10979,7 +10979,7 @@ 129 | color: red; `---- - x Delim { value: '%' } + x Delim(DelimToken { value: '%' }) ,-[$DIR/tests/recovery/hacks/input.css:127:1] 127 | .selector { 128 | %property: value; @@ -10995,7 +10995,7 @@ 129 | color: red; `---- - x Ident { value: Atom('property' type=static), raw: "property" } + x Ident(IdentToken { value: Atom('property' type=static), raw: "property" }) ,-[$DIR/tests/recovery/hacks/input.css:127:1] 127 | .selector { 128 | %property: value; @@ -11027,7 +11027,7 @@ 129 | color: red; `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/hacks/input.css:127:1] 127 | .selector { 128 | %property: value; @@ -11043,7 +11043,7 @@ 129 | color: red; `---- - x Ident { value: Atom('value' type=inline), raw: "value" } + x Ident(IdentToken { value: Atom('value' type=inline), raw: "value" }) ,-[$DIR/tests/recovery/hacks/input.css:127:1] 127 | .selector { 128 | %property: value; @@ -11233,7 +11233,7 @@ 133 | color: red; `---- - x Delim { value: '+' } + x Delim(DelimToken { value: '+' }) ,-[$DIR/tests/recovery/hacks/input.css:131:1] 131 | .selector { 132 | +property: value; @@ -11249,7 +11249,7 @@ 133 | color: red; `---- - x Ident { value: Atom('property' type=static), raw: "property" } + x Ident(IdentToken { value: Atom('property' type=static), raw: "property" }) ,-[$DIR/tests/recovery/hacks/input.css:131:1] 131 | .selector { 132 | +property: value; @@ -11281,7 +11281,7 @@ 133 | color: red; `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/hacks/input.css:131:1] 131 | .selector { 132 | +property: value; @@ -11297,7 +11297,7 @@ 133 | color: red; `---- - x Ident { value: Atom('value' type=inline), raw: "value" } + x Ident(IdentToken { value: Atom('value' type=inline), raw: "value" }) ,-[$DIR/tests/recovery/hacks/input.css:131:1] 131 | .selector { 132 | +property: value; @@ -11583,7 +11583,7 @@ 137 | color: red; `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/hacks/input.css:135:1] 135 | .selector { 136 | @property: value; @@ -11599,7 +11599,7 @@ 137 | color: red; `---- - x Ident { value: Atom('value' type=inline), raw: "value" } + x Ident(IdentToken { value: Atom('value' type=inline), raw: "value" }) ,-[$DIR/tests/recovery/hacks/input.css:135:1] 135 | .selector { 136 | @property: value; @@ -11733,7 +11733,7 @@ 141 | color: red; `---- - x Ident { value: Atom('property' type=static), raw: "property" } + x Ident(IdentToken { value: Atom('property' type=static), raw: "property" }) ,-[$DIR/tests/recovery/hacks/input.css:139:1] 139 | .selector { 140 | ,property: value; @@ -11765,7 +11765,7 @@ 141 | color: red; `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/hacks/input.css:139:1] 139 | .selector { 140 | ,property: value; @@ -11781,7 +11781,7 @@ 141 | color: red; `---- - x Ident { value: Atom('value' type=inline), raw: "value" } + x Ident(IdentToken { value: Atom('value' type=inline), raw: "value" }) ,-[$DIR/tests/recovery/hacks/input.css:139:1] 139 | .selector { 140 | ,property: value; @@ -11971,7 +11971,7 @@ 145 | color: red; `---- - x Delim { value: '.' } + x Delim(DelimToken { value: '.' }) ,-[$DIR/tests/recovery/hacks/input.css:143:1] 143 | .selector { 144 | .property: value; @@ -11987,7 +11987,7 @@ 145 | color: red; `---- - x Ident { value: Atom('property' type=static), raw: "property" } + x Ident(IdentToken { value: Atom('property' type=static), raw: "property" }) ,-[$DIR/tests/recovery/hacks/input.css:143:1] 143 | .selector { 144 | .property: value; @@ -12019,7 +12019,7 @@ 145 | color: red; `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/hacks/input.css:143:1] 143 | .selector { 144 | .property: value; @@ -12035,7 +12035,7 @@ 145 | color: red; `---- - x Ident { value: Atom('value' type=inline), raw: "value" } + x Ident(IdentToken { value: Atom('value' type=inline), raw: "value" }) ,-[$DIR/tests/recovery/hacks/input.css:143:1] 143 | .selector { 144 | .property: value; @@ -12225,7 +12225,7 @@ 149 | color: red; `---- - x Delim { value: '/' } + x Delim(DelimToken { value: '/' }) ,-[$DIR/tests/recovery/hacks/input.css:147:1] 147 | .selector { 148 | /property: value; @@ -12241,7 +12241,7 @@ 149 | color: red; `---- - x Ident { value: Atom('property' type=static), raw: "property" } + x Ident(IdentToken { value: Atom('property' type=static), raw: "property" }) ,-[$DIR/tests/recovery/hacks/input.css:147:1] 147 | .selector { 148 | /property: value; @@ -12273,7 +12273,7 @@ 149 | color: red; `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/hacks/input.css:147:1] 147 | .selector { 148 | /property: value; @@ -12289,7 +12289,7 @@ 149 | color: red; `---- - x Ident { value: Atom('value' type=inline), raw: "value" } + x Ident(IdentToken { value: Atom('value' type=inline), raw: "value" }) ,-[$DIR/tests/recovery/hacks/input.css:147:1] 147 | .selector { 148 | /property: value; @@ -12479,7 +12479,7 @@ 153 | color: red; `---- - x Delim { value: '`' } + x Delim(DelimToken { value: '`' }) ,-[$DIR/tests/recovery/hacks/input.css:151:1] 151 | .selector { 152 | `property: value; @@ -12495,7 +12495,7 @@ 153 | color: red; `---- - x Ident { value: Atom('property' type=static), raw: "property" } + x Ident(IdentToken { value: Atom('property' type=static), raw: "property" }) ,-[$DIR/tests/recovery/hacks/input.css:151:1] 151 | .selector { 152 | `property: value; @@ -12527,7 +12527,7 @@ 153 | color: red; `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/hacks/input.css:151:1] 151 | .selector { 152 | `property: value; @@ -12543,7 +12543,7 @@ 153 | color: red; `---- - x Ident { value: Atom('value' type=inline), raw: "value" } + x Ident(IdentToken { value: Atom('value' type=inline), raw: "value" }) ,-[$DIR/tests/recovery/hacks/input.css:151:1] 151 | .selector { 152 | `property: value; @@ -12749,7 +12749,7 @@ 157 | color: red; `---- - x Ident { value: Atom('property' type=static), raw: "property" } + x Ident(IdentToken { value: Atom('property' type=static), raw: "property" }) ,-[$DIR/tests/recovery/hacks/input.css:155:1] 155 | .selector { 156 | ]property: value; @@ -12781,7 +12781,7 @@ 157 | color: red; `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/hacks/input.css:155:1] 155 | .selector { 156 | ]property: value; @@ -12797,7 +12797,7 @@ 157 | color: red; `---- - x Ident { value: Atom('value' type=inline), raw: "value" } + x Ident(IdentToken { value: Atom('value' type=inline), raw: "value" }) ,-[$DIR/tests/recovery/hacks/input.css:155:1] 155 | .selector { 156 | ]property: value; @@ -12987,7 +12987,7 @@ 161 | color: red; `---- - x Hash { is_id: true, value: Atom('property' type=static), raw: "property" } + x Hash(HashToken { is_id: true, value: Atom('property' type=static), raw: "property" }) ,-[$DIR/tests/recovery/hacks/input.css:159:1] 159 | .selector { 160 | #property: value; @@ -13019,7 +13019,7 @@ 161 | color: red; `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/hacks/input.css:159:1] 159 | .selector { 160 | #property: value; @@ -13035,7 +13035,7 @@ 161 | color: red; `---- - x Ident { value: Atom('value' type=inline), raw: "value" } + x Ident(IdentToken { value: Atom('value' type=inline), raw: "value" }) ,-[$DIR/tests/recovery/hacks/input.css:159:1] 159 | .selector { 160 | #property: value; @@ -13225,7 +13225,7 @@ 165 | color: red; `---- - x Delim { value: '~' } + x Delim(DelimToken { value: '~' }) ,-[$DIR/tests/recovery/hacks/input.css:163:1] 163 | .selector { 164 | ~property: value; @@ -13241,7 +13241,7 @@ 165 | color: red; `---- - x Ident { value: Atom('property' type=static), raw: "property" } + x Ident(IdentToken { value: Atom('property' type=static), raw: "property" }) ,-[$DIR/tests/recovery/hacks/input.css:163:1] 163 | .selector { 164 | ~property: value; @@ -13273,7 +13273,7 @@ 165 | color: red; `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/hacks/input.css:163:1] 163 | .selector { 164 | ~property: value; @@ -13289,7 +13289,7 @@ 165 | color: red; `---- - x Ident { value: Atom('value' type=inline), raw: "value" } + x Ident(IdentToken { value: Atom('value' type=inline), raw: "value" }) ,-[$DIR/tests/recovery/hacks/input.css:163:1] 163 | .selector { 164 | ~property: value; @@ -13479,7 +13479,7 @@ 169 | color: red; `---- - x Delim { value: '?' } + x Delim(DelimToken { value: '?' }) ,-[$DIR/tests/recovery/hacks/input.css:167:1] 167 | .selector { 168 | ?property: value; @@ -13495,7 +13495,7 @@ 169 | color: red; `---- - x Ident { value: Atom('property' type=static), raw: "property" } + x Ident(IdentToken { value: Atom('property' type=static), raw: "property" }) ,-[$DIR/tests/recovery/hacks/input.css:167:1] 167 | .selector { 168 | ?property: value; @@ -13527,7 +13527,7 @@ 169 | color: red; `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/hacks/input.css:167:1] 167 | .selector { 168 | ?property: value; @@ -13543,7 +13543,7 @@ 169 | color: red; `---- - x Ident { value: Atom('value' type=inline), raw: "value" } + x Ident(IdentToken { value: Atom('value' type=inline), raw: "value" }) ,-[$DIR/tests/recovery/hacks/input.css:167:1] 167 | .selector { 168 | ?property: value; @@ -13749,7 +13749,7 @@ 173 | color: red; `---- - x Ident { value: Atom('property' type=static), raw: "property" } + x Ident(IdentToken { value: Atom('property' type=static), raw: "property" }) ,-[$DIR/tests/recovery/hacks/input.css:171:1] 171 | .selector { 172 | :property: value; @@ -13781,7 +13781,7 @@ 173 | color: red; `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/hacks/input.css:171:1] 171 | .selector { 172 | :property: value; @@ -13797,7 +13797,7 @@ 173 | color: red; `---- - x Ident { value: Atom('value' type=inline), raw: "value" } + x Ident(IdentToken { value: Atom('value' type=inline), raw: "value" }) ,-[$DIR/tests/recovery/hacks/input.css:171:1] 171 | .selector { 172 | :property: value; @@ -13984,7 +13984,7 @@ 177 | color: red; `---- - x Delim { value: '|' } + x Delim(DelimToken { value: '|' }) ,-[$DIR/tests/recovery/hacks/input.css:175:1] 175 | .selector { 176 | |property: value; @@ -14000,7 +14000,7 @@ 177 | color: red; `---- - x Ident { value: Atom('property' type=static), raw: "property" } + x Ident(IdentToken { value: Atom('property' type=static), raw: "property" }) ,-[$DIR/tests/recovery/hacks/input.css:175:1] 175 | .selector { 176 | |property: value; @@ -14032,7 +14032,7 @@ 177 | color: red; `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/hacks/input.css:175:1] 175 | .selector { 176 | |property: value; @@ -14048,7 +14048,7 @@ 177 | color: red; `---- - x Ident { value: Atom('value' type=inline), raw: "value" } + x Ident(IdentToken { value: Atom('value' type=inline), raw: "value" }) ,-[$DIR/tests/recovery/hacks/input.css:175:1] 175 | .selector { 176 | |property: value; @@ -14240,7 +14240,7 @@ : ^^^^^ `---- - x Ident { value: Atom('value' type=inline), raw: "value" } + x Ident(IdentToken { value: Atom('value' type=inline), raw: "value" }) ,-[$DIR/tests/recovery/hacks/input.css:179:1] 179 | 180 | .selector { property: value !ie; } @@ -14254,7 +14254,7 @@ : ^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/hacks/input.css:179:1] 179 | 180 | .selector { property: value !ie; } @@ -14268,7 +14268,7 @@ : ^ `---- - x Delim { value: '!' } + x Delim(DelimToken { value: '!' }) ,-[$DIR/tests/recovery/hacks/input.css:179:1] 179 | 180 | .selector { property: value !ie; } @@ -14282,7 +14282,7 @@ : ^^ `---- - x Ident { value: Atom('ie' type=inline), raw: "ie" } + x Ident(IdentToken { value: Atom('ie' type=inline), raw: "ie" }) ,-[$DIR/tests/recovery/hacks/input.css:179:1] 179 | 180 | .selector { property: value !ie; } @@ -15826,7 +15826,7 @@ 205 | .selector { [;property: value;]; } `---- - x Ident { value: Atom('property' type=static), raw: "property" } + x Ident(IdentToken { value: Atom('property' type=static), raw: "property" }) ,-[$DIR/tests/recovery/hacks/input.css:203:1] 203 | 204 | .selector { (;property: value;); } @@ -15858,7 +15858,7 @@ 205 | .selector { [;property: value;]; } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/hacks/input.css:203:1] 203 | 204 | .selector { (;property: value;); } @@ -15874,7 +15874,7 @@ 205 | .selector { [;property: value;]; } `---- - x Ident { value: Atom('value' type=inline), raw: "value" } + x Ident(IdentToken { value: Atom('value' type=inline), raw: "value" }) ,-[$DIR/tests/recovery/hacks/input.css:203:1] 203 | 204 | .selector { (;property: value;); } @@ -16040,7 +16040,7 @@ : ^^^^^^^^ `---- - x Ident { value: Atom('property' type=static), raw: "property" } + x Ident(IdentToken { value: Atom('property' type=static), raw: "property" }) ,-[$DIR/tests/recovery/hacks/input.css:204:1] 204 | .selector { (;property: value;); } 205 | .selector { [;property: value;]; } @@ -16068,7 +16068,7 @@ : ^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/hacks/input.css:204:1] 204 | .selector { (;property: value;); } 205 | .selector { [;property: value;]; } @@ -16082,7 +16082,7 @@ : ^^^^^ `---- - x Ident { value: Atom('value' type=inline), raw: "value" } + x Ident(IdentToken { value: Atom('value' type=inline), raw: "value" }) ,-[$DIR/tests/recovery/hacks/input.css:204:1] 204 | .selector { (;property: value;); } 205 | .selector { [;property: value;]; } @@ -17857,7 +17857,7 @@ 226 | .selector { [;property: value;]; } `---- - x Ident { value: Atom('property' type=static), raw: "property" } + x Ident(IdentToken { value: Atom('property' type=static), raw: "property" }) ,-[$DIR/tests/recovery/hacks/input.css:224:1] 224 | 225 | .selector { (;property: value;); } @@ -17889,7 +17889,7 @@ 226 | .selector { [;property: value;]; } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/hacks/input.css:224:1] 224 | 225 | .selector { (;property: value;); } @@ -17905,7 +17905,7 @@ 226 | .selector { [;property: value;]; } `---- - x Ident { value: Atom('value' type=inline), raw: "value" } + x Ident(IdentToken { value: Atom('value' type=inline), raw: "value" }) ,-[$DIR/tests/recovery/hacks/input.css:224:1] 224 | 225 | .selector { (;property: value;); } @@ -18071,7 +18071,7 @@ : ^^^^^^^^ `---- - x Ident { value: Atom('property' type=static), raw: "property" } + x Ident(IdentToken { value: Atom('property' type=static), raw: "property" }) ,-[$DIR/tests/recovery/hacks/input.css:225:1] 225 | .selector { (;property: value;); } 226 | .selector { [;property: value;]; } @@ -18099,7 +18099,7 @@ : ^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/hacks/input.css:225:1] 225 | .selector { (;property: value;); } 226 | .selector { [;property: value;]; } @@ -18113,7 +18113,7 @@ : ^^^^^ `---- - x Ident { value: Atom('value' type=inline), raw: "value" } + x Ident(IdentToken { value: Atom('value' type=inline), raw: "value" }) ,-[$DIR/tests/recovery/hacks/input.css:225:1] 225 | .selector { (;property: value;); } 226 | .selector { [;property: value;]; } @@ -19482,7 +19482,7 @@ : ^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/hacks/input.css:240:1] 240 | 241 | @media \\0 screen {} @@ -19496,7 +19496,7 @@ : ^^^ `---- - x Ident { value: Atom('\0' type=inline), raw: "\\\\0" } + x Ident(IdentToken { value: Atom('\0' type=inline), raw: "\\\\0" }) ,-[$DIR/tests/recovery/hacks/input.css:240:1] 240 | 241 | @media \\0 screen {} @@ -19510,7 +19510,7 @@ : ^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/hacks/input.css:240:1] 240 | 241 | @media \\0 screen {} @@ -19524,7 +19524,7 @@ : ^^^^^^ `---- - x Ident { value: Atom('screen' type=inline), raw: "screen" } + x Ident(IdentToken { value: Atom('screen' type=inline), raw: "screen" }) ,-[$DIR/tests/recovery/hacks/input.css:240:1] 240 | 241 | @media \\0 screen {} @@ -19538,7 +19538,7 @@ : ^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/hacks/input.css:240:1] 240 | 241 | @media \\0 screen {} @@ -19680,7 +19680,7 @@ 245 | _background: white; `---- - x Delim { value: '*' } + x Delim(DelimToken { value: '*' }) ,-[$DIR/tests/recovery/hacks/input.css:243:1] 243 | a { 244 | *color : black; @@ -19696,7 +19696,7 @@ 245 | _background: white; `---- - x Ident { value: Atom('color' type=static), raw: "color" } + x Ident(IdentToken { value: Atom('color' type=static), raw: "color" }) ,-[$DIR/tests/recovery/hacks/input.css:243:1] 243 | a { 244 | *color : black; @@ -19712,7 +19712,7 @@ 245 | _background: white; `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/hacks/input.css:243:1] 243 | a { 244 | *color : black; @@ -19744,7 +19744,7 @@ 245 | _background: white; `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/hacks/input.css:243:1] 243 | a { 244 | *color : black; @@ -19760,7 +19760,7 @@ 245 | _background: white; `---- - x Ident { value: Atom('black' type=inline), raw: "black" } + x Ident(IdentToken { value: Atom('black' type=inline), raw: "black" }) ,-[$DIR/tests/recovery/hacks/input.css:243:1] 243 | a { 244 | *color : black; @@ -19920,7 +19920,7 @@ 248 | } `---- - x Delim { value: '$' } + x Delim(DelimToken { value: '$' }) ,-[$DIR/tests/recovery/hacks/input.css:246:1] 246 | font-size/**/: big; 247 | $(var)-size: 100%; @@ -19960,7 +19960,7 @@ 248 | } `---- - x Ident { value: Atom('var' type=static), raw: "var" } + x Ident(IdentToken { value: Atom('var' type=static), raw: "var" }) ,-[$DIR/tests/recovery/hacks/input.css:246:1] 246 | font-size/**/: big; 247 | $(var)-size: 100%; @@ -19976,7 +19976,7 @@ 248 | } `---- - x Ident { value: Atom('-size' type=inline), raw: "-size" } + x Ident(IdentToken { value: Atom('-size' type=inline), raw: "-size" }) ,-[$DIR/tests/recovery/hacks/input.css:246:1] 246 | font-size/**/: big; 247 | $(var)-size: 100%; @@ -20008,7 +20008,7 @@ 248 | } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/hacks/input.css:246:1] 246 | font-size/**/: big; 247 | $(var)-size: 100%; @@ -20024,7 +20024,7 @@ 248 | } `---- - x Percentage { value: 100.0, raw: "100" } + x Percentage(PercentageToken { value: 100.0, raw: "100" }) ,-[$DIR/tests/recovery/hacks/input.css:246:1] 246 | font-size/**/: big; 247 | $(var)-size: 100%; @@ -20146,7 +20146,7 @@ : ^ `---- - x Delim { value: '*' } + x Delim(DelimToken { value: '*' }) ,-[$DIR/tests/recovery/hacks/input.css:249:1] 249 | 250 | a{*b:c} @@ -20160,7 +20160,7 @@ : ^ `---- - x Ident { value: Atom('b' type=static), raw: "b" } + x Ident(IdentToken { value: Atom('b' type=static), raw: "b" }) ,-[$DIR/tests/recovery/hacks/input.css:249:1] 249 | 250 | a{*b:c} @@ -20188,7 +20188,7 @@ : ^ `---- - x Ident { value: Atom('c' type=inline), raw: "c" } + x Ident(IdentToken { value: Atom('c' type=inline), raw: "c" }) ,-[$DIR/tests/recovery/hacks/input.css:249:1] 249 | 250 | a{*b:c} diff --git a/crates/swc_css_parser/tests/recovery/ie-progid/span.swc-stderr b/crates/swc_css_parser/tests/recovery/ie-progid/span.swc-stderr index ebfb3d7676ab..f9fee3159844 100644 --- a/crates/swc_css_parser/tests/recovery/ie-progid/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/ie-progid/span.swc-stderr @@ -135,7 +135,7 @@ 3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); `---- - x Ident { value: Atom('progid' type=inline), raw: "progid" } + x Ident(IdentToken { value: Atom('progid' type=inline), raw: "progid" }) ,-[$DIR/tests/recovery/ie-progid/input.css:1:1] 1 | a { 2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0); @@ -167,7 +167,7 @@ 3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); `---- - x Ident { value: Atom('DXImageTransform' type=dynamic), raw: "DXImageTransform" } + x Ident(IdentToken { value: Atom('DXImageTransform' type=dynamic), raw: "DXImageTransform" }) ,-[$DIR/tests/recovery/ie-progid/input.css:1:1] 1 | a { 2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0); @@ -183,7 +183,7 @@ 3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); `---- - x Delim { value: '.' } + x Delim(DelimToken { value: '.' }) ,-[$DIR/tests/recovery/ie-progid/input.css:1:1] 1 | a { 2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0); @@ -199,7 +199,7 @@ 3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); `---- - x Ident { value: Atom('Microsoft' type=dynamic), raw: "Microsoft" } + x Ident(IdentToken { value: Atom('Microsoft' type=dynamic), raw: "Microsoft" }) ,-[$DIR/tests/recovery/ie-progid/input.css:1:1] 1 | a { 2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0); @@ -215,7 +215,7 @@ 3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); `---- - x Delim { value: '.' } + x Delim(DelimToken { value: '.' }) ,-[$DIR/tests/recovery/ie-progid/input.css:1:1] 1 | a { 2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0); @@ -255,7 +255,7 @@ 3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); `---- - x Ident { value: Atom('startColorstr' type=dynamic), raw: "startColorstr" } + x Ident(IdentToken { value: Atom('startColorstr' type=dynamic), raw: "startColorstr" }) ,-[$DIR/tests/recovery/ie-progid/input.css:1:1] 1 | a { 2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0); @@ -271,7 +271,7 @@ 3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); `---- - x Delim { value: '=' } + x Delim(DelimToken { value: '=' }) ,-[$DIR/tests/recovery/ie-progid/input.css:1:1] 1 | a { 2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0); @@ -287,7 +287,7 @@ 3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); `---- - x String { value: Atom('#4f4f4f' type=inline), raw: "'#4f4f4f'" } + x String(StringToken { value: Atom('#4f4f4f' type=inline), raw: "'#4f4f4f'" }) ,-[$DIR/tests/recovery/ie-progid/input.css:1:1] 1 | a { 2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0); @@ -319,7 +319,7 @@ 3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); `---- - x Ident { value: Atom('endColorstr' type=dynamic), raw: "endColorstr" } + x Ident(IdentToken { value: Atom('endColorstr' type=dynamic), raw: "endColorstr" }) ,-[$DIR/tests/recovery/ie-progid/input.css:1:1] 1 | a { 2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0); @@ -335,7 +335,7 @@ 3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); `---- - x Delim { value: '=' } + x Delim(DelimToken { value: '=' }) ,-[$DIR/tests/recovery/ie-progid/input.css:1:1] 1 | a { 2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0); @@ -351,7 +351,7 @@ 3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); `---- - x String { value: Atom('#292929' type=inline), raw: "'#292929'" } + x String(StringToken { value: Atom('#292929' type=inline), raw: "'#292929'" }) ,-[$DIR/tests/recovery/ie-progid/input.css:1:1] 1 | a { 2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0); @@ -383,7 +383,7 @@ 3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); `---- - x Ident { value: Atom('GradientType' type=dynamic), raw: "GradientType" } + x Ident(IdentToken { value: Atom('GradientType' type=dynamic), raw: "GradientType" }) ,-[$DIR/tests/recovery/ie-progid/input.css:1:1] 1 | a { 2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0); @@ -399,7 +399,7 @@ 3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); `---- - x Delim { value: '=' } + x Delim(DelimToken { value: '=' }) ,-[$DIR/tests/recovery/ie-progid/input.css:1:1] 1 | a { 2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0); @@ -415,7 +415,7 @@ 3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); `---- - x Number { value: 0.0, raw: "0", type_flag: Integer } + x Number(NumberToken { value: 0.0, raw: "0", type_flag: Integer }) ,-[$DIR/tests/recovery/ie-progid/input.css:1:1] 1 | a { 2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0); @@ -471,7 +471,7 @@ 4 | } `---- - x Ident { value: Atom('progid' type=inline), raw: "progid" } + x Ident(IdentToken { value: Atom('progid' type=inline), raw: "progid" }) ,-[$DIR/tests/recovery/ie-progid/input.css:2:1] 2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0); 3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); @@ -503,7 +503,7 @@ 4 | } `---- - x Ident { value: Atom('DXImageTransform' type=dynamic), raw: "DXImageTransform" } + x Ident(IdentToken { value: Atom('DXImageTransform' type=dynamic), raw: "DXImageTransform" }) ,-[$DIR/tests/recovery/ie-progid/input.css:2:1] 2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0); 3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); @@ -519,7 +519,7 @@ 4 | } `---- - x Delim { value: '.' } + x Delim(DelimToken { value: '.' }) ,-[$DIR/tests/recovery/ie-progid/input.css:2:1] 2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0); 3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); @@ -535,7 +535,7 @@ 4 | } `---- - x Ident { value: Atom('Microsoft' type=dynamic), raw: "Microsoft" } + x Ident(IdentToken { value: Atom('Microsoft' type=dynamic), raw: "Microsoft" }) ,-[$DIR/tests/recovery/ie-progid/input.css:2:1] 2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0); 3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); @@ -551,7 +551,7 @@ 4 | } `---- - x Delim { value: '.' } + x Delim(DelimToken { value: '.' }) ,-[$DIR/tests/recovery/ie-progid/input.css:2:1] 2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0); 3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); @@ -591,7 +591,7 @@ 4 | } `---- - x Ident { value: Atom('pixelradius' type=dynamic), raw: "pixelradius" } + x Ident(IdentToken { value: Atom('pixelradius' type=dynamic), raw: "pixelradius" }) ,-[$DIR/tests/recovery/ie-progid/input.css:2:1] 2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0); 3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); @@ -607,7 +607,7 @@ 4 | } `---- - x Delim { value: '=' } + x Delim(DelimToken { value: '=' }) ,-[$DIR/tests/recovery/ie-progid/input.css:2:1] 2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0); 3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); @@ -623,7 +623,7 @@ 4 | } `---- - x Number { value: 2.0, raw: "2", type_flag: Integer } + x Number(NumberToken { value: 2.0, raw: "2", type_flag: Integer }) ,-[$DIR/tests/recovery/ie-progid/input.css:2:1] 2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0); 3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); @@ -639,7 +639,7 @@ 4 | } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/ie-progid/input.css:2:1] 2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0); 3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); @@ -655,7 +655,7 @@ 4 | } `---- - x Ident { value: Atom('progid' type=inline), raw: "progid" } + x Ident(IdentToken { value: Atom('progid' type=inline), raw: "progid" }) ,-[$DIR/tests/recovery/ie-progid/input.css:2:1] 2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0); 3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); @@ -687,7 +687,7 @@ 4 | } `---- - x Ident { value: Atom('DXImageTransform' type=dynamic), raw: "DXImageTransform" } + x Ident(IdentToken { value: Atom('DXImageTransform' type=dynamic), raw: "DXImageTransform" }) ,-[$DIR/tests/recovery/ie-progid/input.css:2:1] 2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0); 3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); @@ -703,7 +703,7 @@ 4 | } `---- - x Delim { value: '.' } + x Delim(DelimToken { value: '.' }) ,-[$DIR/tests/recovery/ie-progid/input.css:2:1] 2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0); 3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); @@ -719,7 +719,7 @@ 4 | } `---- - x Ident { value: Atom('Microsoft' type=dynamic), raw: "Microsoft" } + x Ident(IdentToken { value: Atom('Microsoft' type=dynamic), raw: "Microsoft" }) ,-[$DIR/tests/recovery/ie-progid/input.css:2:1] 2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0); 3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); @@ -735,7 +735,7 @@ 4 | } `---- - x Delim { value: '.' } + x Delim(DelimToken { value: '.' }) ,-[$DIR/tests/recovery/ie-progid/input.css:2:1] 2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0); 3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); @@ -775,7 +775,7 @@ 4 | } `---- - x Ident { value: Atom('duration' type=dynamic), raw: "duration" } + x Ident(IdentToken { value: Atom('duration' type=dynamic), raw: "duration" }) ,-[$DIR/tests/recovery/ie-progid/input.css:2:1] 2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0); 3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); @@ -791,7 +791,7 @@ 4 | } `---- - x Delim { value: '=' } + x Delim(DelimToken { value: '=' }) ,-[$DIR/tests/recovery/ie-progid/input.css:2:1] 2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0); 3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); @@ -807,7 +807,7 @@ 4 | } `---- - x Number { value: 3.0, raw: "3", type_flag: Integer } + x Number(NumberToken { value: 3.0, raw: "3", type_flag: Integer }) ,-[$DIR/tests/recovery/ie-progid/input.css:2:1] 2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0); 3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); diff --git a/crates/swc_css_parser/tests/recovery/number/span.swc-stderr b/crates/swc_css_parser/tests/recovery/number/span.swc-stderr index 373479969816..a22546689589 100644 --- a/crates/swc_css_parser/tests/recovery/number/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/number/span.swc-stderr @@ -149,7 +149,7 @@ 3 | prop1: 10px `---- - x Dimension { value: 10.1, unit: Atom('px' type=static), type_flag: Number, raw: ("10.10", "px") } + x Dimension(DimensionToken { value: 10.1, unit: Atom('px' type=static), type_flag: Number, raw: ("10.10", "px") }) ,-[$DIR/tests/recovery/number/input.css:1:1] 1 | a { 2 | prop: 10.10px @@ -165,7 +165,7 @@ 4 | prop2: 10 `---- - x WhiteSpace { value: "\n " } + x WhiteSpace(WhiteSpaceToken { value: "\n " }) ,-[$DIR/tests/recovery/number/input.css:1:1] 1 | a { 2 | ,-> prop: 10.10px @@ -181,7 +181,7 @@ 4 | prop2: 10 `---- - x Ident { value: Atom('prop1' type=inline), raw: "prop1" } + x Ident(IdentToken { value: Atom('prop1' type=inline), raw: "prop1" }) ,-[$DIR/tests/recovery/number/input.css:2:1] 2 | prop: 10.10px 3 | prop1: 10px @@ -213,7 +213,7 @@ 4 | prop2: 10 `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/number/input.css:2:1] 2 | prop: 10.10px 3 | prop1: 10px @@ -229,7 +229,7 @@ 4 | prop2: 10 `---- - x Dimension { value: 10.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("10", "px") } + x Dimension(DimensionToken { value: 10.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("10", "px") }) ,-[$DIR/tests/recovery/number/input.css:2:1] 2 | prop: 10.10px 3 | prop1: 10px @@ -245,7 +245,7 @@ 5 | prop3: 10.10 `---- - x WhiteSpace { value: "\n " } + x WhiteSpace(WhiteSpaceToken { value: "\n " }) ,-[$DIR/tests/recovery/number/input.css:2:1] 2 | prop: 10.10px 3 | ,-> prop1: 10px @@ -261,7 +261,7 @@ 5 | prop3: 10.10 `---- - x Ident { value: Atom('prop2' type=inline), raw: "prop2" } + x Ident(IdentToken { value: Atom('prop2' type=inline), raw: "prop2" }) ,-[$DIR/tests/recovery/number/input.css:3:1] 3 | prop1: 10px 4 | prop2: 10 @@ -293,7 +293,7 @@ 5 | prop3: 10.10 `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/number/input.css:3:1] 3 | prop1: 10px 4 | prop2: 10 @@ -309,7 +309,7 @@ 5 | prop3: 10.10 `---- - x Number { value: 10.0, raw: "10", type_flag: Integer } + x Number(NumberToken { value: 10.0, raw: "10", type_flag: Integer }) ,-[$DIR/tests/recovery/number/input.css:3:1] 3 | prop1: 10px 4 | prop2: 10 @@ -325,7 +325,7 @@ 6 | } `---- - x WhiteSpace { value: "\n " } + x WhiteSpace(WhiteSpaceToken { value: "\n " }) ,-[$DIR/tests/recovery/number/input.css:3:1] 3 | prop1: 10px 4 | ,-> prop2: 10 @@ -341,7 +341,7 @@ 6 | } `---- - x Ident { value: Atom('prop3' type=inline), raw: "prop3" } + x Ident(IdentToken { value: Atom('prop3' type=inline), raw: "prop3" }) ,-[$DIR/tests/recovery/number/input.css:4:1] 4 | prop2: 10 5 | prop3: 10.10 @@ -373,7 +373,7 @@ 6 | } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/number/input.css:4:1] 4 | prop2: 10 5 | prop3: 10.10 @@ -389,7 +389,7 @@ 6 | } `---- - x Number { value: 10.1, raw: "10.10", type_flag: Number } + x Number(NumberToken { value: 10.1, raw: "10.10", type_flag: Number }) ,-[$DIR/tests/recovery/number/input.css:4:1] 4 | prop2: 10 5 | prop3: 10.10 diff --git a/crates/swc_css_parser/tests/recovery/qualified-rule/basic/span.swc-stderr b/crates/swc_css_parser/tests/recovery/qualified-rule/basic/span.swc-stderr index 9aea22a90930..adbb33b26535 100644 --- a/crates/swc_css_parser/tests/recovery/qualified-rule/basic/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/qualified-rule/basic/span.swc-stderr @@ -32,7 +32,7 @@ : ^ `---- - x Delim { value: '/' } + x Delim(DelimToken { value: '/' }) ,-[$DIR/tests/recovery/qualified-rule/basic/input.css:1:1] 1 | // test : ^ @@ -44,7 +44,7 @@ : ^ `---- - x Delim { value: '/' } + x Delim(DelimToken { value: '/' }) ,-[$DIR/tests/recovery/qualified-rule/basic/input.css:1:1] 1 | // test : ^ @@ -56,7 +56,7 @@ : ^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/qualified-rule/basic/input.css:1:1] 1 | // test : ^ @@ -68,7 +68,7 @@ : ^^^^ `---- - x Ident { value: Atom('test' type=inline), raw: "test" } + x Ident(IdentToken { value: Atom('test' type=inline), raw: "test" }) ,-[$DIR/tests/recovery/qualified-rule/basic/input.css:1:1] 1 | // test : ^^^^ @@ -82,7 +82,7 @@ 4 | color: red; `---- - x WhiteSpace { value: "\n\n" } + x WhiteSpace(WhiteSpaceToken { value: "\n\n" }) ,-[$DIR/tests/recovery/qualified-rule/basic/input.css:1:1] 1 | ,-> // test 2 | `-> @@ -98,7 +98,7 @@ 4 | color: red; `---- - x Ident { value: Atom('a' type=static), raw: "a" } + x Ident(IdentToken { value: Atom('a' type=static), raw: "a" }) ,-[$DIR/tests/recovery/qualified-rule/basic/input.css:2:1] 2 | 3 | a { @@ -114,7 +114,7 @@ 4 | color: red; `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/qualified-rule/basic/input.css:2:1] 2 | 3 | a { diff --git a/crates/swc_css_parser/tests/recovery/qualified-rule/double-slash-comment/span.swc-stderr b/crates/swc_css_parser/tests/recovery/qualified-rule/double-slash-comment/span.swc-stderr index 004149f4604d..4bbdbe38e6a2 100644 --- a/crates/swc_css_parser/tests/recovery/qualified-rule/double-slash-comment/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/qualified-rule/double-slash-comment/span.swc-stderr @@ -30,7 +30,7 @@ 2 | a { `---- - x Delim { value: '/' } + x Delim(DelimToken { value: '/' }) ,-[$DIR/tests/recovery/qualified-rule/double-slash-comment/input.css:1:1] 1 | // test : ^ @@ -44,7 +44,7 @@ 2 | a { `---- - x Delim { value: '/' } + x Delim(DelimToken { value: '/' }) ,-[$DIR/tests/recovery/qualified-rule/double-slash-comment/input.css:1:1] 1 | // test : ^ @@ -58,7 +58,7 @@ 2 | a { `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/qualified-rule/double-slash-comment/input.css:1:1] 1 | // test : ^ @@ -72,7 +72,7 @@ 2 | a { `---- - x Ident { value: Atom('test' type=inline), raw: "test" } + x Ident(IdentToken { value: Atom('test' type=inline), raw: "test" }) ,-[$DIR/tests/recovery/qualified-rule/double-slash-comment/input.css:1:1] 1 | // test : ^^^^ @@ -87,7 +87,7 @@ 3 | color: red; `---- - x WhiteSpace { value: "\n" } + x WhiteSpace(WhiteSpaceToken { value: "\n" }) ,-[$DIR/tests/recovery/qualified-rule/double-slash-comment/input.css:1:1] 1 | // test : ^ @@ -103,7 +103,7 @@ 3 | color: red; `---- - x Ident { value: Atom('a' type=static), raw: "a" } + x Ident(IdentToken { value: Atom('a' type=static), raw: "a" }) ,-[$DIR/tests/recovery/qualified-rule/double-slash-comment/input.css:1:1] 1 | // test 2 | a { @@ -119,7 +119,7 @@ 3 | color: red; `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/qualified-rule/double-slash-comment/input.css:1:1] 1 | // test 2 | a { diff --git a/crates/swc_css_parser/tests/recovery/rules/at-rule-in-middle/span.swc-stderr b/crates/swc_css_parser/tests/recovery/rules/at-rule-in-middle/span.swc-stderr index e09ac666e817..6624ddf581f9 100644 --- a/crates/swc_css_parser/tests/recovery/rules/at-rule-in-middle/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/rules/at-rule-in-middle/span.swc-stderr @@ -196,7 +196,7 @@ 5 | a { color: blue } `---- - x WhiteSpace { value: "\n\n" } + x WhiteSpace(WhiteSpaceToken { value: "\n\n" }) ,-[$DIR/tests/recovery/rules/at-rule-in-middle/input.css:2:1] 2 | 3 | ,-> @media {}; @@ -211,7 +211,7 @@ : ^ `---- - x Ident { value: Atom('a' type=static), raw: "a" } + x Ident(IdentToken { value: Atom('a' type=static), raw: "a" }) ,-[$DIR/tests/recovery/rules/at-rule-in-middle/input.css:4:1] 4 | 5 | a { color: blue } @@ -225,7 +225,7 @@ : ^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/rules/at-rule-in-middle/input.css:4:1] 4 | 5 | a { color: blue } diff --git a/crates/swc_css_parser/tests/recovery/rules/at-rule-with-semi/span.swc-stderr b/crates/swc_css_parser/tests/recovery/rules/at-rule-with-semi/span.swc-stderr index 4a149471f486..ea9f231c65fe 100644 --- a/crates/swc_css_parser/tests/recovery/rules/at-rule-with-semi/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/rules/at-rule-with-semi/span.swc-stderr @@ -77,7 +77,7 @@ 3 | a { color: red } `---- - x WhiteSpace { value: "\n\n" } + x WhiteSpace(WhiteSpaceToken { value: "\n\n" }) ,-[$DIR/tests/recovery/rules/at-rule-with-semi/input.css:1:1] 1 | ,-> @media {}; 2 | `-> @@ -91,7 +91,7 @@ : ^ `---- - x Ident { value: Atom('a' type=static), raw: "a" } + x Ident(IdentToken { value: Atom('a' type=static), raw: "a" }) ,-[$DIR/tests/recovery/rules/at-rule-with-semi/input.css:2:1] 2 | 3 | a { color: red } @@ -105,7 +105,7 @@ : ^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/rules/at-rule-with-semi/input.css:2:1] 2 | 3 | a { color: red } diff --git a/crates/swc_css_parser/tests/recovery/rules/unclosed-brackets/span.swc-stderr b/crates/swc_css_parser/tests/recovery/rules/unclosed-brackets/span.swc-stderr index 6aae0fa43412..e6cb87762d1e 100644 --- a/crates/swc_css_parser/tests/recovery/rules/unclosed-brackets/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/rules/unclosed-brackets/span.swc-stderr @@ -27,7 +27,7 @@ : ^ `---- - x Delim { value: '.' } + x Delim(DelimToken { value: '.' }) ,-[$DIR/tests/recovery/rules/unclosed-brackets/input.css:1:1] 1 | .class[attr= { : ^ @@ -39,7 +39,7 @@ : ^^^^^ `---- - x Ident { value: Atom('class' type=static), raw: "class" } + x Ident(IdentToken { value: Atom('class' type=static), raw: "class" }) ,-[$DIR/tests/recovery/rules/unclosed-brackets/input.css:1:1] 1 | .class[attr= { : ^^^^^ @@ -79,7 +79,7 @@ : ^^^^ `---- - x Ident { value: Atom('attr' type=inline), raw: "attr" } + x Ident(IdentToken { value: Atom('attr' type=inline), raw: "attr" }) ,-[$DIR/tests/recovery/rules/unclosed-brackets/input.css:1:1] 1 | .class[attr= { : ^^^^ @@ -91,7 +91,7 @@ : ^ `---- - x Delim { value: '=' } + x Delim(DelimToken { value: '=' }) ,-[$DIR/tests/recovery/rules/unclosed-brackets/input.css:1:1] 1 | .class[attr= { : ^ @@ -103,7 +103,7 @@ : ^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/rules/unclosed-brackets/input.css:1:1] 1 | .class[attr= { : ^ @@ -136,7 +136,7 @@ 3 | } `---- - x WhiteSpace { value: "\n\n" } + x WhiteSpace(WhiteSpaceToken { value: "\n\n" }) ,-[$DIR/tests/recovery/rules/unclosed-brackets/input.css:1:1] 1 | ,-> .class[attr= { 2 | `-> @@ -151,7 +151,7 @@ 5 | .class { color: red } `---- - x WhiteSpace { value: "\n\n" } + x WhiteSpace(WhiteSpaceToken { value: "\n\n" }) ,-[$DIR/tests/recovery/rules/unclosed-brackets/input.css:2:1] 2 | 3 | ,-> } @@ -166,7 +166,7 @@ : ^ `---- - x Delim { value: '.' } + x Delim(DelimToken { value: '.' }) ,-[$DIR/tests/recovery/rules/unclosed-brackets/input.css:4:1] 4 | 5 | .class { color: red } @@ -180,7 +180,7 @@ : ^^^^^ `---- - x Ident { value: Atom('class' type=static), raw: "class" } + x Ident(IdentToken { value: Atom('class' type=static), raw: "class" }) ,-[$DIR/tests/recovery/rules/unclosed-brackets/input.css:4:1] 4 | 5 | .class { color: red } @@ -194,7 +194,7 @@ : ^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/rules/unclosed-brackets/input.css:4:1] 4 | 5 | .class { color: red } @@ -229,7 +229,7 @@ : ^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/rules/unclosed-brackets/input.css:4:1] 4 | 5 | .class { color: red } @@ -243,7 +243,7 @@ : ^^^^^ `---- - x Ident { value: Atom('color' type=static), raw: "color" } + x Ident(IdentToken { value: Atom('color' type=static), raw: "color" }) ,-[$DIR/tests/recovery/rules/unclosed-brackets/input.css:4:1] 4 | 5 | .class { color: red } @@ -271,7 +271,7 @@ : ^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/rules/unclosed-brackets/input.css:4:1] 4 | 5 | .class { color: red } @@ -285,7 +285,7 @@ : ^^^ `---- - x Ident { value: Atom('red' type=inline), raw: "red" } + x Ident(IdentToken { value: Atom('red' type=inline), raw: "red" }) ,-[$DIR/tests/recovery/rules/unclosed-brackets/input.css:4:1] 4 | 5 | .class { color: red } @@ -299,7 +299,7 @@ : ^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/rules/unclosed-brackets/input.css:4:1] 4 | 5 | .class { color: red } @@ -314,7 +314,7 @@ 7 | .class { color: blue } `---- - x WhiteSpace { value: "\n\n" } + x WhiteSpace(WhiteSpaceToken { value: "\n\n" }) ,-[$DIR/tests/recovery/rules/unclosed-brackets/input.css:4:1] 4 | 5 | ,-> .class { color: red } @@ -329,7 +329,7 @@ : ^ `---- - x Delim { value: '.' } + x Delim(DelimToken { value: '.' }) ,-[$DIR/tests/recovery/rules/unclosed-brackets/input.css:6:1] 6 | 7 | .class { color: blue } @@ -343,7 +343,7 @@ : ^^^^^ `---- - x Ident { value: Atom('class' type=static), raw: "class" } + x Ident(IdentToken { value: Atom('class' type=static), raw: "class" }) ,-[$DIR/tests/recovery/rules/unclosed-brackets/input.css:6:1] 6 | 7 | .class { color: blue } @@ -357,7 +357,7 @@ : ^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/rules/unclosed-brackets/input.css:6:1] 6 | 7 | .class { color: blue } @@ -392,7 +392,7 @@ : ^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/rules/unclosed-brackets/input.css:6:1] 6 | 7 | .class { color: blue } @@ -406,7 +406,7 @@ : ^^^^^ `---- - x Ident { value: Atom('color' type=static), raw: "color" } + x Ident(IdentToken { value: Atom('color' type=static), raw: "color" }) ,-[$DIR/tests/recovery/rules/unclosed-brackets/input.css:6:1] 6 | 7 | .class { color: blue } @@ -434,7 +434,7 @@ : ^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/rules/unclosed-brackets/input.css:6:1] 6 | 7 | .class { color: blue } @@ -448,7 +448,7 @@ : ^^^^ `---- - x Ident { value: Atom('blue' type=inline), raw: "blue" } + x Ident(IdentToken { value: Atom('blue' type=inline), raw: "blue" }) ,-[$DIR/tests/recovery/rules/unclosed-brackets/input.css:6:1] 6 | 7 | .class { color: blue } @@ -462,7 +462,7 @@ : ^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/rules/unclosed-brackets/input.css:6:1] 6 | 7 | .class { color: blue } diff --git a/crates/swc_css_parser/tests/recovery/rules/unclosed-curly/span.swc-stderr b/crates/swc_css_parser/tests/recovery/rules/unclosed-curly/span.swc-stderr index 621b003cf395..c189b92a77cc 100644 --- a/crates/swc_css_parser/tests/recovery/rules/unclosed-curly/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/rules/unclosed-curly/span.swc-stderr @@ -28,7 +28,7 @@ : ^^^^ `---- - x Ident { value: Atom('test' type=inline), raw: "test" } + x Ident(IdentToken { value: Atom('test' type=inline), raw: "test" }) ,-[$DIR/tests/recovery/rules/unclosed-curly/input.css:1:1] 1 | test}; : ^^^^ @@ -65,7 +65,7 @@ 3 | a { color: red } `---- - x WhiteSpace { value: "\n\n" } + x WhiteSpace(WhiteSpaceToken { value: "\n\n" }) ,-[$DIR/tests/recovery/rules/unclosed-curly/input.css:1:1] 1 | ,-> test}; 2 | `-> @@ -79,7 +79,7 @@ : ^ `---- - x Ident { value: Atom('a' type=static), raw: "a" } + x Ident(IdentToken { value: Atom('a' type=static), raw: "a" }) ,-[$DIR/tests/recovery/rules/unclosed-curly/input.css:2:1] 2 | 3 | a { color: red } @@ -93,7 +93,7 @@ : ^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/rules/unclosed-curly/input.css:2:1] 2 | 3 | a { color: red } diff --git a/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-matcher-1/span.swc-stderr b/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-matcher-1/span.swc-stderr index b79a20fff552..f50946900166 100644 --- a/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-matcher-1/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-matcher-1/span.swc-stderr @@ -41,7 +41,7 @@ : ^^^^ `---- - x Ident { value: Atom('href' type=static), raw: "href" } + x Ident(IdentToken { value: Atom('href' type=static), raw: "href" }) ,-[$DIR/tests/recovery/selector/attribute/invalid-matcher-1/input.css:1:1] 1 | [href=] {} : ^^^^ @@ -53,7 +53,7 @@ : ^ `---- - x Delim { value: '=' } + x Delim(DelimToken { value: '=' }) ,-[$DIR/tests/recovery/selector/attribute/invalid-matcher-1/input.css:1:1] 1 | [href=] {} : ^ @@ -65,7 +65,7 @@ : ^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/selector/attribute/invalid-matcher-1/input.css:1:1] 1 | [href=] {} : ^ diff --git a/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-matcher-2/span.swc-stderr b/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-matcher-2/span.swc-stderr index e9d31d663882..7927c6d0ba28 100644 --- a/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-matcher-2/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-matcher-2/span.swc-stderr @@ -41,7 +41,7 @@ : ^^^^ `---- - x Ident { value: Atom('href' type=static), raw: "href" } + x Ident(IdentToken { value: Atom('href' type=static), raw: "href" }) ,-[$DIR/tests/recovery/selector/attribute/invalid-matcher-2/input.css:1:1] 1 | [href#="test"] {} : ^^^^ @@ -53,7 +53,7 @@ : ^ `---- - x Delim { value: '#' } + x Delim(DelimToken { value: '#' }) ,-[$DIR/tests/recovery/selector/attribute/invalid-matcher-2/input.css:1:1] 1 | [href#="test"] {} : ^ @@ -65,7 +65,7 @@ : ^ `---- - x Delim { value: '=' } + x Delim(DelimToken { value: '=' }) ,-[$DIR/tests/recovery/selector/attribute/invalid-matcher-2/input.css:1:1] 1 | [href#="test"] {} : ^ @@ -77,7 +77,7 @@ : ^^^^^^ `---- - x String { value: Atom('test' type=inline), raw: "\"test\"" } + x String(StringToken { value: Atom('test' type=inline), raw: "\"test\"" }) ,-[$DIR/tests/recovery/selector/attribute/invalid-matcher-2/input.css:1:1] 1 | [href#="test"] {} : ^^^^^^ @@ -89,7 +89,7 @@ : ^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/selector/attribute/invalid-matcher-2/input.css:1:1] 1 | [href#="test"] {} : ^ diff --git a/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-matcher-3/span.swc-stderr b/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-matcher-3/span.swc-stderr index 900cabe4ced0..be5f0b22d815 100644 --- a/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-matcher-3/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-matcher-3/span.swc-stderr @@ -27,7 +27,7 @@ 2 | color: purple; `---- - x Ident { value: Atom('a' type=static), raw: "a" } + x Ident(IdentToken { value: Atom('a' type=static), raw: "a" }) ,-[$DIR/tests/recovery/selector/attribute/invalid-matcher-3/input.css:1:1] 1 | a[title * = "title" i ] { : ^ @@ -62,7 +62,7 @@ 2 | color: purple; `---- - x Ident { value: Atom('title' type=static), raw: "title" } + x Ident(IdentToken { value: Atom('title' type=static), raw: "title" }) ,-[$DIR/tests/recovery/selector/attribute/invalid-matcher-3/input.css:1:1] 1 | a[title * = "title" i ] { : ^^^^^ @@ -76,7 +76,7 @@ 2 | color: purple; `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/selector/attribute/invalid-matcher-3/input.css:1:1] 1 | a[title * = "title" i ] { : ^ @@ -90,7 +90,7 @@ 2 | color: purple; `---- - x Delim { value: '*' } + x Delim(DelimToken { value: '*' }) ,-[$DIR/tests/recovery/selector/attribute/invalid-matcher-3/input.css:1:1] 1 | a[title * = "title" i ] { : ^ @@ -104,7 +104,7 @@ 2 | color: purple; `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/selector/attribute/invalid-matcher-3/input.css:1:1] 1 | a[title * = "title" i ] { : ^ @@ -118,7 +118,7 @@ 2 | color: purple; `---- - x Delim { value: '=' } + x Delim(DelimToken { value: '=' }) ,-[$DIR/tests/recovery/selector/attribute/invalid-matcher-3/input.css:1:1] 1 | a[title * = "title" i ] { : ^ @@ -132,7 +132,7 @@ 2 | color: purple; `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/selector/attribute/invalid-matcher-3/input.css:1:1] 1 | a[title * = "title" i ] { : ^ @@ -146,7 +146,7 @@ 2 | color: purple; `---- - x String { value: Atom('title' type=static), raw: "\"title\"" } + x String(StringToken { value: Atom('title' type=static), raw: "\"title\"" }) ,-[$DIR/tests/recovery/selector/attribute/invalid-matcher-3/input.css:1:1] 1 | a[title * = "title" i ] { : ^^^^^^^ @@ -160,7 +160,7 @@ 2 | color: purple; `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/selector/attribute/invalid-matcher-3/input.css:1:1] 1 | a[title * = "title" i ] { : ^ @@ -174,7 +174,7 @@ 2 | color: purple; `---- - x Ident { value: Atom('i' type=static), raw: "i" } + x Ident(IdentToken { value: Atom('i' type=static), raw: "i" }) ,-[$DIR/tests/recovery/selector/attribute/invalid-matcher-3/input.css:1:1] 1 | a[title * = "title" i ] { : ^ @@ -188,7 +188,7 @@ 2 | color: purple; `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/selector/attribute/invalid-matcher-3/input.css:1:1] 1 | a[title * = "title" i ] { : ^ @@ -202,7 +202,7 @@ 2 | color: purple; `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/selector/attribute/invalid-matcher-3/input.css:1:1] 1 | a[title * = "title" i ] { : ^ diff --git a/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-matcher-4/span.swc-stderr b/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-matcher-4/span.swc-stderr index ee13b9ccddce..6f5c376a6b74 100644 --- a/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-matcher-4/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-matcher-4/span.swc-stderr @@ -27,7 +27,7 @@ 2 | color: purple; `---- - x Ident { value: Atom('a' type=static), raw: "a" } + x Ident(IdentToken { value: Atom('a' type=static), raw: "a" }) ,-[$DIR/tests/recovery/selector/attribute/invalid-matcher-4/input.css:1:1] 1 | a[title%="title"] { : ^ @@ -62,7 +62,7 @@ 2 | color: purple; `---- - x Ident { value: Atom('title' type=static), raw: "title" } + x Ident(IdentToken { value: Atom('title' type=static), raw: "title" }) ,-[$DIR/tests/recovery/selector/attribute/invalid-matcher-4/input.css:1:1] 1 | a[title%="title"] { : ^^^^^ @@ -76,7 +76,7 @@ 2 | color: purple; `---- - x Delim { value: '%' } + x Delim(DelimToken { value: '%' }) ,-[$DIR/tests/recovery/selector/attribute/invalid-matcher-4/input.css:1:1] 1 | a[title%="title"] { : ^ @@ -90,7 +90,7 @@ 2 | color: purple; `---- - x Delim { value: '=' } + x Delim(DelimToken { value: '=' }) ,-[$DIR/tests/recovery/selector/attribute/invalid-matcher-4/input.css:1:1] 1 | a[title%="title"] { : ^ @@ -104,7 +104,7 @@ 2 | color: purple; `---- - x String { value: Atom('title' type=static), raw: "\"title\"" } + x String(StringToken { value: Atom('title' type=static), raw: "\"title\"" }) ,-[$DIR/tests/recovery/selector/attribute/invalid-matcher-4/input.css:1:1] 1 | a[title%="title"] { : ^^^^^^^ @@ -118,7 +118,7 @@ 2 | color: purple; `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/selector/attribute/invalid-matcher-4/input.css:1:1] 1 | a[title%="title"] { : ^ diff --git a/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-matcher/span.swc-stderr b/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-matcher/span.swc-stderr index f6e817b15666..10a028ac3ff9 100644 --- a/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-matcher/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-matcher/span.swc-stderr @@ -41,7 +41,7 @@ : ^^^^ `---- - x Ident { value: Atom('href' type=static), raw: "href" } + x Ident(IdentToken { value: Atom('href' type=static), raw: "href" }) ,-[$DIR/tests/recovery/selector/attribute/invalid-matcher/input.css:1:1] 1 | [href==".org"] {} : ^^^^ @@ -53,7 +53,7 @@ : ^ `---- - x Delim { value: '=' } + x Delim(DelimToken { value: '=' }) ,-[$DIR/tests/recovery/selector/attribute/invalid-matcher/input.css:1:1] 1 | [href==".org"] {} : ^ @@ -65,7 +65,7 @@ : ^ `---- - x Delim { value: '=' } + x Delim(DelimToken { value: '=' }) ,-[$DIR/tests/recovery/selector/attribute/invalid-matcher/input.css:1:1] 1 | [href==".org"] {} : ^ @@ -77,7 +77,7 @@ : ^^^^^^ `---- - x String { value: Atom('.org' type=inline), raw: "\".org\"" } + x String(StringToken { value: Atom('.org' type=inline), raw: "\".org\"" }) ,-[$DIR/tests/recovery/selector/attribute/invalid-matcher/input.css:1:1] 1 | [href==".org"] {} : ^^^^^^ @@ -89,7 +89,7 @@ : ^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/selector/attribute/invalid-matcher/input.css:1:1] 1 | [href==".org"] {} : ^ diff --git a/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-modifier/span.swc-stderr b/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-modifier/span.swc-stderr index 7eb2e0530b34..91e7c0f9f54d 100644 --- a/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-modifier/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-modifier/span.swc-stderr @@ -41,7 +41,7 @@ : ^^^^ `---- - x Ident { value: Atom('href' type=static), raw: "href" } + x Ident(IdentToken { value: Atom('href' type=static), raw: "href" }) ,-[$DIR/tests/recovery/selector/attribute/invalid-modifier/input.css:1:1] 1 | [href="test" "z"] {} : ^^^^ @@ -53,7 +53,7 @@ : ^ `---- - x Delim { value: '=' } + x Delim(DelimToken { value: '=' }) ,-[$DIR/tests/recovery/selector/attribute/invalid-modifier/input.css:1:1] 1 | [href="test" "z"] {} : ^ @@ -65,7 +65,7 @@ : ^^^^^^ `---- - x String { value: Atom('test' type=inline), raw: "\"test\"" } + x String(StringToken { value: Atom('test' type=inline), raw: "\"test\"" }) ,-[$DIR/tests/recovery/selector/attribute/invalid-modifier/input.css:1:1] 1 | [href="test" "z"] {} : ^^^^^^ @@ -77,7 +77,7 @@ : ^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/selector/attribute/invalid-modifier/input.css:1:1] 1 | [href="test" "z"] {} : ^ @@ -89,7 +89,7 @@ : ^^^ `---- - x String { value: Atom('z' type=inline), raw: "\"z\"" } + x String(StringToken { value: Atom('z' type=inline), raw: "\"z\"" }) ,-[$DIR/tests/recovery/selector/attribute/invalid-modifier/input.css:1:1] 1 | [href="test" "z"] {} : ^^^ @@ -101,7 +101,7 @@ : ^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/selector/attribute/invalid-modifier/input.css:1:1] 1 | [href="test" "z"] {} : ^ diff --git a/crates/swc_css_parser/tests/recovery/selector/attribute/unclosed/span.swc-stderr b/crates/swc_css_parser/tests/recovery/selector/attribute/unclosed/span.swc-stderr index 4c53407d39b1..6cad6c6c65de 100644 --- a/crates/swc_css_parser/tests/recovery/selector/attribute/unclosed/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/selector/attribute/unclosed/span.swc-stderr @@ -19,7 +19,7 @@ : ^ `---- - x Delim { value: '.' } + x Delim(DelimToken { value: '.' }) ,-[$DIR/tests/recovery/selector/attribute/unclosed/input.css:1:1] 1 | .class[attr= { : ^ @@ -31,7 +31,7 @@ : ^^^^^ `---- - x Ident { value: Atom('class' type=static), raw: "class" } + x Ident(IdentToken { value: Atom('class' type=static), raw: "class" }) ,-[$DIR/tests/recovery/selector/attribute/unclosed/input.css:1:1] 1 | .class[attr= { : ^^^^^ @@ -63,7 +63,7 @@ : ^^^^ `---- - x Ident { value: Atom('attr' type=inline), raw: "attr" } + x Ident(IdentToken { value: Atom('attr' type=inline), raw: "attr" }) ,-[$DIR/tests/recovery/selector/attribute/unclosed/input.css:1:1] 1 | .class[attr= { : ^^^^ @@ -75,7 +75,7 @@ : ^ `---- - x Delim { value: '=' } + x Delim(DelimToken { value: '=' }) ,-[$DIR/tests/recovery/selector/attribute/unclosed/input.css:1:1] 1 | .class[attr= { : ^ @@ -87,7 +87,7 @@ : ^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/selector/attribute/unclosed/input.css:1:1] 1 | .class[attr= { : ^ @@ -120,7 +120,7 @@ 3 | } `---- - x WhiteSpace { value: "\n\n" } + x WhiteSpace(WhiteSpaceToken { value: "\n\n" }) ,-[$DIR/tests/recovery/selector/attribute/unclosed/input.css:1:1] 1 | ,-> .class[attr= { 2 | `-> @@ -134,7 +134,7 @@ : ^ `---- - x WhiteSpace { value: "\n" } + x WhiteSpace(WhiteSpaceToken { value: "\n" }) ,-[$DIR/tests/recovery/selector/attribute/unclosed/input.css:2:1] 2 | 3 | } diff --git a/crates/swc_css_parser/tests/recovery/selector/combinator/only/span.swc-stderr b/crates/swc_css_parser/tests/recovery/selector/combinator/only/span.swc-stderr index a887c1b15036..04be8a4535c7 100644 --- a/crates/swc_css_parser/tests/recovery/selector/combinator/only/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/selector/combinator/only/span.swc-stderr @@ -26,7 +26,7 @@ : ^ `---- - x Delim { value: '>' } + x Delim(DelimToken { value: '>' }) ,-[$DIR/tests/recovery/selector/combinator/only/input.css:1:1] 1 | > { : ^ @@ -38,7 +38,7 @@ : ^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/selector/combinator/only/input.css:1:1] 1 | > { : ^ diff --git a/crates/swc_css_parser/tests/recovery/selector/combinator/two/span.swc-stderr b/crates/swc_css_parser/tests/recovery/selector/combinator/two/span.swc-stderr index 48af46492cf3..41b8d1123517 100644 --- a/crates/swc_css_parser/tests/recovery/selector/combinator/two/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/selector/combinator/two/span.swc-stderr @@ -23,7 +23,7 @@ : ^^^^ `---- - x Ident { value: Atom('span' type=static), raw: "span" } + x Ident(IdentToken { value: Atom('span' type=static), raw: "span" }) ,-[$DIR/tests/recovery/selector/combinator/two/input.css:1:1] 1 | span ~ + {} : ^^^^ @@ -35,7 +35,7 @@ : ^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/selector/combinator/two/input.css:1:1] 1 | span ~ + {} : ^ @@ -47,7 +47,7 @@ : ^ `---- - x Delim { value: '~' } + x Delim(DelimToken { value: '~' }) ,-[$DIR/tests/recovery/selector/combinator/two/input.css:1:1] 1 | span ~ + {} : ^ @@ -59,7 +59,7 @@ : ^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/selector/combinator/two/input.css:1:1] 1 | span ~ + {} : ^ @@ -71,7 +71,7 @@ : ^ `---- - x Delim { value: '+' } + x Delim(DelimToken { value: '+' }) ,-[$DIR/tests/recovery/selector/combinator/two/input.css:1:1] 1 | span ~ + {} : ^ @@ -83,7 +83,7 @@ : ^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/selector/combinator/two/input.css:1:1] 1 | span ~ + {} : ^ diff --git a/crates/swc_css_parser/tests/recovery/selector/id/invalid/span.swc-stderr b/crates/swc_css_parser/tests/recovery/selector/id/invalid/span.swc-stderr index ed166dfe4d48..b6c8fab5d7ff 100644 --- a/crates/swc_css_parser/tests/recovery/selector/id/invalid/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/selector/id/invalid/span.swc-stderr @@ -26,7 +26,7 @@ : ^^^^^ `---- - x Hash { is_id: false, value: Atom('1234' type=inline), raw: "1234" } + x Hash(HashToken { is_id: false, value: Atom('1234' type=inline), raw: "1234" }) ,-[$DIR/tests/recovery/selector/id/invalid/input.css:1:1] 1 | #1234 { : ^^^^^ @@ -38,7 +38,7 @@ : ^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/selector/id/invalid/input.css:1:1] 1 | #1234 { : ^ diff --git a/crates/swc_css_parser/tests/recovery/selector/list/span.swc-stderr b/crates/swc_css_parser/tests/recovery/selector/list/span.swc-stderr index b05c09058a7a..b740a20f382a 100644 --- a/crates/swc_css_parser/tests/recovery/selector/list/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/selector/list/span.swc-stderr @@ -38,7 +38,7 @@ 2 | } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/selector/list/input.css:1:1] 1 | , { : ^ diff --git a/crates/swc_css_parser/tests/recovery/selector/pseudo-class/an-plus-b/span.swc-stderr b/crates/swc_css_parser/tests/recovery/selector/pseudo-class/an-plus-b/span.swc-stderr index a0c91692c3f3..ca250c1cd4d4 100644 --- a/crates/swc_css_parser/tests/recovery/selector/pseudo-class/an-plus-b/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/selector/pseudo-class/an-plus-b/span.swc-stderr @@ -59,7 +59,7 @@ : ^^^^^^^ `---- - x Ident { value: Atom('unknown' type=static), raw: "unknown" } + x Ident(IdentToken { value: Atom('unknown' type=static), raw: "unknown" }) ,-[$DIR/tests/recovery/selector/pseudo-class/an-plus-b/input.css:1:1] 1 | :nth-child(unknown) {} : ^^^^^^^ diff --git a/crates/swc_css_parser/tests/recovery/selector/pseudo-class/invalid-function/span.swc-stderr b/crates/swc_css_parser/tests/recovery/selector/pseudo-class/invalid-function/span.swc-stderr index 7e95401a0323..5429b9a5733d 100644 --- a/crates/swc_css_parser/tests/recovery/selector/pseudo-class/invalid-function/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/selector/pseudo-class/invalid-function/span.swc-stderr @@ -38,7 +38,7 @@ : ^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/selector/pseudo-class/invalid-function/input.css:1:1] 1 | : nth-child(2) { : ^ @@ -68,7 +68,7 @@ : ^ `---- - x Number { value: 2.0, raw: "2", type_flag: Integer } + x Number(NumberToken { value: 2.0, raw: "2", type_flag: Integer }) ,-[$DIR/tests/recovery/selector/pseudo-class/invalid-function/input.css:1:1] 1 | : nth-child(2) { : ^ @@ -80,7 +80,7 @@ : ^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/selector/pseudo-class/invalid-function/input.css:1:1] 1 | : nth-child(2) { : ^ diff --git a/crates/swc_css_parser/tests/recovery/selector/pseudo-class/invalid-ident/span.swc-stderr b/crates/swc_css_parser/tests/recovery/selector/pseudo-class/invalid-ident/span.swc-stderr index acbb87bb3195..2a87881b6c2d 100644 --- a/crates/swc_css_parser/tests/recovery/selector/pseudo-class/invalid-ident/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/selector/pseudo-class/invalid-ident/span.swc-stderr @@ -41,7 +41,7 @@ 2 | `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/selector/pseudo-class/invalid-ident/input.css:1:1] 1 | : first-child { : ^ @@ -55,7 +55,7 @@ 2 | `---- - x Ident { value: Atom('first-child' type=static), raw: "first-child" } + x Ident(IdentToken { value: Atom('first-child' type=static), raw: "first-child" }) ,-[$DIR/tests/recovery/selector/pseudo-class/invalid-ident/input.css:1:1] 1 | : first-child { : ^^^^^^^^^^^ @@ -69,7 +69,7 @@ 2 | `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/selector/pseudo-class/invalid-ident/input.css:1:1] 1 | : first-child { : ^ diff --git a/crates/swc_css_parser/tests/recovery/selector/pseudo-class/invalid/span.swc-stderr b/crates/swc_css_parser/tests/recovery/selector/pseudo-class/invalid/span.swc-stderr index d6cb6aeb9567..6f68380a8b96 100644 --- a/crates/swc_css_parser/tests/recovery/selector/pseudo-class/invalid/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/selector/pseudo-class/invalid/span.swc-stderr @@ -26,7 +26,7 @@ : ^ `---- - x Ident { value: Atom('a' type=static), raw: "a" } + x Ident(IdentToken { value: Atom('a' type=static), raw: "a" }) ,-[$DIR/tests/recovery/selector/pseudo-class/invalid/input.css:1:1] 1 | a: b {} : ^ @@ -50,7 +50,7 @@ : ^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/selector/pseudo-class/invalid/input.css:1:1] 1 | a: b {} : ^ @@ -62,7 +62,7 @@ : ^ `---- - x Ident { value: Atom('b' type=static), raw: "b" } + x Ident(IdentToken { value: Atom('b' type=static), raw: "b" }) ,-[$DIR/tests/recovery/selector/pseudo-class/invalid/input.css:1:1] 1 | a: b {} : ^ @@ -74,7 +74,7 @@ : ^ `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/selector/pseudo-class/invalid/input.css:1:1] 1 | a: b {} : ^ @@ -116,7 +116,7 @@ 4 | color: red; `---- - x Ident { value: Atom('a' type=static), raw: "a" } + x Ident(IdentToken { value: Atom('a' type=static), raw: "a" }) ,-[$DIR/tests/recovery/selector/pseudo-class/invalid/input.css:2:1] 2 | 3 | a: b { @@ -148,7 +148,7 @@ 4 | color: red; `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/selector/pseudo-class/invalid/input.css:2:1] 2 | 3 | a: b { @@ -164,7 +164,7 @@ 4 | color: red; `---- - x Ident { value: Atom('b' type=static), raw: "b" } + x Ident(IdentToken { value: Atom('b' type=static), raw: "b" }) ,-[$DIR/tests/recovery/selector/pseudo-class/invalid/input.css:2:1] 2 | 3 | a: b { @@ -180,7 +180,7 @@ 4 | color: red; `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/selector/pseudo-class/invalid/input.css:2:1] 2 | 3 | a: b { diff --git a/crates/swc_css_parser/tests/recovery/selector/pseudo-element/after/span.swc-stderr b/crates/swc_css_parser/tests/recovery/selector/pseudo-element/after/span.swc-stderr index 94380c911f0c..58eca1c4c696 100644 --- a/crates/swc_css_parser/tests/recovery/selector/pseudo-element/after/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/selector/pseudo-element/after/span.swc-stderr @@ -55,7 +55,7 @@ 2 | `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/selector/pseudo-element/after/input.css:1:1] 1 | :: foo { : ^ @@ -69,7 +69,7 @@ 2 | `---- - x Ident { value: Atom('foo' type=inline), raw: "foo" } + x Ident(IdentToken { value: Atom('foo' type=inline), raw: "foo" }) ,-[$DIR/tests/recovery/selector/pseudo-element/after/input.css:1:1] 1 | :: foo { : ^^^ @@ -83,7 +83,7 @@ 2 | `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/selector/pseudo-element/after/input.css:1:1] 1 | :: foo { : ^ diff --git a/crates/swc_css_parser/tests/recovery/selector/pseudo-element/between/span.swc-stderr b/crates/swc_css_parser/tests/recovery/selector/pseudo-element/between/span.swc-stderr index aeb700e337f3..b8f77c92cd72 100644 --- a/crates/swc_css_parser/tests/recovery/selector/pseudo-element/between/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/selector/pseudo-element/between/span.swc-stderr @@ -41,7 +41,7 @@ 2 | `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/selector/pseudo-element/between/input.css:1:1] 1 | : :foo { : ^ @@ -69,7 +69,7 @@ 2 | `---- - x Ident { value: Atom('foo' type=inline), raw: "foo" } + x Ident(IdentToken { value: Atom('foo' type=inline), raw: "foo" }) ,-[$DIR/tests/recovery/selector/pseudo-element/between/input.css:1:1] 1 | : :foo { : ^^^ @@ -83,7 +83,7 @@ 2 | `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/selector/pseudo-element/between/input.css:1:1] 1 | : :foo { : ^ diff --git a/crates/swc_css_parser/tests/recovery/selector/pseudo-element/invalid/span.swc-stderr b/crates/swc_css_parser/tests/recovery/selector/pseudo-element/invalid/span.swc-stderr index ef7b7f4776b9..eed53337b2e4 100644 --- a/crates/swc_css_parser/tests/recovery/selector/pseudo-element/invalid/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/selector/pseudo-element/invalid/span.swc-stderr @@ -24,7 +24,7 @@ 2 | } `---- - x Ident { value: Atom('a' type=static), raw: "a" } + x Ident(IdentToken { value: Atom('a' type=static), raw: "a" }) ,-[$DIR/tests/recovery/selector/pseudo-element/invalid/input.css:1:1] 1 | a::1 { : ^ @@ -66,7 +66,7 @@ 2 | } `---- - x Number { value: 1.0, raw: "1", type_flag: Integer } + x Number(NumberToken { value: 1.0, raw: "1", type_flag: Integer }) ,-[$DIR/tests/recovery/selector/pseudo-element/invalid/input.css:1:1] 1 | a::1 { : ^ @@ -80,7 +80,7 @@ 2 | } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/selector/pseudo-element/invalid/input.css:1:1] 1 | a::1 { : ^ diff --git a/crates/swc_css_parser/tests/recovery/style-blocks-contents/basic/span.swc-stderr b/crates/swc_css_parser/tests/recovery/style-blocks-contents/basic/span.swc-stderr index 36e181e91ff9..e021a32c306b 100644 --- a/crates/swc_css_parser/tests/recovery/style-blocks-contents/basic/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/style-blocks-contents/basic/span.swc-stderr @@ -343,7 +343,7 @@ 6 | color: green; `---- - x Ident { value: Atom('ident' type=inline), raw: "ident" } + x Ident(IdentToken { value: Atom('ident' type=inline), raw: "ident" }) ,-[$DIR/tests/recovery/style-blocks-contents/basic/input.css:4:1] 4 | &.foo { 5 | ident @@ -359,7 +359,7 @@ 7 | } `---- - x WhiteSpace { value: "\n " } + x WhiteSpace(WhiteSpaceToken { value: "\n " }) ,-[$DIR/tests/recovery/style-blocks-contents/basic/input.css:4:1] 4 | &.foo { 5 | ,-> ident @@ -375,7 +375,7 @@ 7 | } `---- - x Ident { value: Atom('color' type=static), raw: "color" } + x Ident(IdentToken { value: Atom('color' type=static), raw: "color" }) ,-[$DIR/tests/recovery/style-blocks-contents/basic/input.css:5:1] 5 | ident 6 | color: green; @@ -407,7 +407,7 @@ 7 | } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/style-blocks-contents/basic/input.css:5:1] 5 | ident 6 | color: green; @@ -423,7 +423,7 @@ 7 | } `---- - x Ident { value: Atom('green' type=inline), raw: "green" } + x Ident(IdentToken { value: Atom('green' type=inline), raw: "green" }) ,-[$DIR/tests/recovery/style-blocks-contents/basic/input.css:5:1] 5 | ident 6 | color: green; @@ -818,7 +818,7 @@ 14 | color: red `---- - x Ident { value: Atom('ident' type=inline), raw: "ident" } + x Ident(IdentToken { value: Atom('ident' type=inline), raw: "ident" }) ,-[$DIR/tests/recovery/style-blocks-contents/basic/input.css:12:1] 12 | & .class { 13 | ident @@ -834,7 +834,7 @@ 15 | } `---- - x WhiteSpace { value: "\n " } + x WhiteSpace(WhiteSpaceToken { value: "\n " }) ,-[$DIR/tests/recovery/style-blocks-contents/basic/input.css:12:1] 12 | & .class { 13 | ,-> ident @@ -850,7 +850,7 @@ 15 | } `---- - x Ident { value: Atom('color' type=static), raw: "color" } + x Ident(IdentToken { value: Atom('color' type=static), raw: "color" }) ,-[$DIR/tests/recovery/style-blocks-contents/basic/input.css:13:1] 13 | ident 14 | color: red @@ -882,7 +882,7 @@ 15 | } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/style-blocks-contents/basic/input.css:13:1] 13 | ident 14 | color: red @@ -898,7 +898,7 @@ 15 | } `---- - x Ident { value: Atom('red' type=inline), raw: "red" } + x Ident(IdentToken { value: Atom('red' type=inline), raw: "red" }) ,-[$DIR/tests/recovery/style-blocks-contents/basic/input.css:13:1] 13 | ident 14 | color: red @@ -914,7 +914,7 @@ 16 | } `---- - x WhiteSpace { value: " \n " } + x WhiteSpace(WhiteSpaceToken { value: " \n " }) ,-[$DIR/tests/recovery/style-blocks-contents/basic/input.css:13:1] 13 | ident 14 | ,-> color: red @@ -1225,7 +1225,7 @@ 24 | color: green; `---- - x Ident { value: Atom('ident' type=inline), raw: "ident" } + x Ident(IdentToken { value: Atom('ident' type=inline), raw: "ident" }) ,-[$DIR/tests/recovery/style-blocks-contents/basic/input.css:22:1] 22 | &.foo { 23 | ident; @@ -1674,7 +1674,7 @@ 32 | color: red `---- - x Ident { value: Atom('ident' type=inline), raw: "ident" } + x Ident(IdentToken { value: Atom('ident' type=inline), raw: "ident" }) ,-[$DIR/tests/recovery/style-blocks-contents/basic/input.css:30:1] 30 | & .class { 31 | ident; @@ -1917,7 +1917,7 @@ 40 | } `---- - x Delim { value: '&' } + x Delim(DelimToken { value: '&' }) ,-[$DIR/tests/recovery/style-blocks-contents/basic/input.css:38:1] 38 | color: red; 39 | & test; @@ -1933,7 +1933,7 @@ 40 | } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/style-blocks-contents/basic/input.css:38:1] 38 | color: red; 39 | & test; @@ -1949,7 +1949,7 @@ 40 | } `---- - x Ident { value: Atom('test' type=inline), raw: "test" } + x Ident(IdentToken { value: Atom('test' type=inline), raw: "test" }) ,-[$DIR/tests/recovery/style-blocks-contents/basic/input.css:38:1] 38 | color: red; 39 | & test; @@ -2191,7 +2191,7 @@ 46 | } `---- - x Ident { value: Atom('__ident__' type=dynamic), raw: "__ident__" } + x Ident(IdentToken { value: Atom('__ident__' type=dynamic), raw: "__ident__" }) ,-[$DIR/tests/recovery/style-blocks-contents/basic/input.css:44:1] 44 | &.foo { 45 | __ident__ @@ -2207,7 +2207,7 @@ 47 | } `---- - x WhiteSpace { value: "\n " } + x WhiteSpace(WhiteSpaceToken { value: "\n " }) ,-[$DIR/tests/recovery/style-blocks-contents/basic/input.css:44:1] 44 | &.foo { 45 | ,-> __ident__ diff --git a/crates/swc_css_parser/tests/recovery/style-blocks-contents/invalid-nested-1/span.swc-stderr b/crates/swc_css_parser/tests/recovery/style-blocks-contents/invalid-nested-1/span.swc-stderr index 1c55ba818e36..d0b54c2ca2f1 100644 --- a/crates/swc_css_parser/tests/recovery/style-blocks-contents/invalid-nested-1/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/style-blocks-contents/invalid-nested-1/span.swc-stderr @@ -174,7 +174,7 @@ 5 | margin: 1em; `---- - x Ident { value: Atom('input' type=static), raw: "input" } + x Ident(IdentToken { value: Atom('input' type=static), raw: "input" }) ,-[$DIR/tests/recovery/style-blocks-contents/invalid-nested-1/input.css:3:1] 3 | 4 | input { @@ -190,7 +190,7 @@ 5 | margin: 1em; `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/style-blocks-contents/invalid-nested-1/input.css:3:1] 3 | 4 | input { @@ -232,7 +232,7 @@ 6 | } `---- - x WhiteSpace { value: "\n " } + x WhiteSpace(WhiteSpaceToken { value: "\n " }) ,-[$DIR/tests/recovery/style-blocks-contents/invalid-nested-1/input.css:3:1] 3 | 4 | ,-> input { @@ -248,7 +248,7 @@ 6 | } `---- - x Ident { value: Atom('margin' type=static), raw: "margin" } + x Ident(IdentToken { value: Atom('margin' type=static), raw: "margin" }) ,-[$DIR/tests/recovery/style-blocks-contents/invalid-nested-1/input.css:4:1] 4 | input { 5 | margin: 1em; @@ -280,7 +280,7 @@ 6 | } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/style-blocks-contents/invalid-nested-1/input.css:4:1] 4 | input { 5 | margin: 1em; @@ -296,7 +296,7 @@ 6 | } `---- - x Dimension { value: 1.0, unit: Atom('em' type=static), type_flag: Integer, raw: ("1", "em") } + x Dimension(DimensionToken { value: 1.0, unit: Atom('em' type=static), type_flag: Integer, raw: ("1", "em") }) ,-[$DIR/tests/recovery/style-blocks-contents/invalid-nested-1/input.css:4:1] 4 | input { 5 | margin: 1em; @@ -328,7 +328,7 @@ 7 | } `---- - x WhiteSpace { value: "\n " } + x WhiteSpace(WhiteSpaceToken { value: "\n " }) ,-[$DIR/tests/recovery/style-blocks-contents/invalid-nested-1/input.css:4:1] 4 | input { 5 | ,-> margin: 1em; @@ -344,7 +344,7 @@ 7 | } `---- - x WhiteSpace { value: "\n" } + x WhiteSpace(WhiteSpaceToken { value: "\n" }) ,-[$DIR/tests/recovery/style-blocks-contents/invalid-nested-1/input.css:5:1] 5 | margin: 1em; 6 | } diff --git a/crates/swc_css_parser/tests/recovery/style-blocks-contents/invalid-nested-2/span.swc-stderr b/crates/swc_css_parser/tests/recovery/style-blocks-contents/invalid-nested-2/span.swc-stderr index 27ff4f837baa..94046e077780 100644 --- a/crates/swc_css_parser/tests/recovery/style-blocks-contents/invalid-nested-2/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/style-blocks-contents/invalid-nested-2/span.swc-stderr @@ -171,7 +171,7 @@ 4 | background: red `---- - x Delim { value: '&' } + x Delim(DelimToken { value: '&' }) ,-[$DIR/tests/recovery/style-blocks-contents/invalid-nested-2/input.css:2:1] 2 | color: red; 3 | & test; @@ -187,7 +187,7 @@ 4 | background: red `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/style-blocks-contents/invalid-nested-2/input.css:2:1] 2 | color: red; 3 | & test; @@ -203,7 +203,7 @@ 4 | background: red `---- - x Ident { value: Atom('test' type=inline), raw: "test" } + x Ident(IdentToken { value: Atom('test' type=inline), raw: "test" }) ,-[$DIR/tests/recovery/style-blocks-contents/invalid-nested-2/input.css:2:1] 2 | color: red; 3 | & test; diff --git a/crates/swc_css_parser/tests/recovery/style-blocks-contents/invalid-nested/span.swc-stderr b/crates/swc_css_parser/tests/recovery/style-blocks-contents/invalid-nested/span.swc-stderr index 52f872b9da20..f70236ca2789 100644 --- a/crates/swc_css_parser/tests/recovery/style-blocks-contents/invalid-nested/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/style-blocks-contents/invalid-nested/span.swc-stderr @@ -171,7 +171,7 @@ 4 | background: red; `---- - x Delim { value: '&' } + x Delim(DelimToken { value: '&' }) ,-[$DIR/tests/recovery/style-blocks-contents/invalid-nested/input.css:2:1] 2 | color: red; 3 | & test; @@ -187,7 +187,7 @@ 4 | background: red; `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/style-blocks-contents/invalid-nested/input.css:2:1] 2 | color: red; 3 | & test; @@ -203,7 +203,7 @@ 4 | background: red; `---- - x Ident { value: Atom('test' type=inline), raw: "test" } + x Ident(IdentToken { value: Atom('test' type=inline), raw: "test" }) ,-[$DIR/tests/recovery/style-blocks-contents/invalid-nested/input.css:2:1] 2 | color: red; 3 | & test; diff --git a/crates/swc_css_parser/tests/recovery/styled-jsx/1/span.swc-stderr b/crates/swc_css_parser/tests/recovery/styled-jsx/1/span.swc-stderr index f921ec8cdd7b..2a00e07fc291 100644 --- a/crates/swc_css_parser/tests/recovery/styled-jsx/1/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/styled-jsx/1/span.swc-stderr @@ -389,7 +389,7 @@ 8 | padding: __styled-jsx-placeholder__1; `---- - x Delim { value: '>' } + x Delim(DelimToken { value: '>' }) ,-[$DIR/tests/recovery/styled-jsx/1/input.css:6:1] 6 | 7 | .removed-214123 :global(> .removed-214123-item) { @@ -405,7 +405,7 @@ 8 | padding: __styled-jsx-placeholder__1; `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/styled-jsx/1/input.css:6:1] 6 | 7 | .removed-214123 :global(> .removed-214123-item) { @@ -421,7 +421,7 @@ 8 | padding: __styled-jsx-placeholder__1; `---- - x Delim { value: '.' } + x Delim(DelimToken { value: '.' }) ,-[$DIR/tests/recovery/styled-jsx/1/input.css:6:1] 6 | 7 | .removed-214123 :global(> .removed-214123-item) { @@ -437,7 +437,7 @@ 8 | padding: __styled-jsx-placeholder__1; `---- - x Ident { value: Atom('removed-214123-item' type=dynamic), raw: "removed-214123-item" } + x Ident(IdentToken { value: Atom('removed-214123-item' type=dynamic), raw: "removed-214123-item" }) ,-[$DIR/tests/recovery/styled-jsx/1/input.css:6:1] 6 | 7 | .removed-214123 :global(> .removed-214123-item) { @@ -624,7 +624,7 @@ 11 | min-width: 0; `---- - x Ident { value: Atom('__styled-jsx-placeholder__2' type=dynamic), raw: "__styled-jsx-placeholder__2" } + x Ident(IdentToken { value: Atom('__styled-jsx-placeholder__2' type=dynamic), raw: "__styled-jsx-placeholder__2" }) ,-[$DIR/tests/recovery/styled-jsx/1/input.css:9:1] 9 | flex-grow: 0; 10 | flex-basis: __styled-jsx-placeholder__2%; @@ -640,7 +640,7 @@ 11 | min-width: 0; `---- - x Delim { value: '%' } + x Delim(DelimToken { value: '%' }) ,-[$DIR/tests/recovery/styled-jsx/1/input.css:9:1] 9 | flex-grow: 0; 10 | flex-basis: __styled-jsx-placeholder__2%; @@ -913,7 +913,7 @@ 16 | flex-basis: __styled-jsx-placeholder__3%; `---- - x Delim { value: '>' } + x Delim(DelimToken { value: '>' }) ,-[$DIR/tests/recovery/styled-jsx/1/input.css:14:1] 14 | @media screen { 15 | .removed-214123 :global(> .removed-214123-item) { @@ -929,7 +929,7 @@ 16 | flex-basis: __styled-jsx-placeholder__3%; `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/styled-jsx/1/input.css:14:1] 14 | @media screen { 15 | .removed-214123 :global(> .removed-214123-item) { @@ -945,7 +945,7 @@ 16 | flex-basis: __styled-jsx-placeholder__3%; `---- - x Delim { value: '.' } + x Delim(DelimToken { value: '.' }) ,-[$DIR/tests/recovery/styled-jsx/1/input.css:14:1] 14 | @media screen { 15 | .removed-214123 :global(> .removed-214123-item) { @@ -961,7 +961,7 @@ 16 | flex-basis: __styled-jsx-placeholder__3%; `---- - x Ident { value: Atom('removed-214123-item' type=dynamic), raw: "removed-214123-item" } + x Ident(IdentToken { value: Atom('removed-214123-item' type=dynamic), raw: "removed-214123-item" }) ,-[$DIR/tests/recovery/styled-jsx/1/input.css:14:1] 14 | @media screen { 15 | .removed-214123 :global(> .removed-214123-item) { @@ -1034,7 +1034,7 @@ 17 | } `---- - x Ident { value: Atom('__styled-jsx-placeholder__3' type=dynamic), raw: "__styled-jsx-placeholder__3" } + x Ident(IdentToken { value: Atom('__styled-jsx-placeholder__3' type=dynamic), raw: "__styled-jsx-placeholder__3" }) ,-[$DIR/tests/recovery/styled-jsx/1/input.css:15:1] 15 | .removed-214123 :global(> .removed-214123-item) { 16 | flex-basis: __styled-jsx-placeholder__3%; @@ -1050,7 +1050,7 @@ 17 | } `---- - x Delim { value: '%' } + x Delim(DelimToken { value: '%' }) ,-[$DIR/tests/recovery/styled-jsx/1/input.css:15:1] 15 | .removed-214123 :global(> .removed-214123-item) { 16 | flex-basis: __styled-jsx-placeholder__3%; @@ -1267,7 +1267,7 @@ 22 | flex-basis: __styled-jsx-placeholder__4%; `---- - x Delim { value: '>' } + x Delim(DelimToken { value: '>' }) ,-[$DIR/tests/recovery/styled-jsx/1/input.css:20:1] 20 | @media screen { 21 | .removed-214123 :global(> .removed-214123-item) { @@ -1283,7 +1283,7 @@ 22 | flex-basis: __styled-jsx-placeholder__4%; `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/styled-jsx/1/input.css:20:1] 20 | @media screen { 21 | .removed-214123 :global(> .removed-214123-item) { @@ -1299,7 +1299,7 @@ 22 | flex-basis: __styled-jsx-placeholder__4%; `---- - x Delim { value: '.' } + x Delim(DelimToken { value: '.' }) ,-[$DIR/tests/recovery/styled-jsx/1/input.css:20:1] 20 | @media screen { 21 | .removed-214123 :global(> .removed-214123-item) { @@ -1315,7 +1315,7 @@ 22 | flex-basis: __styled-jsx-placeholder__4%; `---- - x Ident { value: Atom('removed-214123-item' type=dynamic), raw: "removed-214123-item" } + x Ident(IdentToken { value: Atom('removed-214123-item' type=dynamic), raw: "removed-214123-item" }) ,-[$DIR/tests/recovery/styled-jsx/1/input.css:20:1] 20 | @media screen { 21 | .removed-214123 :global(> .removed-214123-item) { @@ -1388,7 +1388,7 @@ 23 | } `---- - x Ident { value: Atom('__styled-jsx-placeholder__4' type=dynamic), raw: "__styled-jsx-placeholder__4" } + x Ident(IdentToken { value: Atom('__styled-jsx-placeholder__4' type=dynamic), raw: "__styled-jsx-placeholder__4" }) ,-[$DIR/tests/recovery/styled-jsx/1/input.css:21:1] 21 | .removed-214123 :global(> .removed-214123-item) { 22 | flex-basis: __styled-jsx-placeholder__4%; @@ -1404,7 +1404,7 @@ 23 | } `---- - x Delim { value: '%' } + x Delim(DelimToken { value: '%' }) ,-[$DIR/tests/recovery/styled-jsx/1/input.css:21:1] 21 | .removed-214123 :global(> .removed-214123-item) { 22 | flex-basis: __styled-jsx-placeholder__4%; diff --git a/crates/swc_css_parser/tests/recovery/styled-jsx/2/span.swc-stderr b/crates/swc_css_parser/tests/recovery/styled-jsx/2/span.swc-stderr index 07a3cac14354..97a6d84e2f09 100644 --- a/crates/swc_css_parser/tests/recovery/styled-jsx/2/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/styled-jsx/2/span.swc-stderr @@ -104,7 +104,7 @@ 2 | flex-basis: __styled-jsx-placeholder__0%; `---- - x Delim { value: '>' } + x Delim(DelimToken { value: '>' }) ,-[$DIR/tests/recovery/styled-jsx/2/input.css:1:1] 1 | .a :global(> .b) { : ^ @@ -118,7 +118,7 @@ 2 | flex-basis: __styled-jsx-placeholder__0%; `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/styled-jsx/2/input.css:1:1] 1 | .a :global(> .b) { : ^ @@ -132,7 +132,7 @@ 2 | flex-basis: __styled-jsx-placeholder__0%; `---- - x Delim { value: '.' } + x Delim(DelimToken { value: '.' }) ,-[$DIR/tests/recovery/styled-jsx/2/input.css:1:1] 1 | .a :global(> .b) { : ^ @@ -146,7 +146,7 @@ 2 | flex-basis: __styled-jsx-placeholder__0%; `---- - x Ident { value: Atom('b' type=static), raw: "b" } + x Ident(IdentToken { value: Atom('b' type=static), raw: "b" }) ,-[$DIR/tests/recovery/styled-jsx/2/input.css:1:1] 1 | .a :global(> .b) { : ^ @@ -215,7 +215,7 @@ 3 | } `---- - x Ident { value: Atom('__styled-jsx-placeholder__0' type=dynamic), raw: "__styled-jsx-placeholder__0" } + x Ident(IdentToken { value: Atom('__styled-jsx-placeholder__0' type=dynamic), raw: "__styled-jsx-placeholder__0" }) ,-[$DIR/tests/recovery/styled-jsx/2/input.css:1:1] 1 | .a :global(> .b) { 2 | flex-basis: __styled-jsx-placeholder__0%; @@ -231,7 +231,7 @@ 3 | } `---- - x Delim { value: '%' } + x Delim(DelimToken { value: '%' }) ,-[$DIR/tests/recovery/styled-jsx/2/input.css:1:1] 1 | .a :global(> .b) { 2 | flex-basis: __styled-jsx-placeholder__0%; diff --git a/crates/swc_css_parser/tests/recovery/unicode-range/span.swc-stderr b/crates/swc_css_parser/tests/recovery/unicode-range/span.swc-stderr index 1cd2d236b8f2..486934c1e9e0 100644 --- a/crates/swc_css_parser/tests/recovery/unicode-range/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/unicode-range/span.swc-stderr @@ -128,7 +128,7 @@ 3 | unicode-range: U+1e1ee1-FFZFFF; `---- - x Ident { value: Atom('U' type=inline), raw: "U" } + x Ident(IdentToken { value: Atom('U' type=inline), raw: "U" }) ,-[$DIR/tests/recovery/unicode-range/input.css:1:1] 1 | .class { 2 | unicode-range: U+1Z1ee1-FFFFFF; @@ -144,7 +144,7 @@ 3 | unicode-range: U+1e1ee1-FFZFFF; `---- - x Dimension { value: 1.0, unit: Atom('Z1ee1-FFFFFF' type=dynamic), type_flag: Integer, raw: ("+1", "Z1ee1-FFFFFF") } + x Dimension(DimensionToken { value: 1.0, unit: Atom('Z1ee1-FFFFFF' type=dynamic), type_flag: Integer, raw: ("+1", "Z1ee1-FFFFFF") }) ,-[$DIR/tests/recovery/unicode-range/input.css:1:1] 1 | .class { 2 | unicode-range: U+1Z1ee1-FFFFFF; @@ -200,7 +200,7 @@ 4 | } `---- - x Ident { value: Atom('U' type=inline), raw: "U" } + x Ident(IdentToken { value: Atom('U' type=inline), raw: "U" }) ,-[$DIR/tests/recovery/unicode-range/input.css:2:1] 2 | unicode-range: U+1Z1ee1-FFFFFF; 3 | unicode-range: U+1e1ee1-FFZFFF; @@ -216,7 +216,7 @@ 4 | } `---- - x Dimension { value: 10.0, unit: Atom('ee1-FFZFFF' type=dynamic), type_flag: Number, raw: ("+1e1", "ee1-FFZFFF") } + x Dimension(DimensionToken { value: 10.0, unit: Atom('ee1-FFZFFF' type=dynamic), type_flag: Number, raw: ("+1e1", "ee1-FFZFFF") }) ,-[$DIR/tests/recovery/unicode-range/input.css:2:1] 2 | unicode-range: U+1Z1ee1-FFFFFF; 3 | unicode-range: U+1e1ee1-FFZFFF; diff --git a/crates/swc_css_parser/tests/recovery/value/at-keyword/1/span.swc-stderr b/crates/swc_css_parser/tests/recovery/value/at-keyword/1/span.swc-stderr index 76a1eae737bb..2b9f6dd130ac 100644 --- a/crates/swc_css_parser/tests/recovery/value/at-keyword/1/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/value/at-keyword/1/span.swc-stderr @@ -107,7 +107,7 @@ : ^^^^^^ `---- - x AtKeyword { value: Atom('x,' type=inline), raw: "x\\2c " } + x AtKeyword(AtKeywordToken { value: Atom('x,' type=inline), raw: "x\\2c " }) ,-[$DIR/tests/recovery/value/at-keyword/1/input.css:1:1] 1 | a { value: @x\2c } : ^^^^^^ diff --git a/crates/swc_css_parser/tests/recovery/value/at-keyword/2/span.swc-stderr b/crates/swc_css_parser/tests/recovery/value/at-keyword/2/span.swc-stderr index 5d93116ba2ff..52943b7fd571 100644 --- a/crates/swc_css_parser/tests/recovery/value/at-keyword/2/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/value/at-keyword/2/span.swc-stderr @@ -107,7 +107,7 @@ : ^^^^ `---- - x AtKeyword { value: Atom(',x' type=inline), raw: "\\,x" } + x AtKeyword(AtKeywordToken { value: Atom(',x' type=inline), raw: "\\,x" }) ,-[$DIR/tests/recovery/value/at-keyword/2/input.css:1:1] 1 | a { value: @\,x } : ^^^^ diff --git a/crates/swc_css_parser/tests/recovery/value/at-keyword/3/span.swc-stderr b/crates/swc_css_parser/tests/recovery/value/at-keyword/3/span.swc-stderr index 3330e41ac38a..bb422739c2f2 100644 --- a/crates/swc_css_parser/tests/recovery/value/at-keyword/3/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/value/at-keyword/3/span.swc-stderr @@ -107,7 +107,7 @@ : ^^^^^^^^^^ `---- - x AtKeyword { value: Atom('keyword' type=inline), raw: "k\\65yword" } + x AtKeyword(AtKeywordToken { value: Atom('keyword' type=inline), raw: "k\\65yword" }) ,-[$DIR/tests/recovery/value/at-keyword/3/input.css:1:1] 1 | a { value: @k\65yword } : ^^^^^^^^^^ diff --git a/crates/swc_css_parser/tests/recovery/value/at-keyword/4/span.swc-stderr b/crates/swc_css_parser/tests/recovery/value/at-keyword/4/span.swc-stderr index 998465d6b6f8..29fd28e5a289 100644 --- a/crates/swc_css_parser/tests/recovery/value/at-keyword/4/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/value/at-keyword/4/span.swc-stderr @@ -107,7 +107,7 @@ : ^^^^^ `---- - x AtKeyword { value: Atom(',x' type=inline), raw: "\\2cx" } + x AtKeyword(AtKeywordToken { value: Atom(',x' type=inline), raw: "\\2cx" }) ,-[$DIR/tests/recovery/value/at-keyword/4/input.css:1:1] 1 | a { value: @\2cx } : ^^^^^ diff --git a/crates/swc_css_parser/tests/recovery/value/at-keyword/5/span.swc-stderr b/crates/swc_css_parser/tests/recovery/value/at-keyword/5/span.swc-stderr index 82528274820b..35bb1f30004f 100644 --- a/crates/swc_css_parser/tests/recovery/value/at-keyword/5/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/value/at-keyword/5/span.swc-stderr @@ -107,7 +107,7 @@ : ^^^^ `---- - x AtKeyword { value: Atom('x,' type=inline), raw: "x\\," } + x AtKeyword(AtKeywordToken { value: Atom('x,' type=inline), raw: "x\\," }) ,-[$DIR/tests/recovery/value/at-keyword/5/input.css:1:1] 1 | a { value: @x\, } : ^^^^ diff --git a/crates/swc_css_parser/tests/recovery/value/at-keyword/6/span.swc-stderr b/crates/swc_css_parser/tests/recovery/value/at-keyword/6/span.swc-stderr index a25308b078da..9744b2b20e1a 100644 --- a/crates/swc_css_parser/tests/recovery/value/at-keyword/6/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/value/at-keyword/6/span.swc-stderr @@ -107,7 +107,7 @@ : ^^^^^^^^^^ `---- - x AtKeyword { value: Atom('ھyword' type=inline), raw: "\\6beyword" } + x AtKeyword(AtKeywordToken { value: Atom('ھyword' type=inline), raw: "\\6beyword" }) ,-[$DIR/tests/recovery/value/at-keyword/6/input.css:1:1] 1 | a { value: @\6beyword } : ^^^^^^^^^^ diff --git a/crates/swc_css_parser/tests/recovery/value/at-keyword/7/span.swc-stderr b/crates/swc_css_parser/tests/recovery/value/at-keyword/7/span.swc-stderr index 242c59d431f6..3fe003badb16 100644 --- a/crates/swc_css_parser/tests/recovery/value/at-keyword/7/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/value/at-keyword/7/span.swc-stderr @@ -107,7 +107,7 @@ : ^^^^^^^^^^^ `---- - x AtKeyword { value: Atom('keyword' type=inline), raw: "\\6b eyword" } + x AtKeyword(AtKeywordToken { value: Atom('keyword' type=inline), raw: "\\6b eyword" }) ,-[$DIR/tests/recovery/value/at-keyword/7/input.css:1:1] 1 | a { value: @\6b eyword } : ^^^^^^^^^^^ diff --git a/crates/swc_css_parser/tests/recovery/value/custom-properties/exclamation/span.swc-stderr b/crates/swc_css_parser/tests/recovery/value/custom-properties/exclamation/span.swc-stderr index b5b85a0c609b..cd5bff0d4610 100644 --- a/crates/swc_css_parser/tests/recovery/value/custom-properties/exclamation/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/value/custom-properties/exclamation/span.swc-stderr @@ -120,7 +120,7 @@ : ^ `---- - x Delim { value: '!' } + x Delim(DelimToken { value: '!' }) ,-[$DIR/tests/recovery/value/custom-properties/exclamation/input.css:1:1] 1 | .class {--foo:!; } : ^ @@ -257,7 +257,7 @@ 5 | color: red; `---- - x Delim { value: '!' } + x Delim(DelimToken { value: '!' }) ,-[$DIR/tests/recovery/value/custom-properties/exclamation/input.css:3:1] 3 | .class-1 { 4 | --foo:!; @@ -508,7 +508,7 @@ 11 | } `---- - x Delim { value: '!' } + x Delim(DelimToken { value: '!' }) ,-[$DIR/tests/recovery/value/custom-properties/exclamation/input.css:9:1] 9 | color: red; 10 | --foo:!; @@ -647,7 +647,7 @@ 15 | --foo: bar; `---- - x Delim { value: '!' } + x Delim(DelimToken { value: '!' }) ,-[$DIR/tests/recovery/value/custom-properties/exclamation/input.css:13:1] 13 | .class-3 { 14 | --foo: !; @@ -703,7 +703,7 @@ 16 | } `---- - x Ident { value: Atom('bar' type=inline), raw: "bar" } + x Ident(IdentToken { value: Atom('bar' type=inline), raw: "bar" }) ,-[$DIR/tests/recovery/value/custom-properties/exclamation/input.css:14:1] 14 | --foo: !; 15 | --foo: bar; @@ -842,7 +842,7 @@ 20 | --foo: !; `---- - x Ident { value: Atom('bar' type=inline), raw: "bar" } + x Ident(IdentToken { value: Atom('bar' type=inline), raw: "bar" }) ,-[$DIR/tests/recovery/value/custom-properties/exclamation/input.css:18:1] 18 | .class-4 { 19 | --foo: bar; @@ -898,7 +898,7 @@ 21 | } `---- - x Delim { value: '!' } + x Delim(DelimToken { value: '!' }) ,-[$DIR/tests/recovery/value/custom-properties/exclamation/input.css:19:1] 19 | --foo: bar; 20 | --foo: !; diff --git a/crates/swc_css_parser/tests/recovery/value/custom-properties/only-dashed/span.swc-stderr b/crates/swc_css_parser/tests/recovery/value/custom-properties/only-dashed/span.swc-stderr index 56083f80a545..1a093f565027 100644 --- a/crates/swc_css_parser/tests/recovery/value/custom-properties/only-dashed/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/value/custom-properties/only-dashed/span.swc-stderr @@ -104,7 +104,7 @@ 3 | } `---- - x Ident { value: Atom('--' type=inline), raw: "--" } + x Ident(IdentToken { value: Atom('--' type=inline), raw: "--" }) ,-[$DIR/tests/recovery/value/custom-properties/only-dashed/input.css:1:1] 1 | :root { 2 | --:value; @@ -136,7 +136,7 @@ 3 | } `---- - x Ident { value: Atom('value' type=inline), raw: "value" } + x Ident(IdentToken { value: Atom('value' type=inline), raw: "value" }) ,-[$DIR/tests/recovery/value/custom-properties/only-dashed/input.css:1:1] 1 | :root { 2 | --:value; @@ -288,7 +288,7 @@ 7 | } `---- - x Ident { value: Atom('--' type=inline), raw: "--" } + x Ident(IdentToken { value: Atom('--' type=inline), raw: "--" }) ,-[$DIR/tests/recovery/value/custom-properties/only-dashed/input.css:5:1] 5 | .a { 6 | counter-reset: -- --a -a; @@ -304,7 +304,7 @@ 7 | } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/value/custom-properties/only-dashed/input.css:5:1] 5 | .a { 6 | counter-reset: -- --a -a; @@ -320,7 +320,7 @@ 7 | } `---- - x Ident { value: Atom('--a' type=inline), raw: "--a" } + x Ident(IdentToken { value: Atom('--a' type=inline), raw: "--a" }) ,-[$DIR/tests/recovery/value/custom-properties/only-dashed/input.css:5:1] 5 | .a { 6 | counter-reset: -- --a -a; @@ -336,7 +336,7 @@ 7 | } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/value/custom-properties/only-dashed/input.css:5:1] 5 | .a { 6 | counter-reset: -- --a -a; @@ -352,7 +352,7 @@ 7 | } `---- - x Ident { value: Atom('-a' type=inline), raw: "-a" } + x Ident(IdentToken { value: Atom('-a' type=inline), raw: "-a" }) ,-[$DIR/tests/recovery/value/custom-properties/only-dashed/input.css:5:1] 5 | .a { 6 | counter-reset: -- --a -a; diff --git a/crates/swc_css_parser/tests/recovery/value/hash/eof/span.swc-stderr b/crates/swc_css_parser/tests/recovery/value/hash/eof/span.swc-stderr index 062d645c2394..d5ba4da4f337 100644 --- a/crates/swc_css_parser/tests/recovery/value/hash/eof/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/value/hash/eof/span.swc-stderr @@ -121,7 +121,7 @@ : ^ `---- - x Delim { value: '#' } + x Delim(DelimToken { value: '#' }) ,-[$DIR/tests/recovery/value/hash/eof/input.css:1:1] 1 | a { 2 | prop: # diff --git a/crates/swc_css_parser/tests/recovery/value/number/dot/span.swc-stderr b/crates/swc_css_parser/tests/recovery/value/number/dot/span.swc-stderr index 5e42b576f76e..aa24a6021840 100644 --- a/crates/swc_css_parser/tests/recovery/value/number/dot/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/value/number/dot/span.swc-stderr @@ -107,7 +107,7 @@ : ^ `---- - x Number { value: 0.0, raw: "0", type_flag: Integer } + x Number(NumberToken { value: 0.0, raw: "0", type_flag: Integer }) ,-[$DIR/tests/recovery/value/number/dot/input.css:1:1] 1 | a { width: 0.; } : ^ @@ -119,7 +119,7 @@ : ^ `---- - x Delim { value: '.' } + x Delim(DelimToken { value: '.' }) ,-[$DIR/tests/recovery/value/number/dot/input.css:1:1] 1 | a { width: 0.; } : ^ diff --git a/crates/swc_css_parser/tests/recovery/value/number/minus-dot/span.swc-stderr b/crates/swc_css_parser/tests/recovery/value/number/minus-dot/span.swc-stderr index 0e1ef0d1d19e..e77f55d574dd 100644 --- a/crates/swc_css_parser/tests/recovery/value/number/minus-dot/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/value/number/minus-dot/span.swc-stderr @@ -107,7 +107,7 @@ : ^^ `---- - x Number { value: -0.0, raw: "-0", type_flag: Integer } + x Number(NumberToken { value: -0.0, raw: "-0", type_flag: Integer }) ,-[$DIR/tests/recovery/value/number/minus-dot/input.css:1:1] 1 | a { width: -0.; } : ^^ @@ -119,7 +119,7 @@ : ^ `---- - x Delim { value: '.' } + x Delim(DelimToken { value: '.' }) ,-[$DIR/tests/recovery/value/number/minus-dot/input.css:1:1] 1 | a { width: -0.; } : ^ diff --git a/crates/swc_css_parser/tests/recovery/value/number/plus-dot/span.swc-stderr b/crates/swc_css_parser/tests/recovery/value/number/plus-dot/span.swc-stderr index aafa9163af9e..6a058c606fe3 100644 --- a/crates/swc_css_parser/tests/recovery/value/number/plus-dot/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/value/number/plus-dot/span.swc-stderr @@ -107,7 +107,7 @@ : ^^ `---- - x Number { value: 0.0, raw: "+0", type_flag: Integer } + x Number(NumberToken { value: 0.0, raw: "+0", type_flag: Integer }) ,-[$DIR/tests/recovery/value/number/plus-dot/input.css:1:1] 1 | a { width: +0.; } : ^^ @@ -119,7 +119,7 @@ : ^ `---- - x Delim { value: '.' } + x Delim(DelimToken { value: '.' }) ,-[$DIR/tests/recovery/value/number/plus-dot/input.css:1:1] 1 | a { width: +0.; } : ^ diff --git a/crates/swc_css_parser/tests/recovery/value/percentage/dot/span.swc-stderr b/crates/swc_css_parser/tests/recovery/value/percentage/dot/span.swc-stderr index 1f552c700226..21862819e903 100644 --- a/crates/swc_css_parser/tests/recovery/value/percentage/dot/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/value/percentage/dot/span.swc-stderr @@ -107,7 +107,7 @@ : ^ `---- - x Number { value: 0.0, raw: "0", type_flag: Integer } + x Number(NumberToken { value: 0.0, raw: "0", type_flag: Integer }) ,-[$DIR/tests/recovery/value/percentage/dot/input.css:1:1] 1 | a { width: 0.%; } : ^ @@ -119,7 +119,7 @@ : ^ `---- - x Delim { value: '.' } + x Delim(DelimToken { value: '.' }) ,-[$DIR/tests/recovery/value/percentage/dot/input.css:1:1] 1 | a { width: 0.%; } : ^ @@ -131,7 +131,7 @@ : ^ `---- - x Delim { value: '%' } + x Delim(DelimToken { value: '%' }) ,-[$DIR/tests/recovery/value/percentage/dot/input.css:1:1] 1 | a { width: 0.%; } : ^ diff --git a/crates/swc_css_parser/tests/recovery/value/percentage/minus/span.swc-stderr b/crates/swc_css_parser/tests/recovery/value/percentage/minus/span.swc-stderr index 5312091e9c1e..412dee3880c2 100644 --- a/crates/swc_css_parser/tests/recovery/value/percentage/minus/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/value/percentage/minus/span.swc-stderr @@ -107,7 +107,7 @@ : ^^ `---- - x Number { value: -0.0, raw: "-0", type_flag: Integer } + x Number(NumberToken { value: -0.0, raw: "-0", type_flag: Integer }) ,-[$DIR/tests/recovery/value/percentage/minus/input.css:1:1] 1 | a { width: -0.%; } : ^^ @@ -119,7 +119,7 @@ : ^ `---- - x Delim { value: '.' } + x Delim(DelimToken { value: '.' }) ,-[$DIR/tests/recovery/value/percentage/minus/input.css:1:1] 1 | a { width: -0.%; } : ^ @@ -131,7 +131,7 @@ : ^ `---- - x Delim { value: '%' } + x Delim(DelimToken { value: '%' }) ,-[$DIR/tests/recovery/value/percentage/minus/input.css:1:1] 1 | a { width: -0.%; } : ^ diff --git a/crates/swc_css_parser/tests/recovery/value/percentage/plus/span.swc-stderr b/crates/swc_css_parser/tests/recovery/value/percentage/plus/span.swc-stderr index c9399608a9a2..64a0460b7b48 100644 --- a/crates/swc_css_parser/tests/recovery/value/percentage/plus/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/value/percentage/plus/span.swc-stderr @@ -107,7 +107,7 @@ : ^^ `---- - x Number { value: 0.0, raw: "+0", type_flag: Integer } + x Number(NumberToken { value: 0.0, raw: "+0", type_flag: Integer }) ,-[$DIR/tests/recovery/value/percentage/plus/input.css:1:1] 1 | a { width: +0.%; } : ^^ @@ -119,7 +119,7 @@ : ^ `---- - x Delim { value: '.' } + x Delim(DelimToken { value: '.' }) ,-[$DIR/tests/recovery/value/percentage/plus/input.css:1:1] 1 | a { width: +0.%; } : ^ @@ -131,7 +131,7 @@ : ^ `---- - x Delim { value: '%' } + x Delim(DelimToken { value: '%' }) ,-[$DIR/tests/recovery/value/percentage/plus/input.css:1:1] 1 | a { width: +0.%; } : ^ diff --git a/crates/swc_css_parser/tests/recovery/value/quotes/span.swc-stderr b/crates/swc_css_parser/tests/recovery/value/quotes/span.swc-stderr index cf33f6bda8e0..8d49775fe1f3 100644 --- a/crates/swc_css_parser/tests/recovery/value/quotes/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/value/quotes/span.swc-stderr @@ -156,7 +156,7 @@ 3 | t"; `---- - x BadString { raw: "\"tes" } + x BadString(BadStringToken { raw: "\"tes" }) ,-[$DIR/tests/recovery/value/quotes/input.css:1:1] 1 | p::before { 2 | content: "tes @@ -172,7 +172,7 @@ 4 | } `---- - x WhiteSpace { value: "\n " } + x WhiteSpace(WhiteSpaceToken { value: "\n " }) ,-[$DIR/tests/recovery/value/quotes/input.css:1:1] 1 | p::before { 2 | ,-> content: "tes @@ -188,7 +188,7 @@ 4 | } `---- - x Ident { value: Atom('t' type=inline), raw: "t" } + x Ident(IdentToken { value: Atom('t' type=inline), raw: "t" }) ,-[$DIR/tests/recovery/value/quotes/input.css:2:1] 2 | content: "tes 3 | t"; @@ -204,7 +204,7 @@ 4 | } `---- - x BadString { raw: "\";" } + x BadString(BadStringToken { raw: "\";" }) ,-[$DIR/tests/recovery/value/quotes/input.css:2:1] 2 | content: "tes 3 | t"; diff --git a/crates/swc_css_parser/tests/recovery/value/string/escaped/eof/span.swc-stderr b/crates/swc_css_parser/tests/recovery/value/string/escaped/eof/span.swc-stderr index e9f2ae53a218..2b03f15a38cb 100644 --- a/crates/swc_css_parser/tests/recovery/value/string/escaped/eof/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/value/string/escaped/eof/span.swc-stderr @@ -135,7 +135,7 @@ 3 | ; `---- - x Delim { value: '\\' } + x Delim(DelimToken { value: '\\' }) ,-[$DIR/tests/recovery/value/string/escaped/eof/input.css:1:1] 1 | a { 2 | color: \ diff --git a/crates/swc_css_parser/tests/recovery/value/string/newline/span.swc-stderr b/crates/swc_css_parser/tests/recovery/value/string/newline/span.swc-stderr index 892a68ceb02e..d5a8d958441c 100644 --- a/crates/swc_css_parser/tests/recovery/value/string/newline/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/value/string/newline/span.swc-stderr @@ -121,7 +121,7 @@ : ^ `---- - x BadString { raw: "\"" } + x BadString(BadStringToken { raw: "\"" }) ,-[$DIR/tests/recovery/value/string/newline/input.css:1:1] 1 | a { 2 | prop: " diff --git a/crates/swc_css_parser/tests/recovery/value/url/basic/span.swc-stderr b/crates/swc_css_parser/tests/recovery/value/url/basic/span.swc-stderr index 652dc6aab765..cdc5f4c526fe 100644 --- a/crates/swc_css_parser/tests/recovery/value/url/basic/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/value/url/basic/span.swc-stderr @@ -167,7 +167,7 @@ 3 | background: url(var(--foo)); `---- - x String { value: Atom('http://www.example.com/pinkish.gif' type=dynamic), raw: "\"http://www.example.com/pinkish.gif\"" } + x String(StringToken { value: Atom('http://www.example.com/pinkish.gif' type=dynamic), raw: "\"http://www.example.com/pinkish.gif\"" }) ,-[$DIR/tests/recovery/value/url/basic/input.css:1:1] 1 | div { 2 | --foo: "http://www.example.com/pinkish.gif"; @@ -223,7 +223,7 @@ 4 | background: url(image.png\999999); `---- - x BadUrl { raw: ("url", "var(--foo") } + x BadUrl(BadUrlToken { raw: ("url", "var(--foo") }) ,-[$DIR/tests/recovery/value/url/basic/input.css:2:1] 2 | --foo: "http://www.example.com/pinkish.gif"; 3 | background: url(var(--foo)); @@ -831,7 +831,7 @@ 14 | } `---- - x BadUrl { raw: ("url", "image.png param(var(--url") } + x BadUrl(BadUrlToken { raw: ("url", "image.png param(var(--url") }) ,-[$DIR/tests/recovery/value/url/basic/input.css:12:1] 12 | .foo { 13 | background: url(image.png param(var(--url))); @@ -1023,7 +1023,7 @@ 18 | } `---- - x String { value: Atom('foo' type=inline), raw: "\"foo\"" } + x String(StringToken { value: Atom('foo' type=inline), raw: "\"foo\"" }) ,-[$DIR/tests/recovery/value/url/basic/input.css:16:1] 16 | .style { 17 | background: url("foo", "bar"); @@ -1055,7 +1055,7 @@ 18 | } `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/value/url/basic/input.css:16:1] 16 | .style { 17 | background: url("foo", "bar"); @@ -1071,7 +1071,7 @@ 18 | } `---- - x String { value: Atom('bar' type=inline), raw: "\"bar\"" } + x String(StringToken { value: Atom('bar' type=inline), raw: "\"bar\"" }) ,-[$DIR/tests/recovery/value/url/basic/input.css:16:1] 16 | .style { 17 | background: url("foo", "bar"); diff --git a/crates/swc_css_parser/tests/recovery/value/url/parenthesis/span.swc-stderr b/crates/swc_css_parser/tests/recovery/value/url/parenthesis/span.swc-stderr index e871257cf39f..c5c4ad626294 100644 --- a/crates/swc_css_parser/tests/recovery/value/url/parenthesis/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/value/url/parenthesis/span.swc-stderr @@ -127,7 +127,7 @@ 3 | `-> } `---- - x BadUrl { raw: ("url", "test\\);\n}") } + x BadUrl(BadUrlToken { raw: ("url", "test\\);\n}") }) ,-[$DIR/tests/recovery/value/url/parenthesis/input.css:1:1] 1 | a { 2 | ,-> background: url(test\); diff --git a/crates/swc_css_parser/tests/recovery/vercel/001/span.swc-stderr b/crates/swc_css_parser/tests/recovery/vercel/001/span.swc-stderr index 334cca927c7a..42df901f918f 100644 --- a/crates/swc_css_parser/tests/recovery/vercel/001/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/vercel/001/span.swc-stderr @@ -1033,7 +1033,7 @@ 15 | } `---- - x Ident { value: Atom('__styled-jsx-placeholder__7' type=dynamic), raw: "__styled-jsx-placeholder__7" } + x Ident(IdentToken { value: Atom('__styled-jsx-placeholder__7' type=dynamic), raw: "__styled-jsx-placeholder__7" }) ,-[$DIR/tests/recovery/vercel/001/input.css:13:1] 13 | } 14 | __styled-jsx-placeholder__7 @@ -1049,7 +1049,7 @@ 15 | } `---- - x WhiteSpace { value: "\n" } + x WhiteSpace(WhiteSpaceToken { value: "\n" }) ,-[$DIR/tests/recovery/vercel/001/input.css:13:1] 13 | } 14 | __styled-jsx-placeholder__7 diff --git a/crates/swc_css_parser/tests/recovery/vercel/002/span.swc-stderr b/crates/swc_css_parser/tests/recovery/vercel/002/span.swc-stderr index 4fff597df25d..e6c84e3e5632 100644 --- a/crates/swc_css_parser/tests/recovery/vercel/002/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/vercel/002/span.swc-stderr @@ -312,7 +312,7 @@ 5 | border-radius: 7px; `---- - x Ident { value: Atom('__styled-jsx-placeholder__7vw' type=dynamic), raw: "__styled-jsx-placeholder__7vw" } + x Ident(IdentToken { value: Atom('__styled-jsx-placeholder__7vw' type=dynamic), raw: "__styled-jsx-placeholder__7vw" }) ,-[$DIR/tests/recovery/vercel/002/input.css:3:1] 3 | height: __styled-jsx-placeholder__7px; 4 | margin: 0 calc(__styled-jsx-placeholder__7vw - __styled-jsx-placeholder__7px); @@ -328,7 +328,7 @@ 5 | border-radius: 7px; `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/vercel/002/input.css:3:1] 3 | height: __styled-jsx-placeholder__7px; 4 | margin: 0 calc(__styled-jsx-placeholder__7vw - __styled-jsx-placeholder__7px); @@ -344,7 +344,7 @@ 5 | border-radius: 7px; `---- - x Delim { value: '-' } + x Delim(DelimToken { value: '-' }) ,-[$DIR/tests/recovery/vercel/002/input.css:3:1] 3 | height: __styled-jsx-placeholder__7px; 4 | margin: 0 calc(__styled-jsx-placeholder__7vw - __styled-jsx-placeholder__7px); @@ -360,7 +360,7 @@ 5 | border-radius: 7px; `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/vercel/002/input.css:3:1] 3 | height: __styled-jsx-placeholder__7px; 4 | margin: 0 calc(__styled-jsx-placeholder__7vw - __styled-jsx-placeholder__7px); @@ -376,7 +376,7 @@ 5 | border-radius: 7px; `---- - x Ident { value: Atom('__styled-jsx-placeholder__7px' type=dynamic), raw: "__styled-jsx-placeholder__7px" } + x Ident(IdentToken { value: Atom('__styled-jsx-placeholder__7px' type=dynamic), raw: "__styled-jsx-placeholder__7px" }) ,-[$DIR/tests/recovery/vercel/002/input.css:3:1] 3 | height: __styled-jsx-placeholder__7px; 4 | margin: 0 calc(__styled-jsx-placeholder__7vw - __styled-jsx-placeholder__7px); diff --git a/crates/swc_css_parser/tests/recovery/vercel/003/span.swc-stderr b/crates/swc_css_parser/tests/recovery/vercel/003/span.swc-stderr index 61a010e8c258..1d88885f4207 100644 --- a/crates/swc_css_parser/tests/recovery/vercel/003/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/vercel/003/span.swc-stderr @@ -439,7 +439,7 @@ 8 | padding: __ident__; `---- - x Delim { value: '>' } + x Delim(DelimToken { value: '>' }) ,-[$DIR/tests/recovery/vercel/003/input.css:6:1] 6 | } 7 | .geist-list :global(> .geist-list-item) { @@ -455,7 +455,7 @@ 8 | padding: __ident__; `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/vercel/003/input.css:6:1] 6 | } 7 | .geist-list :global(> .geist-list-item) { @@ -471,7 +471,7 @@ 8 | padding: __ident__; `---- - x Delim { value: '.' } + x Delim(DelimToken { value: '.' }) ,-[$DIR/tests/recovery/vercel/003/input.css:6:1] 6 | } 7 | .geist-list :global(> .geist-list-item) { @@ -487,7 +487,7 @@ 8 | padding: __ident__; `---- - x Ident { value: Atom('geist-list-item' type=dynamic), raw: "geist-list-item" } + x Ident(IdentToken { value: Atom('geist-list-item' type=dynamic), raw: "geist-list-item" }) ,-[$DIR/tests/recovery/vercel/003/input.css:6:1] 6 | } 7 | .geist-list :global(> .geist-list-item) { @@ -674,7 +674,7 @@ 11 | min-width: 0; `---- - x Ident { value: Atom('__ident__' type=dynamic), raw: "__ident__" } + x Ident(IdentToken { value: Atom('__ident__' type=dynamic), raw: "__ident__" }) ,-[$DIR/tests/recovery/vercel/003/input.css:9:1] 9 | flex-grow: 0; 10 | flex-basis: __ident__%; @@ -690,7 +690,7 @@ 11 | min-width: 0; `---- - x Delim { value: '%' } + x Delim(DelimToken { value: '%' }) ,-[$DIR/tests/recovery/vercel/003/input.css:9:1] 9 | flex-grow: 0; 10 | flex-basis: __ident__%; diff --git a/crates/swc_css_parser/tests/recovery/vercel/004/span.swc-stderr b/crates/swc_css_parser/tests/recovery/vercel/004/span.swc-stderr index 806fdfa216e0..69564704dcf6 100644 --- a/crates/swc_css_parser/tests/recovery/vercel/004/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/vercel/004/span.swc-stderr @@ -208,7 +208,7 @@ 4 | border-radius: 7px; `---- - x Ident { value: Atom('__ident__' type=dynamic), raw: "__ident__" } + x Ident(IdentToken { value: Atom('__ident__' type=dynamic), raw: "__ident__" }) ,-[$DIR/tests/recovery/vercel/004/input.css:2:1] 2 | margin: 0; 3 | __ident__ @@ -224,7 +224,7 @@ 5 | color: white; `---- - x WhiteSpace { value: "\n " } + x WhiteSpace(WhiteSpaceToken { value: "\n " }) ,-[$DIR/tests/recovery/vercel/004/input.css:2:1] 2 | margin: 0; 3 | ,-> __ident__ @@ -240,7 +240,7 @@ 5 | color: white; `---- - x Ident { value: Atom('border-radius' type=dynamic), raw: "border-radius" } + x Ident(IdentToken { value: Atom('border-radius' type=dynamic), raw: "border-radius" }) ,-[$DIR/tests/recovery/vercel/004/input.css:3:1] 3 | __ident__ 4 | border-radius: 7px; @@ -272,7 +272,7 @@ 5 | color: white; `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/vercel/004/input.css:3:1] 3 | __ident__ 4 | border-radius: 7px; @@ -288,7 +288,7 @@ 5 | color: white; `---- - x Dimension { value: 7.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("7", "px") } + x Dimension(DimensionToken { value: 7.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("7", "px") }) ,-[$DIR/tests/recovery/vercel/004/input.css:3:1] 3 | __ident__ 4 | border-radius: 7px; @@ -448,7 +448,7 @@ 8 | __ident__ `---- - x Ident { value: Atom('__ident__' type=dynamic), raw: "__ident__" } + x Ident(IdentToken { value: Atom('__ident__' type=dynamic), raw: "__ident__" }) ,-[$DIR/tests/recovery/vercel/004/input.css:6:1] 6 | background: __ident__; 7 | __ident__ @@ -464,7 +464,7 @@ 9 | } `---- - x WhiteSpace { value: "\n " } + x WhiteSpace(WhiteSpaceToken { value: "\n " }) ,-[$DIR/tests/recovery/vercel/004/input.css:6:1] 6 | background: __ident__; 7 | ,-> __ident__ @@ -480,7 +480,7 @@ 9 | } `---- - x Ident { value: Atom('__ident__' type=dynamic), raw: "__ident__" } + x Ident(IdentToken { value: Atom('__ident__' type=dynamic), raw: "__ident__" }) ,-[$DIR/tests/recovery/vercel/004/input.css:7:1] 7 | __ident__ 8 | __ident__ @@ -496,7 +496,7 @@ 9 | } `---- - x WhiteSpace { value: "\n" } + x WhiteSpace(WhiteSpaceToken { value: "\n" }) ,-[$DIR/tests/recovery/vercel/004/input.css:7:1] 7 | __ident__ 8 | __ident__ diff --git a/crates/swc_css_parser/tests/recovery/vercel/005/span.swc-stderr b/crates/swc_css_parser/tests/recovery/vercel/005/span.swc-stderr index 412df528d8f9..de8ee677c23e 100644 --- a/crates/swc_css_parser/tests/recovery/vercel/005/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/vercel/005/span.swc-stderr @@ -136,7 +136,7 @@ 4 | border-radius: 7px; `---- - x Ident { value: Atom('__ident__' type=dynamic), raw: "__ident__" } + x Ident(IdentToken { value: Atom('__ident__' type=dynamic), raw: "__ident__" }) ,-[$DIR/tests/recovery/vercel/005/input.css:2:1] 2 | margin: 0; 3 | __ident__ @@ -152,7 +152,7 @@ 5 | color: white; `---- - x WhiteSpace { value: "\n " } + x WhiteSpace(WhiteSpaceToken { value: "\n " }) ,-[$DIR/tests/recovery/vercel/005/input.css:2:1] 2 | margin: 0; 3 | ,-> __ident__ @@ -168,7 +168,7 @@ 5 | color: white; `---- - x Ident { value: Atom('border-radius' type=dynamic), raw: "border-radius" } + x Ident(IdentToken { value: Atom('border-radius' type=dynamic), raw: "border-radius" }) ,-[$DIR/tests/recovery/vercel/005/input.css:3:1] 3 | __ident__ 4 | border-radius: 7px; @@ -200,7 +200,7 @@ 5 | color: white; `---- - x WhiteSpace { value: " " } + x WhiteSpace(WhiteSpaceToken { value: " " }) ,-[$DIR/tests/recovery/vercel/005/input.css:3:1] 3 | __ident__ 4 | border-radius: 7px; @@ -216,7 +216,7 @@ 5 | color: white; `---- - x Dimension { value: 7.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("7", "px") } + x Dimension(DimensionToken { value: 7.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("7", "px") }) ,-[$DIR/tests/recovery/vercel/005/input.css:3:1] 3 | __ident__ 4 | border-radius: 7px; @@ -352,7 +352,7 @@ 8 | __ident__ `---- - x Ident { value: Atom('__ident__' type=dynamic), raw: "__ident__" } + x Ident(IdentToken { value: Atom('__ident__' type=dynamic), raw: "__ident__" }) ,-[$DIR/tests/recovery/vercel/005/input.css:6:1] 6 | background: __ident__; 7 | __ident__ @@ -368,7 +368,7 @@ 9 | } `---- - x WhiteSpace { value: "\n " } + x WhiteSpace(WhiteSpaceToken { value: "\n " }) ,-[$DIR/tests/recovery/vercel/005/input.css:6:1] 6 | background: __ident__; 7 | ,-> __ident__ @@ -384,7 +384,7 @@ 9 | } `---- - x Ident { value: Atom('__ident__' type=dynamic), raw: "__ident__" } + x Ident(IdentToken { value: Atom('__ident__' type=dynamic), raw: "__ident__" }) ,-[$DIR/tests/recovery/vercel/005/input.css:7:1] 7 | __ident__ 8 | __ident__ @@ -400,7 +400,7 @@ 9 | } `---- - x WhiteSpace { value: "\n" } + x WhiteSpace(WhiteSpaceToken { value: "\n" }) ,-[$DIR/tests/recovery/vercel/005/input.css:7:1] 7 | __ident__ 8 | __ident__ From 0789a5d97de151c5c2215584744d5458e2d81c3f Mon Sep 17 00:00:00 2001 From: "alexander.akait" Date: Mon, 5 Dec 2022 02:08:56 +0300 Subject: [PATCH 29/42] fix: codegen --- crates/swc_css_codegen/src/lib.rs | 72 ++++++++++++------------- crates/swc_css_codegen/tests/fixture.rs | 2 +- 2 files changed, 37 insertions(+), 37 deletions(-) diff --git a/crates/swc_css_codegen/src/lib.rs b/crates/swc_css_codegen/src/lib.rs index 2717a10a6963..1d9281f3c4e4 100644 --- a/crates/swc_css_codegen/src/lib.rs +++ b/crates/swc_css_codegen/src/lib.rs @@ -1956,16 +1956,16 @@ where let span = n.span; match &n.token { - Token::AtKeyword { raw, .. } => { - let mut at_keyword = String::with_capacity(1 + raw.len()); + Token::AtKeyword(token) => { + let mut at_keyword = String::with_capacity(1 + token.raw.len()); at_keyword.push('@'); - at_keyword.push_str(raw); + at_keyword.push_str(&token.raw); write_raw!(self, span, &at_keyword); } - Token::Delim { value } => { - write_raw!(self, span, &value.to_string()); + Token::Delim(token) => { + write_raw!(self, span, &token.value.to_string()); } Token::LParen => { write_raw!(self, span, "("); @@ -1979,58 +1979,58 @@ where Token::RBracket => { write_raw!(self, span, "]"); } - Token::Number { raw, .. } => { - write_raw!(self, span, raw); + Token::Number(token) => { + write_raw!(self, span, &token.raw); } - Token::Percentage { raw, .. } => { - let mut percentage = String::with_capacity(raw.len() + 1); + Token::Percentage(token) => { + let mut percentage = String::with_capacity(token.raw.len() + 1); - percentage.push_str(raw); + percentage.push_str(&token.raw); percentage.push('%'); write_raw!(self, span, &percentage); } - Token::Dimension { raw, .. } => { - let mut dimension = String::with_capacity(raw.0.len() + raw.1.len()); + Token::Dimension(token) => { + let mut dimension = String::with_capacity(token.raw.0.len() + token.raw.1.len()); - dimension.push_str(&raw.0); - dimension.push_str(&raw.1); + dimension.push_str(&token.raw.0); + dimension.push_str(&token.raw.1); write_raw!(self, span, &dimension); } - Token::Ident { raw, .. } => { - write_raw!(self, span, raw); + Token::Ident(token) => { + write_raw!(self, span, &token.raw); } - Token::Function { raw, .. } => { - let mut function = String::with_capacity(raw.len() + 1); + Token::Function(token) => { + let mut function = String::with_capacity(token.raw.len() + 1); - function.push_str(raw); + function.push_str(&token.raw); function.push('('); write_raw!(self, span, &function); } - Token::BadString { raw } => { - write_str!(self, span, raw); + Token::BadString(token) => { + write_str!(self, span, &token.raw); } - Token::String { raw, .. } => { - write_str!(self, span, raw); + Token::String(token) => { + write_str!(self, span, &token.raw); } - Token::Url { raw, .. } => { - let mut url = String::with_capacity(raw.0.len() + raw.1.len() + 2); + Token::Url(token) => { + let mut url = String::with_capacity(token.raw.0.len() + token.raw.1.len() + 2); - url.push_str(&raw.0); + url.push_str(&token.raw.0); url.push('('); - url.push_str(&raw.1); + url.push_str(&token.raw.1); url.push(')'); write_str!(self, span, &url); } - Token::BadUrl { raw, .. } => { - let mut bad_url = String::with_capacity(raw.0.len() + raw.1.len() + 2); + Token::BadUrl(token) => { + let mut bad_url = String::with_capacity(token.raw.0.len() + token.raw.1.len() + 2); - bad_url.push_str(&raw.0); + bad_url.push_str(&token.raw.0); bad_url.push('('); - bad_url.push_str(&raw.1); + bad_url.push_str(&token.raw.1); bad_url.push(')'); write_str!(self, span, &bad_url); @@ -2050,16 +2050,16 @@ where Token::Colon => { write_raw!(self, span, ":"); } - Token::Hash { raw, .. } => { - let mut hash = String::with_capacity(raw.len() + 1); + Token::Hash(token) => { + let mut hash = String::with_capacity(token.raw.len() + 1); hash.push('#'); - hash.push_str(raw); + hash.push_str(&token.raw); write_raw!(self, span, &hash); } - Token::WhiteSpace { value, .. } => { - write_str!(self, span, value); + Token::WhiteSpace(token) => { + write_str!(self, span, &token.value); } Token::CDC => { write_raw!(self, span, "-->"); diff --git a/crates/swc_css_codegen/tests/fixture.rs b/crates/swc_css_codegen/tests/fixture.rs index eeb264a18ef7..58a4596946a4 100644 --- a/crates/swc_css_codegen/tests/fixture.rs +++ b/crates/swc_css_codegen/tests/fixture.rs @@ -382,7 +382,7 @@ impl VisitMut for NormalizeTest { n.visit_mut_children_with(self); if let Token::WhiteSpace { .. } = &n.token { - n.token = Token::WhiteSpace { value: "".into() } + n.token = Token::WhiteSpace(Box::new(WhiteSpaceToken { value: "".into() })) } } From c848e5632dfd6fff8e86820d2d77971ac4308bc7 Mon Sep 17 00:00:00 2001 From: "alexander.akait" Date: Mon, 5 Dec 2022 02:14:40 +0300 Subject: [PATCH 30/42] fix: code --- .../rules/font_family_no_duplicate_names.rs | 4 ++-- .../src/rules/unit_no_unknown.rs | 2 +- crates/swc_css_minifier/src/compressor/mod.rs | 22 ++++++++++++------- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/crates/swc_css_lints/src/rules/font_family_no_duplicate_names.rs b/crates/swc_css_lints/src/rules/font_family_no_duplicate_names.rs index 15c0c9c0b3d9..4f9baebc6ec3 100644 --- a/crates/swc_css_lints/src/rules/font_family_no_duplicate_names.rs +++ b/crates/swc_css_lints/src/rules/font_family_no_duplicate_names.rs @@ -56,8 +56,8 @@ impl FontFamilyNoDuplicateNames { (fonts, Some((value.to_string(), *span))) } } - ComponentValue::Str(str) if str.raw.is_some() => { - fonts.push((FontNameKind::from(str.raw.as_ref().unwrap()), str.span)); + ComponentValue::Str(value) if value.raw.is_some() => { + fonts.push((FontNameKind::from(value.raw.as_ref().unwrap()), value.span)); (fonts, None) } ComponentValue::Delimiter(delimiter) diff --git a/crates/swc_css_lints/src/rules/unit_no_unknown.rs b/crates/swc_css_lints/src/rules/unit_no_unknown.rs index 1d9a909452fd..1dc832834c32 100644 --- a/crates/swc_css_lints/src/rules/unit_no_unknown.rs +++ b/crates/swc_css_lints/src/rules/unit_no_unknown.rs @@ -52,7 +52,7 @@ impl Visit for UnitNoUnknown { fn visit_component_value(&mut self, component_value: &ComponentValue) { if let ComponentValue::PreservedToken( token_and_span @ box TokenAndSpan { - token: Token::Dimension { unit, .. }, + token: Token::Dimension(box DimensionToken { unit, .. }), .. }, ) = component_value diff --git a/crates/swc_css_minifier/src/compressor/mod.rs b/crates/swc_css_minifier/src/compressor/mod.rs index 2515c775ec2a..a95c60892971 100644 --- a/crates/swc_css_minifier/src/compressor/mod.rs +++ b/crates/swc_css_minifier/src/compressor/mod.rs @@ -396,22 +396,28 @@ impl VisitMut for Compressor { if !self.need_utf8_at_rule { match &token_and_span.token { - Token::Ident { value, .. } - | Token::Function { value, .. } - | Token::AtKeyword { value, .. } - | Token::String { value, .. } - | Token::Url { value, .. } + Token::Ident(box IdentToken { value, .. }) + | Token::Function(box FunctionToken { value, .. }) + | Token::AtKeyword(box AtKeywordToken { value, .. }) + | Token::String(box StringToken { value, .. }) + | Token::Url(box UrlToken { value, .. }) if !contains_only_ascii_characters(value) => { self.need_utf8_at_rule = true; } - Token::BadString { raw: value, .. } if !contains_only_ascii_characters(value) => { + Token::BadString(box BadStringToken { raw: value, .. }) + if !contains_only_ascii_characters(value) => + { self.need_utf8_at_rule = true; } - Token::BadUrl { raw: value, .. } if !contains_only_ascii_characters(&value.1) => { + Token::BadUrl(box BadUrlToken { raw: value, .. }) + if !contains_only_ascii_characters(&value.1) => + { self.need_utf8_at_rule = true; } - Token::Dimension { unit: value, .. } if !contains_only_ascii_characters(value) => { + Token::Dimension(box DimensionToken { unit: value, .. }) + if !contains_only_ascii_characters(value) => + { self.need_utf8_at_rule = true; } _ => {} From 9110672af5afd605a61d843f56ec8f3cac9641c2 Mon Sep 17 00:00:00 2001 From: "alexander.akait" Date: Mon, 5 Dec 2022 02:30:19 +0300 Subject: [PATCH 31/42] fix: code --- crates/swc_css_ast/src/token.rs | 52 +++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/crates/swc_css_ast/src/token.rs b/crates/swc_css_ast/src/token.rs index 5b336592e7b3..1c4e04fd77fa 100644 --- a/crates/swc_css_ast/src/token.rs +++ b/crates/swc_css_ast/src/token.rs @@ -36,6 +36,10 @@ pub enum NumberType { } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, EqIgnoreSpan)] +#[cfg_attr( + feature = "rkyv", + derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize) +)] pub struct IdentToken { #[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))] pub value: JsWord, @@ -43,6 +47,10 @@ pub struct IdentToken { } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, EqIgnoreSpan)] +#[cfg_attr( + feature = "rkyv", + derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize) +)] pub struct FunctionToken { #[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))] pub value: JsWord, @@ -50,6 +58,10 @@ pub struct FunctionToken { } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, EqIgnoreSpan)] +#[cfg_attr( + feature = "rkyv", + derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize) +)] pub struct AtKeywordToken { #[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))] pub value: JsWord, @@ -57,6 +69,10 @@ pub struct AtKeywordToken { } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, EqIgnoreSpan)] +#[cfg_attr( + feature = "rkyv", + derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize) +)] pub struct HashToken { pub is_id: bool, #[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))] @@ -65,6 +81,10 @@ pub struct HashToken { } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, EqIgnoreSpan)] +#[cfg_attr( + feature = "rkyv", + derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize) +)] pub struct StringToken { #[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))] pub value: JsWord, @@ -72,12 +92,20 @@ pub struct StringToken { } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, EqIgnoreSpan)] +#[cfg_attr( + feature = "rkyv", + derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize) +)] pub struct BadStringToken { pub raw: Atom, } /// `url(value)` #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, EqIgnoreSpan)] +#[cfg_attr( + feature = "rkyv", + derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize) +)] pub struct UrlToken { #[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))] pub name: JsWord, @@ -88,17 +116,29 @@ pub struct UrlToken { } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, EqIgnoreSpan)] +#[cfg_attr( + feature = "rkyv", + derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize) +)] pub struct BadUrlToken { /// Name and value pub raw: Box<(Atom, Atom)>, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, EqIgnoreSpan)] +#[cfg_attr( + feature = "rkyv", + derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize) +)] pub struct DelimToken { pub value: char, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, EqIgnoreSpan)] +#[cfg_attr( + feature = "rkyv", + derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize) +)] pub struct NumberToken { pub value: f64, pub raw: Atom, @@ -107,12 +147,20 @@ pub struct NumberToken { } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, EqIgnoreSpan)] +#[cfg_attr( + feature = "rkyv", + derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize) +)] pub struct PercentageToken { pub value: f64, pub raw: Atom, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, EqIgnoreSpan)] +#[cfg_attr( + feature = "rkyv", + derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize) +)] pub struct DimensionToken { pub value: f64, #[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))] @@ -124,6 +172,10 @@ pub struct DimensionToken { } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, EqIgnoreSpan)] +#[cfg_attr( + feature = "rkyv", + derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize) +)] pub struct WhiteSpaceToken { pub value: Atom, } From 99e01955f35c8fdefcb78e0e636e372df2fdce2a Mon Sep 17 00:00:00 2001 From: "alexander.akait" Date: Mon, 5 Dec 2022 02:42:57 +0300 Subject: [PATCH 32/42] fix: cargo --- crates/swc_css_ast/src/token.rs | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/crates/swc_css_ast/src/token.rs b/crates/swc_css_ast/src/token.rs index 1c4e04fd77fa..966c212f3faa 100644 --- a/crates/swc_css_ast/src/token.rs +++ b/crates/swc_css_ast/src/token.rs @@ -35,7 +35,7 @@ pub enum NumberType { Number, } -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, EqIgnoreSpan)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, EqIgnoreSpan)] #[cfg_attr( feature = "rkyv", derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize) @@ -46,7 +46,7 @@ pub struct IdentToken { pub raw: Atom, } -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, EqIgnoreSpan)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, EqIgnoreSpan)] #[cfg_attr( feature = "rkyv", derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize) @@ -57,7 +57,7 @@ pub struct FunctionToken { pub raw: Atom, } -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, EqIgnoreSpan)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, EqIgnoreSpan)] #[cfg_attr( feature = "rkyv", derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize) @@ -68,7 +68,7 @@ pub struct AtKeywordToken { pub raw: Atom, } -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, EqIgnoreSpan)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, EqIgnoreSpan)] #[cfg_attr( feature = "rkyv", derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize) @@ -80,7 +80,7 @@ pub struct HashToken { pub raw: Atom, } -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, EqIgnoreSpan)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, EqIgnoreSpan)] #[cfg_attr( feature = "rkyv", derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize) @@ -91,7 +91,7 @@ pub struct StringToken { pub raw: Atom, } -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, EqIgnoreSpan)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, EqIgnoreSpan)] #[cfg_attr( feature = "rkyv", derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize) @@ -101,7 +101,7 @@ pub struct BadStringToken { } /// `url(value)` -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, EqIgnoreSpan)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, EqIgnoreSpan)] #[cfg_attr( feature = "rkyv", derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize) @@ -115,7 +115,7 @@ pub struct UrlToken { pub raw: Box<(Atom, Atom)>, } -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, EqIgnoreSpan)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, EqIgnoreSpan)] #[cfg_attr( feature = "rkyv", derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize) @@ -125,7 +125,7 @@ pub struct BadUrlToken { pub raw: Box<(Atom, Atom)>, } -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, EqIgnoreSpan)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, EqIgnoreSpan)] #[cfg_attr( feature = "rkyv", derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize) @@ -134,7 +134,7 @@ pub struct DelimToken { pub value: char, } -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, EqIgnoreSpan)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, EqIgnoreSpan)] #[cfg_attr( feature = "rkyv", derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize) @@ -146,7 +146,7 @@ pub struct NumberToken { pub type_flag: NumberType, } -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, EqIgnoreSpan)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, EqIgnoreSpan)] #[cfg_attr( feature = "rkyv", derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize) @@ -156,7 +156,7 @@ pub struct PercentageToken { pub raw: Atom, } -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, EqIgnoreSpan)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, EqIgnoreSpan)] #[cfg_attr( feature = "rkyv", derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize) @@ -171,7 +171,7 @@ pub struct DimensionToken { pub raw: Box<(Atom, Atom)>, } -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, EqIgnoreSpan)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, EqIgnoreSpan)] #[cfg_attr( feature = "rkyv", derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize) From a4ed3465610b7250af56cdd666fe115f226bace8 Mon Sep 17 00:00:00 2001 From: "alexander.akait" Date: Mon, 5 Dec 2022 02:51:52 +0300 Subject: [PATCH 33/42] fix: code --- crates/swc_css_ast/src/token.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/swc_css_ast/src/token.rs b/crates/swc_css_ast/src/token.rs index 966c212f3faa..cc5548b3dd78 100644 --- a/crates/swc_css_ast/src/token.rs +++ b/crates/swc_css_ast/src/token.rs @@ -134,7 +134,7 @@ pub struct DelimToken { pub value: char, } -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, EqIgnoreSpan)] +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, EqIgnoreSpan)] #[cfg_attr( feature = "rkyv", derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize) @@ -146,7 +146,7 @@ pub struct NumberToken { pub type_flag: NumberType, } -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, EqIgnoreSpan)] +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, EqIgnoreSpan)] #[cfg_attr( feature = "rkyv", derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize) @@ -156,7 +156,7 @@ pub struct PercentageToken { pub raw: Atom, } -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, EqIgnoreSpan)] +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, EqIgnoreSpan)] #[cfg_attr( feature = "rkyv", derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize) From 5f228b7c7918a0f83337a6a058e3de97a76861a9 Mon Sep 17 00:00:00 2001 From: "alexander.akait" Date: Mon, 5 Dec 2022 03:45:29 +0300 Subject: [PATCH 34/42] refactor: unwrap often whitespace token --- crates/swc_css_ast/src/token.rs | 17 +- crates/swc_css_parser/src/lexer/mod.rs | 6 +- .../fixture/at-rule/container/span.swc-stderr | 10 +- .../fixture/at-rule/media/span.swc-stderr | 18 +- .../fixture/at-rule/supports/span.swc-stderr | 90 ++-- .../fixture/at-rule/unknown/span.swc-stderr | 394 +++++++++--------- .../fixture/dashed-ident/span.swc-stderr | 4 +- .../fixture/function/calc/span.swc-stderr | 4 +- .../selector/pseudo-class/has/span.swc-stderr | 22 +- .../selector/pseudo-class/is/span.swc-stderr | 32 +- .../pseudo-class/unknown/span.swc-stderr | 18 +- .../pseudo-class/where/span.swc-stderr | 12 +- .../pseudo-element/unknown/span.swc-stderr | 18 +- .../tests/fixture/style-block/span.swc-stderr | 36 +- .../styled-jsx/selector/1/span.swc-stderr | 4 +- .../value/custom-property/span.swc-stderr | 50 +-- .../vendor/csstree/basic/span.swc-stderr | 6 +- .../L0mEf41IMkWcP7NotllkAg/span.swc-stderr | 10 +- .../SnMCumHJazvlgOXgmxJ9Jg/span.swc-stderr | 2 +- .../rome/custom-properties/span.swc-stderr | 10 +- .../vendor/rome/selectors/span.swc-stderr | 2 +- .../at-rule/extra-semi/span.swc-stderr | 4 +- .../at-rule/font-face/span.swc-stderr | 10 +- .../at-rule/import/empty/span.swc-stderr | 2 +- .../at-rule/import/indent/span.swc-stderr | 2 +- .../import/invalid-layer/span.swc-stderr | 2 +- .../at-rule/import/no-semi/span.swc-stderr | 6 +- .../at-rule/import/no-url/span.swc-stderr | 4 +- .../at-rule/import/unknown/span.swc-stderr | 10 +- .../keyframes/custom-ident-1/span.swc-stderr | 4 +- .../keyframes/custom-ident-2/span.swc-stderr | 4 +- .../keyframes/custom-ident-3/span.swc-stderr | 4 +- .../keyframes/custom-ident-4/span.swc-stderr | 4 +- .../keyframes/custom-ident/span.swc-stderr | 4 +- .../keyframes/empty-name/span.swc-stderr | 2 +- .../keyframe-broke-and-normal/span.swc-stderr | 2 +- .../span.swc-stderr | 20 +- .../keyframe-keyword/span.swc-stderr | 4 +- .../keyframes/keyframe-number/span.swc-stderr | 2 +- .../at-rule/layer/block/span.swc-stderr | 10 +- .../at-rule/layer/empty/span.swc-stderr | 2 +- .../layer/string-name-block/span.swc-stderr | 4 +- .../string-name-statement/span.swc-stderr | 2 +- .../at-rule/media/condition-1/span.swc-stderr | 18 +- .../media/condition-and-or/span.swc-stderr | 16 +- .../at-rule/media/condition/span.swc-stderr | 12 +- .../media/feature-name-1/span.swc-stderr | 6 +- .../media/feature-name-2/span.swc-stderr | 4 +- .../media/feature-name/span.swc-stderr | 6 +- .../media/feature-range-2/span.swc-stderr | 12 +- .../media/feature-range-3/span.swc-stderr | 16 +- .../media/feature-range-4/span.swc-stderr | 12 +- .../media/feature-range-5/span.swc-stderr | 12 +- .../media/feature-range-6/span.swc-stderr | 12 +- .../at-rule/media/feature/span.swc-stderr | 6 +- .../media/invalid-nesting/span.swc-stderr | 4 +- .../at-rule/media/media-type/span.swc-stderr | 6 +- .../media/wrong-stylesheet/span.swc-stderr | 6 +- .../page/invalid-pseudo/span.swc-stderr | 4 +- .../at-rule/page/no-space/span.swc-stderr | 6 +- .../at-rule/page/without-page/span.swc-stderr | 12 +- .../supports/empty-in-parens/span.swc-stderr | 6 +- .../supports/no-parens/span.swc-stderr | 6 +- .../non-standard-prelude/span.swc-stderr | 44 +- .../supports/wrong-or-and/span.swc-stderr | 18 +- .../recovery/cdo-and-cdc/span.swc-stderr | 34 +- .../comments/bad-comment-1/span.swc-stderr | 2 +- .../comments/declaration/span.swc-stderr | 6 +- .../declaration/bad-value-1/span.swc-stderr | 2 +- .../declaration/bad-value-2/span.swc-stderr | 2 +- .../declaration/bad-value/span.swc-stderr | 12 +- .../declaration/important-1/span.swc-stderr | 2 +- .../declaration/important/span.swc-stderr | 42 +- .../declaration/wrong-name/span.swc-stderr | 2 +- .../delim-token/at-sign/span.swc-stderr | 2 +- .../delim-token/minus/span.swc-stderr | 8 +- .../recovery/delim-token/plus/span.swc-stderr | 8 +- .../escaped/id-selector/span.swc-stderr | 2 +- .../recovery/function/base/span.swc-stderr | 14 +- .../function/nested-unclosed/span.swc-stderr | 2 +- .../recovery/function/rgb/span.swc-stderr | 38 +- .../function/unclosed-2/span.swc-stderr | 8 +- .../function/unclosed/span.swc-stderr | 4 +- .../tests/recovery/hacks/span.swc-stderr | 70 ++-- .../tests/recovery/ie-progid/span.swc-stderr | 2 +- .../tests/recovery/number/span.swc-stderr | 12 +- .../qualified-rule/basic/span.swc-stderr | 6 +- .../double-slash-comment/span.swc-stderr | 6 +- .../rules/at-rule-in-middle/span.swc-stderr | 4 +- .../rules/at-rule-with-semi/span.swc-stderr | 4 +- .../rules/unclosed-brackets/span.swc-stderr | 24 +- .../rules/unclosed-curly/span.swc-stderr | 4 +- .../invalid-matcher-1/span.swc-stderr | 2 +- .../invalid-matcher-2/span.swc-stderr | 2 +- .../invalid-matcher-3/span.swc-stderr | 12 +- .../invalid-matcher-4/span.swc-stderr | 2 +- .../attribute/invalid-matcher/span.swc-stderr | 2 +- .../invalid-modifier/span.swc-stderr | 4 +- .../attribute/unclosed/span.swc-stderr | 6 +- .../selector/combinator/only/span.swc-stderr | 2 +- .../selector/combinator/two/span.swc-stderr | 6 +- .../selector/id/invalid/span.swc-stderr | 2 +- .../recovery/selector/list/span.swc-stderr | 2 +- .../invalid-function/span.swc-stderr | 4 +- .../invalid-ident/span.swc-stderr | 4 +- .../pseudo-class/invalid/span.swc-stderr | 8 +- .../pseudo-element/after/span.swc-stderr | 4 +- .../pseudo-element/between/span.swc-stderr | 4 +- .../pseudo-element/invalid/span.swc-stderr | 2 +- .../basic/span.swc-stderr | 14 +- .../invalid-nested-1/span.swc-stderr | 10 +- .../invalid-nested-2/span.swc-stderr | 2 +- .../invalid-nested/span.swc-stderr | 2 +- .../recovery/styled-jsx/1/span.swc-stderr | 6 +- .../recovery/styled-jsx/2/span.swc-stderr | 2 +- .../only-dashed/span.swc-stderr | 4 +- .../recovery/value/quotes/span.swc-stderr | 2 +- .../recovery/value/url/basic/span.swc-stderr | 2 +- .../tests/recovery/vercel/001/span.swc-stderr | 2 +- .../tests/recovery/vercel/002/span.swc-stderr | 4 +- .../tests/recovery/vercel/003/span.swc-stderr | 2 +- .../tests/recovery/vercel/004/span.swc-stderr | 8 +- .../tests/recovery/vercel/005/span.swc-stderr | 8 +- 123 files changed, 784 insertions(+), 791 deletions(-) diff --git a/crates/swc_css_ast/src/token.rs b/crates/swc_css_ast/src/token.rs index cc5548b3dd78..d2a792dc6ea8 100644 --- a/crates/swc_css_ast/src/token.rs +++ b/crates/swc_css_ast/src/token.rs @@ -171,15 +171,6 @@ pub struct DimensionToken { pub raw: Box<(Atom, Atom)>, } -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, EqIgnoreSpan)] -#[cfg_attr( - feature = "rkyv", - derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize) -)] -pub struct WhiteSpaceToken { - pub value: Atom, -} - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, EqIgnoreSpan)] #[cfg_attr( feature = "rkyv", @@ -210,7 +201,9 @@ pub enum Token { Percentage(Box), Dimension(Box), /// One or more whitespace. - WhiteSpace(Box), + WhiteSpace { + value: Atom, + }, /// `` @@ -304,8 +297,8 @@ impl Hash for Token { dimension.type_flag.hash(state); dimension.raw.hash(state); } - Token::WhiteSpace(white_space) => { - white_space.value.hash(state); + Token::WhiteSpace { value, .. } => { + value.hash(state); } Token::CDO | Token::CDC diff --git a/crates/swc_css_parser/src/lexer/mod.rs b/crates/swc_css_parser/src/lexer/mod.rs index 3db1e93d65ee..dc13cb275ad8 100644 --- a/crates/swc_css_parser/src/lexer/mod.rs +++ b/crates/swc_css_parser/src/lexer/mod.rs @@ -5,7 +5,7 @@ use swc_common::{input::Input, BytePos, Span}; use swc_css_ast::{ AtKeywordToken, BadStringToken, BadUrlToken, DelimToken, DimensionToken, FunctionToken, HashToken, IdentToken, NumberToken, NumberType, PercentageToken, StringToken, Token, - TokenAndSpan, WhiteSpaceToken, + TokenAndSpan, }; use crate::{ @@ -257,9 +257,9 @@ where } } - return Ok(Token::WhiteSpace(Box::new(WhiteSpaceToken { + return Ok(Token::WhiteSpace { value: (&**buf).into(), - }))); + }); }), // U+0022 QUOTATION MARK (") // Consume a string token and return it. diff --git a/crates/swc_css_parser/tests/fixture/at-rule/container/span.swc-stderr b/crates/swc_css_parser/tests/fixture/at-rule/container/span.swc-stderr index 81ab1eb0382f..a8a2d0fd85fa 100644 --- a/crates/swc_css_parser/tests/fixture/at-rule/container/span.swc-stderr +++ b/crates/swc_css_parser/tests/fixture/at-rule/container/span.swc-stderr @@ -2252,7 +2252,7 @@ 43 | .card { margin-block: 2em; } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/container/input.css:41:1] 41 | 42 | @container card (inline-size > 30em) and style(--responsive: true) { @@ -2604,7 +2604,7 @@ 47 | .card { margin-block: 2em; } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/container/input.css:45:1] 45 | 46 | @container card (inline-size > 30em) or style(--responsive: true) { @@ -7434,7 +7434,7 @@ 114 | #inner { `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/container/input.css:112:1] 112 | 113 | @container test style(--responsive: true) { @@ -7716,7 +7716,7 @@ 120 | #inner { `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/container/input.css:118:1] 118 | 119 | @container style(--responsive: true) { @@ -8119,7 +8119,7 @@ 127 | #inner { `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/container/input.css:125:1] 125 | @container card (inline-size > 30em) { 126 | @container style(--responsive: true) { diff --git a/crates/swc_css_parser/tests/fixture/at-rule/media/span.swc-stderr b/crates/swc_css_parser/tests/fixture/at-rule/media/span.swc-stderr index c4cc4d0a99e1..f6819022ba15 100644 --- a/crates/swc_css_parser/tests/fixture/at-rule/media/span.swc-stderr +++ b/crates/swc_css_parser/tests/fixture/at-rule/media/span.swc-stderr @@ -21379,7 +21379,7 @@ 143 | @media (height foo bar) {} `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/media/input.css:141:1] 141 | 142 | @media (height << 600px) {} @@ -21427,7 +21427,7 @@ 143 | @media (height foo bar) {} `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/media/input.css:141:1] 141 | 142 | @media (height << 600px) {} @@ -21579,7 +21579,7 @@ 144 | @media (height foo("bar")) {} `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/media/input.css:142:1] 142 | @media (height << 600px) {} 143 | @media (height foo bar) {} @@ -21611,7 +21611,7 @@ 144 | @media (height foo("bar")) {} `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/media/input.css:142:1] 142 | @media (height << 600px) {} 143 | @media (height foo bar) {} @@ -21763,7 +21763,7 @@ 145 | @media (height + 600px) {} `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/media/input.css:143:1] 143 | @media (height foo bar) {} 144 | @media (height foo("bar")) {} @@ -21939,7 +21939,7 @@ 146 | @media screen and (min-width: ) {} `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/media/input.css:144:1] 144 | @media (height foo("bar")) {} 145 | @media (height + 600px) {} @@ -21971,7 +21971,7 @@ 146 | @media screen and (min-width: ) {} `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/media/input.css:144:1] 144 | @media (height foo("bar")) {} 145 | @media (height + 600px) {} @@ -22163,7 +22163,7 @@ 147 | @media (aspect-ratio: 12/) {} `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/media/input.css:145:1] 145 | @media (height + 600px) {} 146 | @media screen and (min-width: ) {} @@ -22315,7 +22315,7 @@ 148 | @media func(100px) {} `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/media/input.css:146:1] 146 | @media screen and (min-width: ) {} 147 | @media (aspect-ratio: 12/) {} diff --git a/crates/swc_css_parser/tests/fixture/at-rule/supports/span.swc-stderr b/crates/swc_css_parser/tests/fixture/at-rule/supports/span.swc-stderr index 94edf2aa0b60..9451e3e3a211 100644 --- a/crates/swc_css_parser/tests/fixture/at-rule/supports/span.swc-stderr +++ b/crates/swc_css_parser/tests/fixture/at-rule/supports/span.swc-stderr @@ -7256,7 +7256,7 @@ 66 | * { background: red; } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/supports/input.css:64:1] 64 | 65 | @supports (ident "str") { @@ -7536,7 +7536,7 @@ 70 | * { background: red; } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/supports/input.css:68:1] 68 | 69 | @supports ((ident "str")) { @@ -7824,7 +7824,7 @@ 74 | * { background: red; } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/supports/input.css:72:1] 72 | 73 | @supports func(10, 20, 40) { @@ -7872,7 +7872,7 @@ 74 | * { background: red; } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/supports/input.css:72:1] 72 | 73 | @supports func(10, 20, 40) { @@ -8168,7 +8168,7 @@ 78 | * { background: red; } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/supports/input.css:76:1] 76 | 77 | @supports (func(10, 20, 40)) { @@ -8216,7 +8216,7 @@ 78 | * { background: red; } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/supports/input.css:76:1] 76 | 77 | @supports (func(10, 20, 40)) { @@ -8480,7 +8480,7 @@ 82 | * { background: red; } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/supports/input.css:80:1] 80 | 81 | @supports ( func( 10 , 20 , 40 ) ) { @@ -8512,7 +8512,7 @@ 82 | * { background: red; } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/supports/input.css:80:1] 80 | 81 | @supports ( func( 10 , 20 , 40 ) ) { @@ -8544,7 +8544,7 @@ 82 | * { background: red; } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/supports/input.css:80:1] 80 | 81 | @supports ( func( 10 , 20 , 40 ) ) { @@ -8576,7 +8576,7 @@ 82 | * { background: red; } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/supports/input.css:80:1] 80 | 81 | @supports ( func( 10 , 20 , 40 ) ) { @@ -8608,7 +8608,7 @@ 82 | * { background: red; } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/supports/input.css:80:1] 80 | 81 | @supports ( func( 10 , 20 , 40 ) ) { @@ -8640,7 +8640,7 @@ 82 | * { background: red; } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/supports/input.css:80:1] 80 | 81 | @supports ( func( 10 , 20 , 40 ) ) { @@ -9007,7 +9007,7 @@ 87 | from { `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/supports/input.css:85:1] 85 | @supports (animation-name: test) { 86 | @-custom-keyframe anim { @@ -9039,7 +9039,7 @@ 87 | from { `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/supports/input.css:85:1] 85 | @supports (animation-name: test) { 86 | @-custom-keyframe anim { @@ -9077,7 +9077,7 @@ 88 | color: black; `---- - x WhiteSpace(WhiteSpaceToken { value: "\n " }) + x WhiteSpace { value: "\n " } ,-[$DIR/tests/fixture/at-rule/supports/input.css:85:1] 85 | @supports (animation-name: test) { 86 | ,-> @-custom-keyframe anim { @@ -9109,7 +9109,7 @@ 88 | color: black; `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/supports/input.css:86:1] 86 | @-custom-keyframe anim { 87 | from { @@ -9151,7 +9151,7 @@ 89 | } `---- - x WhiteSpace(WhiteSpaceToken { value: "\n " }) + x WhiteSpace { value: "\n " } ,-[$DIR/tests/fixture/at-rule/supports/input.css:86:1] 86 | @-custom-keyframe anim { 87 | ,-> from { @@ -9199,7 +9199,7 @@ 89 | } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/supports/input.css:87:1] 87 | from { 88 | color: black; @@ -9247,7 +9247,7 @@ 90 | to { `---- - x WhiteSpace(WhiteSpaceToken { value: "\n " }) + x WhiteSpace { value: "\n " } ,-[$DIR/tests/fixture/at-rule/supports/input.css:87:1] 87 | from { 88 | ,-> color: black; @@ -9263,7 +9263,7 @@ 91 | color: white `---- - x WhiteSpace(WhiteSpaceToken { value: "\n " }) + x WhiteSpace { value: "\n " } ,-[$DIR/tests/fixture/at-rule/supports/input.css:88:1] 88 | color: black; 89 | ,-> } @@ -9295,7 +9295,7 @@ 91 | color: white `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/supports/input.css:89:1] 89 | } 90 | to { @@ -9337,7 +9337,7 @@ 92 | } `---- - x WhiteSpace(WhiteSpaceToken { value: "\n " }) + x WhiteSpace { value: "\n " } ,-[$DIR/tests/fixture/at-rule/supports/input.css:89:1] 89 | } 90 | ,-> to { @@ -9385,7 +9385,7 @@ 92 | } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/supports/input.css:90:1] 90 | to { 91 | color: white @@ -9417,7 +9417,7 @@ 93 | } `---- - x WhiteSpace(WhiteSpaceToken { value: "\n " }) + x WhiteSpace { value: "\n " } ,-[$DIR/tests/fixture/at-rule/supports/input.css:90:1] 90 | to { 91 | ,-> color: white @@ -9433,7 +9433,7 @@ 94 | } `---- - x WhiteSpace(WhiteSpaceToken { value: "\n " }) + x WhiteSpace { value: "\n " } ,-[$DIR/tests/fixture/at-rule/supports/input.css:91:1] 91 | color: white 92 | ,-> } @@ -11608,7 +11608,7 @@ 124 | from { `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/supports/input.css:122:1] 122 | @supports (animation-name: test) { 123 | @-custom-keyframe anim { @@ -11640,7 +11640,7 @@ 124 | from { `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/supports/input.css:122:1] 122 | @supports (animation-name: test) { 123 | @-custom-keyframe anim { @@ -11678,7 +11678,7 @@ 125 | color: black; `---- - x WhiteSpace(WhiteSpaceToken { value: "\n " }) + x WhiteSpace { value: "\n " } ,-[$DIR/tests/fixture/at-rule/supports/input.css:122:1] 122 | @supports (animation-name: test) { 123 | ,-> @-custom-keyframe anim { @@ -11710,7 +11710,7 @@ 125 | color: black; `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/supports/input.css:123:1] 123 | @-custom-keyframe anim { 124 | from { @@ -11752,7 +11752,7 @@ 126 | } `---- - x WhiteSpace(WhiteSpaceToken { value: "\n " }) + x WhiteSpace { value: "\n " } ,-[$DIR/tests/fixture/at-rule/supports/input.css:123:1] 123 | @-custom-keyframe anim { 124 | ,-> from { @@ -11800,7 +11800,7 @@ 126 | } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/supports/input.css:124:1] 124 | from { 125 | color: black; @@ -11848,7 +11848,7 @@ 127 | to { `---- - x WhiteSpace(WhiteSpaceToken { value: "\n " }) + x WhiteSpace { value: "\n " } ,-[$DIR/tests/fixture/at-rule/supports/input.css:124:1] 124 | from { 125 | ,-> color: black; @@ -11864,7 +11864,7 @@ 128 | color: white `---- - x WhiteSpace(WhiteSpaceToken { value: "\n " }) + x WhiteSpace { value: "\n " } ,-[$DIR/tests/fixture/at-rule/supports/input.css:125:1] 125 | color: black; 126 | ,-> } @@ -11896,7 +11896,7 @@ 128 | color: white `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/supports/input.css:126:1] 126 | } 127 | to { @@ -11938,7 +11938,7 @@ 129 | } `---- - x WhiteSpace(WhiteSpaceToken { value: "\n " }) + x WhiteSpace { value: "\n " } ,-[$DIR/tests/fixture/at-rule/supports/input.css:126:1] 126 | } 127 | ,-> to { @@ -11986,7 +11986,7 @@ 129 | } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/supports/input.css:127:1] 127 | to { 128 | color: white @@ -12018,7 +12018,7 @@ 130 | } `---- - x WhiteSpace(WhiteSpaceToken { value: "\n " }) + x WhiteSpace { value: "\n " } ,-[$DIR/tests/fixture/at-rule/supports/input.css:127:1] 127 | to { 128 | ,-> color: white @@ -12034,7 +12034,7 @@ 131 | } `---- - x WhiteSpace(WhiteSpaceToken { value: "\n " }) + x WhiteSpace { value: "\n " } ,-[$DIR/tests/fixture/at-rule/supports/input.css:128:1] 128 | color: white 129 | ,-> } @@ -12942,7 +12942,7 @@ 146 | * { background: red; } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/supports/input.css:144:1] 144 | 145 | @supports (func("example": 1)) { @@ -13920,7 +13920,7 @@ 160 | * { background: red; } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/supports/input.css:158:1] 158 | 159 | @supports ( func("example": 1) ) { @@ -14176,7 +14176,7 @@ 164 | * { background: red; } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/supports/input.css:162:1] 162 | 163 | @supports ( --var ) { @@ -14208,7 +14208,7 @@ 164 | * { background: red; } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/supports/input.css:162:1] 162 | 163 | @supports ( --var ) { @@ -14448,7 +14448,7 @@ 168 | * { background: red; } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/supports/input.css:166:1] 166 | 167 | @supports ( --var "test" ) { @@ -14480,7 +14480,7 @@ 168 | * { background: red; } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/supports/input.css:166:1] 166 | 167 | @supports ( --var "test" ) { @@ -14512,7 +14512,7 @@ 168 | * { background: red; } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/supports/input.css:166:1] 166 | 167 | @supports ( --var "test" ) { diff --git a/crates/swc_css_parser/tests/fixture/at-rule/unknown/span.swc-stderr b/crates/swc_css_parser/tests/fixture/at-rule/unknown/span.swc-stderr index ada307362210..535183eaccfd 100644 --- a/crates/swc_css_parser/tests/fixture/at-rule/unknown/span.swc-stderr +++ b/crates/swc_css_parser/tests/fixture/at-rule/unknown/span.swc-stderr @@ -136,7 +136,7 @@ 3 | @unknown "blah"; `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:1:1] 1 | @unknown; 2 | @unknown x y; @@ -168,7 +168,7 @@ 3 | @unknown "blah"; `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:1:1] 1 | @unknown; 2 | @unknown x y; @@ -232,7 +232,7 @@ 4 | @unknown \"blah\"; `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:2:1] 2 | @unknown x y; 3 | @unknown "blah"; @@ -296,7 +296,7 @@ 5 | @unknown /*test*/; `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:3:1] 3 | @unknown "blah"; 4 | @unknown \"blah\"; @@ -360,7 +360,7 @@ 6 | @unknown /*test*/x/*test*/ y; `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:4:1] 4 | @unknown \"blah\"; 5 | @unknown /*test*/; @@ -408,7 +408,7 @@ 7 | @unknown ; `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:5:1] 5 | @unknown /*test*/; 6 | @unknown /*test*/x/*test*/ y; @@ -440,7 +440,7 @@ 7 | @unknown ; `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:5:1] 5 | @unknown /*test*/; 6 | @unknown /*test*/x/*test*/ y; @@ -504,7 +504,7 @@ 8 | @unknown x y; `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:6:1] 6 | @unknown /*test*/x/*test*/ y; 7 | @unknown ; @@ -547,7 +547,7 @@ : ^^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:7:1] 7 | @unknown ; 8 | @unknown x y; @@ -575,7 +575,7 @@ : ^^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:7:1] 7 | @unknown ; 8 | @unknown x y; @@ -636,7 +636,7 @@ 11 | @\unknown {} `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:9:1] 9 | 10 | @unknown {} @@ -700,7 +700,7 @@ 12 | @unknown a b {} `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:10:1] 10 | @unknown {} 11 | @\unknown {} @@ -764,7 +764,7 @@ 13 | @unknown {p:v} `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:11:1] 11 | @\unknown {} 12 | @unknown a b {} @@ -796,7 +796,7 @@ 13 | @unknown {p:v} `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:11:1] 11 | @\unknown {} 12 | @unknown a b {} @@ -828,7 +828,7 @@ 13 | @unknown {p:v} `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:11:1] 11 | @\unknown {} 12 | @unknown a b {} @@ -892,7 +892,7 @@ 14 | @unknown x y {p:v} `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:12:1] 12 | @unknown a b {} 13 | @unknown {p:v} @@ -1004,7 +1004,7 @@ 15 | @unknown x, y x(1) {p:v} `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:13:1] 13 | @unknown {p:v} 14 | @unknown x y {p:v} @@ -1036,7 +1036,7 @@ 15 | @unknown x, y x(1) {p:v} `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:13:1] 13 | @unknown {p:v} 14 | @unknown x y {p:v} @@ -1068,7 +1068,7 @@ 15 | @unknown x, y x(1) {p:v} `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:13:1] 13 | @unknown {p:v} 14 | @unknown x y {p:v} @@ -1180,7 +1180,7 @@ 16 | @unknown x, y x(1+2) {p:v} `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:14:1] 14 | @unknown x y {p:v} 15 | @unknown x, y x(1) {p:v} @@ -1228,7 +1228,7 @@ 16 | @unknown x, y x(1+2) {p:v} `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:14:1] 14 | @unknown x y {p:v} 15 | @unknown x, y x(1) {p:v} @@ -1260,7 +1260,7 @@ 16 | @unknown x, y x(1+2) {p:v} `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:14:1] 14 | @unknown x y {p:v} 15 | @unknown x, y x(1) {p:v} @@ -1316,7 +1316,7 @@ 16 | @unknown x, y x(1+2) {p:v} `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:14:1] 14 | @unknown x y {p:v} 15 | @unknown x, y x(1) {p:v} @@ -1428,7 +1428,7 @@ 17 | @unknown/*test*/{/*test*/p/*test*/:/*test*/v/*test*/} `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:15:1] 15 | @unknown x, y x(1) {p:v} 16 | @unknown x, y x(1+2) {p:v} @@ -1476,7 +1476,7 @@ 17 | @unknown/*test*/{/*test*/p/*test*/:/*test*/v/*test*/} `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:15:1] 15 | @unknown x, y x(1) {p:v} 16 | @unknown x, y x(1+2) {p:v} @@ -1508,7 +1508,7 @@ 17 | @unknown/*test*/{/*test*/p/*test*/:/*test*/v/*test*/} `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:15:1] 15 | @unknown x, y x(1) {p:v} 16 | @unknown x, y x(1+2) {p:v} @@ -1580,7 +1580,7 @@ 17 | @unknown/*test*/{/*test*/p/*test*/:/*test*/v/*test*/} `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:15:1] 15 | @unknown x, y x(1) {p:v} 16 | @unknown x, y x(1+2) {p:v} @@ -1788,7 +1788,7 @@ 19 | /*@unknown !*test*!x!*test*!,!*test*!y!*test*! x(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}*/ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:17:1] 17 | @unknown/*test*/{/*test*/p/*test*/:/*test*/v/*test*/} 18 | @unknown /*test*/x/*test*/ y/*test*/{/*test*/p/*test*/:/*test*/v/*test*/} @@ -1820,7 +1820,7 @@ 19 | /*@unknown !*test*!x!*test*!,!*test*!y!*test*! x(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}*/ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:17:1] 17 | @unknown/*test*/{/*test*/p/*test*/:/*test*/v/*test*/} 18 | @unknown /*test*/x/*test*/ y/*test*/{/*test*/p/*test*/:/*test*/v/*test*/} @@ -1948,7 +1948,7 @@ 21 | @unknown x y { p : v } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:19:1] 19 | /*@unknown !*test*!x!*test*!,!*test*!y!*test*! x(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}*/ 20 | @unknown { p : v } @@ -1980,7 +1980,7 @@ 21 | @unknown x y { p : v } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:19:1] 19 | /*@unknown !*test*!x!*test*!,!*test*!y!*test*! x(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}*/ 20 | @unknown { p : v } @@ -2012,7 +2012,7 @@ 21 | @unknown x y { p : v } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:19:1] 19 | /*@unknown !*test*!x!*test*!,!*test*!y!*test*! x(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}*/ 20 | @unknown { p : v } @@ -2044,7 +2044,7 @@ 21 | @unknown x y { p : v } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:19:1] 19 | /*@unknown !*test*!x!*test*!,!*test*!y!*test*! x(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}*/ 20 | @unknown { p : v } @@ -2076,7 +2076,7 @@ 21 | @unknown x y { p : v } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:19:1] 19 | /*@unknown !*test*!x!*test*!,!*test*!y!*test*! x(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}*/ 20 | @unknown { p : v } @@ -2124,7 +2124,7 @@ 22 | @unknown x , y x( 1 + 2 ) { p : v } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:20:1] 20 | @unknown { p : v } 21 | @unknown x y { p : v } @@ -2156,7 +2156,7 @@ 22 | @unknown x , y x( 1 + 2 ) { p : v } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:20:1] 20 | @unknown { p : v } 21 | @unknown x y { p : v } @@ -2188,7 +2188,7 @@ 22 | @unknown x , y x( 1 + 2 ) { p : v } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:20:1] 20 | @unknown { p : v } 21 | @unknown x y { p : v } @@ -2220,7 +2220,7 @@ 22 | @unknown x , y x( 1 + 2 ) { p : v } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:20:1] 20 | @unknown { p : v } 21 | @unknown x y { p : v } @@ -2252,7 +2252,7 @@ 22 | @unknown x , y x( 1 + 2 ) { p : v } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:20:1] 20 | @unknown { p : v } 21 | @unknown x y { p : v } @@ -2284,7 +2284,7 @@ 22 | @unknown x , y x( 1 + 2 ) { p : v } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:20:1] 20 | @unknown { p : v } 21 | @unknown x y { p : v } @@ -2316,7 +2316,7 @@ 22 | @unknown x , y x( 1 + 2 ) { p : v } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:20:1] 20 | @unknown { p : v } 21 | @unknown x y { p : v } @@ -2359,7 +2359,7 @@ : ^^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:21:1] 21 | @unknown x y { p : v } 22 | @unknown x , y x( 1 + 2 ) { p : v } @@ -2387,7 +2387,7 @@ : ^^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:21:1] 21 | @unknown x y { p : v } 22 | @unknown x , y x( 1 + 2 ) { p : v } @@ -2415,7 +2415,7 @@ : ^^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:21:1] 21 | @unknown x y { p : v } 22 | @unknown x , y x( 1 + 2 ) { p : v } @@ -2443,7 +2443,7 @@ : ^^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:21:1] 21 | @unknown x y { p : v } 22 | @unknown x , y x( 1 + 2 ) { p : v } @@ -2478,7 +2478,7 @@ : ^^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:21:1] 21 | @unknown x y { p : v } 22 | @unknown x , y x( 1 + 2 ) { p : v } @@ -2506,7 +2506,7 @@ : ^^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:21:1] 21 | @unknown x y { p : v } 22 | @unknown x , y x( 1 + 2 ) { p : v } @@ -2534,7 +2534,7 @@ : ^^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:21:1] 21 | @unknown x y { p : v } 22 | @unknown x , y x( 1 + 2 ) { p : v } @@ -2562,7 +2562,7 @@ : ^^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:21:1] 21 | @unknown x y { p : v } 22 | @unknown x , y x( 1 + 2 ) { p : v } @@ -2576,7 +2576,7 @@ : ^^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:21:1] 21 | @unknown x y { p : v } 22 | @unknown x , y x( 1 + 2 ) { p : v } @@ -2604,7 +2604,7 @@ : ^^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:21:1] 21 | @unknown x y { p : v } 22 | @unknown x , y x( 1 + 2 ) { p : v } @@ -2632,7 +2632,7 @@ : ^^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:21:1] 21 | @unknown x y { p : v } 22 | @unknown x , y x( 1 + 2 ) { p : v } @@ -2660,7 +2660,7 @@ : ^^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:21:1] 21 | @unknown x y { p : v } 22 | @unknown x , y x( 1 + 2 ) { p : v } @@ -2688,7 +2688,7 @@ : ^^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:21:1] 21 | @unknown x y { p : v } 22 | @unknown x , y x( 1 + 2 ) { p : v } @@ -2735,7 +2735,7 @@ 25 | @unknown x y {s{p:v}} `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:23:1] 23 | 24 | @unknown {s{p:v}} @@ -2887,7 +2887,7 @@ 26 | @unknown x, y f(1) {s{p:v}} `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:24:1] 24 | @unknown {s{p:v}} 25 | @unknown x y {s{p:v}} @@ -2919,7 +2919,7 @@ 26 | @unknown x, y f(1) {s{p:v}} `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:24:1] 24 | @unknown {s{p:v}} 25 | @unknown x y {s{p:v}} @@ -2951,7 +2951,7 @@ 26 | @unknown x, y f(1) {s{p:v}} `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:24:1] 24 | @unknown {s{p:v}} 25 | @unknown x y {s{p:v}} @@ -3103,7 +3103,7 @@ 27 | @unknown x, y f(1+2) {s{p:v}} `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:25:1] 25 | @unknown x y {s{p:v}} 26 | @unknown x, y f(1) {s{p:v}} @@ -3151,7 +3151,7 @@ 27 | @unknown x, y f(1+2) {s{p:v}} `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:25:1] 25 | @unknown x y {s{p:v}} 26 | @unknown x, y f(1) {s{p:v}} @@ -3183,7 +3183,7 @@ 27 | @unknown x, y f(1+2) {s{p:v}} `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:25:1] 25 | @unknown x y {s{p:v}} 26 | @unknown x, y f(1) {s{p:v}} @@ -3239,7 +3239,7 @@ 27 | @unknown x, y f(1+2) {s{p:v}} `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:25:1] 25 | @unknown x y {s{p:v}} 26 | @unknown x, y f(1) {s{p:v}} @@ -3391,7 +3391,7 @@ 28 | @unknown { .a { p: v; } .b { p: v } } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:26:1] 26 | @unknown x, y f(1) {s{p:v}} 27 | @unknown x, y f(1+2) {s{p:v}} @@ -3439,7 +3439,7 @@ 28 | @unknown { .a { p: v; } .b { p: v } } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:26:1] 26 | @unknown x, y f(1) {s{p:v}} 27 | @unknown x, y f(1+2) {s{p:v}} @@ -3471,7 +3471,7 @@ 28 | @unknown { .a { p: v; } .b { p: v } } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:26:1] 26 | @unknown x, y f(1) {s{p:v}} 27 | @unknown x, y f(1+2) {s{p:v}} @@ -3543,7 +3543,7 @@ 28 | @unknown { .a { p: v; } .b { p: v } } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:26:1] 26 | @unknown x, y f(1) {s{p:v}} 27 | @unknown x, y f(1+2) {s{p:v}} @@ -3695,7 +3695,7 @@ 29 | @unknown/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:27:1] 27 | @unknown x, y f(1+2) {s{p:v}} 28 | @unknown { .a { p: v; } .b { p: v } } @@ -3727,7 +3727,7 @@ 29 | @unknown/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:27:1] 27 | @unknown x, y f(1+2) {s{p:v}} 28 | @unknown { .a { p: v; } .b { p: v } } @@ -3775,7 +3775,7 @@ 29 | @unknown/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:27:1] 27 | @unknown x, y f(1+2) {s{p:v}} 28 | @unknown { .a { p: v; } .b { p: v } } @@ -3815,7 +3815,7 @@ 29 | @unknown/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:27:1] 27 | @unknown x, y f(1+2) {s{p:v}} 28 | @unknown { .a { p: v; } .b { p: v } } @@ -3863,7 +3863,7 @@ 29 | @unknown/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:27:1] 27 | @unknown x, y f(1+2) {s{p:v}} 28 | @unknown { .a { p: v; } .b { p: v } } @@ -3911,7 +3911,7 @@ 29 | @unknown/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:27:1] 27 | @unknown x, y f(1+2) {s{p:v}} 28 | @unknown { .a { p: v; } .b { p: v } } @@ -3927,7 +3927,7 @@ 29 | @unknown/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:27:1] 27 | @unknown x, y f(1+2) {s{p:v}} 28 | @unknown { .a { p: v; } .b { p: v } } @@ -3975,7 +3975,7 @@ 29 | @unknown/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:27:1] 27 | @unknown x, y f(1+2) {s{p:v}} 28 | @unknown { .a { p: v; } .b { p: v } } @@ -4015,7 +4015,7 @@ 29 | @unknown/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:27:1] 27 | @unknown x, y f(1+2) {s{p:v}} 28 | @unknown { .a { p: v; } .b { p: v } } @@ -4063,7 +4063,7 @@ 29 | @unknown/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:27:1] 27 | @unknown x, y f(1+2) {s{p:v}} 28 | @unknown { .a { p: v; } .b { p: v } } @@ -4095,7 +4095,7 @@ 29 | @unknown/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:27:1] 27 | @unknown x, y f(1+2) {s{p:v}} 28 | @unknown { .a { p: v; } .b { p: v } } @@ -4111,7 +4111,7 @@ 29 | @unknown/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:27:1] 27 | @unknown x, y f(1+2) {s{p:v}} 28 | @unknown { .a { p: v; } .b { p: v } } @@ -4295,7 +4295,7 @@ 31 | /*@unknown !*test*!x!*test*!,!*test*!y!*test*! f(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!s!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}!*test*!}*/ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:29:1] 29 | @unknown/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} 30 | @unknown /*test*/x/*test*/ y/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} @@ -4327,7 +4327,7 @@ 31 | /*@unknown !*test*!x!*test*!,!*test*!y!*test*! f(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!s!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}!*test*!}*/ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:29:1] 29 | @unknown/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} 30 | @unknown /*test*/x/*test*/ y/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} @@ -4495,7 +4495,7 @@ 33 | @unknown x y { s { p : v } } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:31:1] 31 | /*@unknown !*test*!x!*test*!,!*test*!y!*test*! f(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!s!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}!*test*!}*/ 32 | @unknown { s { p : v } } @@ -4527,7 +4527,7 @@ 33 | @unknown x y { s { p : v } } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:31:1] 31 | /*@unknown !*test*!x!*test*!,!*test*!y!*test*! f(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!s!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}!*test*!}*/ 32 | @unknown { s { p : v } } @@ -4559,7 +4559,7 @@ 33 | @unknown x y { s { p : v } } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:31:1] 31 | /*@unknown !*test*!x!*test*!,!*test*!y!*test*! f(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!s!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}!*test*!}*/ 32 | @unknown { s { p : v } } @@ -4599,7 +4599,7 @@ 33 | @unknown x y { s { p : v } } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:31:1] 31 | /*@unknown !*test*!x!*test*!,!*test*!y!*test*! f(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!s!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}!*test*!}*/ 32 | @unknown { s { p : v } } @@ -4631,7 +4631,7 @@ 33 | @unknown x y { s { p : v } } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:31:1] 31 | /*@unknown !*test*!x!*test*!,!*test*!y!*test*! f(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!s!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}!*test*!}*/ 32 | @unknown { s { p : v } } @@ -4663,7 +4663,7 @@ 33 | @unknown x y { s { p : v } } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:31:1] 31 | /*@unknown !*test*!x!*test*!,!*test*!y!*test*! f(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!s!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}!*test*!}*/ 32 | @unknown { s { p : v } } @@ -4695,7 +4695,7 @@ 33 | @unknown x y { s { p : v } } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:31:1] 31 | /*@unknown !*test*!x!*test*!,!*test*!y!*test*! f(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!s!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}!*test*!}*/ 32 | @unknown { s { p : v } } @@ -4711,7 +4711,7 @@ 33 | @unknown x y { s { p : v } } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:31:1] 31 | /*@unknown !*test*!x!*test*!,!*test*!y!*test*! f(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!s!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}!*test*!}*/ 32 | @unknown { s { p : v } } @@ -4759,7 +4759,7 @@ 34 | @unknown x , y f( 1 ) { s { p : v } } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:32:1] 32 | @unknown { s { p : v } } 33 | @unknown x y { s { p : v } } @@ -4791,7 +4791,7 @@ 34 | @unknown x , y f( 1 ) { s { p : v } } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:32:1] 32 | @unknown { s { p : v } } 33 | @unknown x y { s { p : v } } @@ -4823,7 +4823,7 @@ 34 | @unknown x , y f( 1 ) { s { p : v } } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:32:1] 32 | @unknown { s { p : v } } 33 | @unknown x y { s { p : v } } @@ -4855,7 +4855,7 @@ 34 | @unknown x , y f( 1 ) { s { p : v } } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:32:1] 32 | @unknown { s { p : v } } 33 | @unknown x y { s { p : v } } @@ -4887,7 +4887,7 @@ 34 | @unknown x , y f( 1 ) { s { p : v } } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:32:1] 32 | @unknown { s { p : v } } 33 | @unknown x y { s { p : v } } @@ -4927,7 +4927,7 @@ 34 | @unknown x , y f( 1 ) { s { p : v } } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:32:1] 32 | @unknown { s { p : v } } 33 | @unknown x y { s { p : v } } @@ -4959,7 +4959,7 @@ 34 | @unknown x , y f( 1 ) { s { p : v } } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:32:1] 32 | @unknown { s { p : v } } 33 | @unknown x y { s { p : v } } @@ -4991,7 +4991,7 @@ 34 | @unknown x , y f( 1 ) { s { p : v } } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:32:1] 32 | @unknown { s { p : v } } 33 | @unknown x y { s { p : v } } @@ -5023,7 +5023,7 @@ 34 | @unknown x , y f( 1 ) { s { p : v } } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:32:1] 32 | @unknown { s { p : v } } 33 | @unknown x y { s { p : v } } @@ -5039,7 +5039,7 @@ 34 | @unknown x , y f( 1 ) { s { p : v } } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:32:1] 32 | @unknown { s { p : v } } 33 | @unknown x y { s { p : v } } @@ -5087,7 +5087,7 @@ 35 | @unknown x , y f( 1 2 ) { s { p : v } } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:33:1] 33 | @unknown x y { s { p : v } } 34 | @unknown x , y f( 1 ) { s { p : v } } @@ -5119,7 +5119,7 @@ 35 | @unknown x , y f( 1 2 ) { s { p : v } } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:33:1] 33 | @unknown x y { s { p : v } } 34 | @unknown x , y f( 1 ) { s { p : v } } @@ -5151,7 +5151,7 @@ 35 | @unknown x , y f( 1 2 ) { s { p : v } } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:33:1] 33 | @unknown x y { s { p : v } } 34 | @unknown x , y f( 1 ) { s { p : v } } @@ -5183,7 +5183,7 @@ 35 | @unknown x , y f( 1 2 ) { s { p : v } } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:33:1] 33 | @unknown x y { s { p : v } } 34 | @unknown x , y f( 1 ) { s { p : v } } @@ -5223,7 +5223,7 @@ 35 | @unknown x , y f( 1 2 ) { s { p : v } } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:33:1] 33 | @unknown x y { s { p : v } } 34 | @unknown x , y f( 1 ) { s { p : v } } @@ -5255,7 +5255,7 @@ 35 | @unknown x , y f( 1 2 ) { s { p : v } } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:33:1] 33 | @unknown x y { s { p : v } } 34 | @unknown x , y f( 1 ) { s { p : v } } @@ -5271,7 +5271,7 @@ 35 | @unknown x , y f( 1 2 ) { s { p : v } } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:33:1] 33 | @unknown x y { s { p : v } } 34 | @unknown x , y f( 1 ) { s { p : v } } @@ -5303,7 +5303,7 @@ 35 | @unknown x , y f( 1 2 ) { s { p : v } } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:33:1] 33 | @unknown x y { s { p : v } } 34 | @unknown x , y f( 1 ) { s { p : v } } @@ -5335,7 +5335,7 @@ 35 | @unknown x , y f( 1 2 ) { s { p : v } } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:33:1] 33 | @unknown x y { s { p : v } } 34 | @unknown x , y f( 1 ) { s { p : v } } @@ -5375,7 +5375,7 @@ 35 | @unknown x , y f( 1 2 ) { s { p : v } } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:33:1] 33 | @unknown x y { s { p : v } } 34 | @unknown x , y f( 1 ) { s { p : v } } @@ -5407,7 +5407,7 @@ 35 | @unknown x , y f( 1 2 ) { s { p : v } } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:33:1] 33 | @unknown x y { s { p : v } } 34 | @unknown x , y f( 1 ) { s { p : v } } @@ -5439,7 +5439,7 @@ 35 | @unknown x , y f( 1 2 ) { s { p : v } } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:33:1] 33 | @unknown x y { s { p : v } } 34 | @unknown x , y f( 1 ) { s { p : v } } @@ -5471,7 +5471,7 @@ 35 | @unknown x , y f( 1 2 ) { s { p : v } } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:33:1] 33 | @unknown x y { s { p : v } } 34 | @unknown x , y f( 1 ) { s { p : v } } @@ -5487,7 +5487,7 @@ 35 | @unknown x , y f( 1 2 ) { s { p : v } } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:33:1] 33 | @unknown x y { s { p : v } } 34 | @unknown x , y f( 1 ) { s { p : v } } @@ -5530,7 +5530,7 @@ : ^^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:34:1] 34 | @unknown x , y f( 1 ) { s { p : v } } 35 | @unknown x , y f( 1 2 ) { s { p : v } } @@ -5558,7 +5558,7 @@ : ^^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:34:1] 34 | @unknown x , y f( 1 ) { s { p : v } } 35 | @unknown x , y f( 1 2 ) { s { p : v } } @@ -5586,7 +5586,7 @@ : ^^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:34:1] 34 | @unknown x , y f( 1 ) { s { p : v } } 35 | @unknown x , y f( 1 2 ) { s { p : v } } @@ -5614,7 +5614,7 @@ : ^^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:34:1] 34 | @unknown x , y f( 1 ) { s { p : v } } 35 | @unknown x , y f( 1 2 ) { s { p : v } } @@ -5649,7 +5649,7 @@ : ^^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:34:1] 34 | @unknown x , y f( 1 ) { s { p : v } } 35 | @unknown x , y f( 1 2 ) { s { p : v } } @@ -5677,7 +5677,7 @@ : ^^^^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:34:1] 34 | @unknown x , y f( 1 ) { s { p : v } } 35 | @unknown x , y f( 1 2 ) { s { p : v } } @@ -5705,7 +5705,7 @@ : ^^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:34:1] 34 | @unknown x , y f( 1 ) { s { p : v } } 35 | @unknown x , y f( 1 2 ) { s { p : v } } @@ -5719,7 +5719,7 @@ : ^^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:34:1] 34 | @unknown x , y f( 1 ) { s { p : v } } 35 | @unknown x , y f( 1 2 ) { s { p : v } } @@ -5747,7 +5747,7 @@ : ^^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:34:1] 34 | @unknown x , y f( 1 ) { s { p : v } } 35 | @unknown x , y f( 1 2 ) { s { p : v } } @@ -5775,7 +5775,7 @@ : ^^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:34:1] 34 | @unknown x , y f( 1 ) { s { p : v } } 35 | @unknown x , y f( 1 2 ) { s { p : v } } @@ -5810,7 +5810,7 @@ : ^^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:34:1] 34 | @unknown x , y f( 1 ) { s { p : v } } 35 | @unknown x , y f( 1 2 ) { s { p : v } } @@ -5838,7 +5838,7 @@ : ^^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:34:1] 34 | @unknown x , y f( 1 ) { s { p : v } } 35 | @unknown x , y f( 1 2 ) { s { p : v } } @@ -5866,7 +5866,7 @@ : ^^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:34:1] 34 | @unknown x , y f( 1 ) { s { p : v } } 35 | @unknown x , y f( 1 2 ) { s { p : v } } @@ -5894,7 +5894,7 @@ : ^^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:34:1] 34 | @unknown x , y f( 1 ) { s { p : v } } 35 | @unknown x , y f( 1 2 ) { s { p : v } } @@ -5908,7 +5908,7 @@ : ^^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:34:1] 34 | @unknown x , y f( 1 ) { s { p : v } } 35 | @unknown x , y f( 1 2 ) { s { p : v } } @@ -5957,7 +5957,7 @@ 38 | --> {} `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:36:1] 36 | 37 | @unknown { @@ -5990,7 +5990,7 @@ 39 | {} @@ -6062,7 +6062,7 @@ 40 | } `---- - x WhiteSpace(WhiteSpaceToken { value: "\n " }) + x WhiteSpace { value: "\n " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:37:1] 37 | @unknown { 38 | ,-> --> {} @@ -6094,7 +6094,7 @@ 40 | } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:38:1] 38 | --> {} 39 | {} 39 | : ^ @@ -119,7 +119,7 @@ 4 | color: red; `---- - x WhiteSpace(WhiteSpaceToken { value: "\n\n" }) + x WhiteSpace { value: "\n\n" } ,-[$DIR/tests/recovery/cdo-and-cdc/input.css:1:1] 1 | ,-> 2 | `-> @@ -151,7 +151,7 @@ 4 | color: red; `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/cdo-and-cdc/input.css:2:1] 2 | 3 | div { @@ -280,7 +280,7 @@ 7 | test `---- - x WhiteSpace(WhiteSpaceToken { value: "\n\n" }) + x WhiteSpace { value: "\n\n" } ,-[$DIR/tests/recovery/cdo-and-cdc/input.css:4:1] 4 | color: red; 5 | ,-> @@ -565,7 +565,7 @@ 16 | test `---- - x WhiteSpace(WhiteSpaceToken { value: "\n\n" }) + x WhiteSpace { value: "\n\n" } ,-[$DIR/tests/recovery/cdo-and-cdc/input.css:13:1] 13 | color: red; 14 | ,-> `---- - x WhiteSpace(WhiteSpaceToken { value: "\n\n" }) + x WhiteSpace { value: "\n\n" } ,-[$DIR/tests/recovery/cdo-and-cdc/input.css:15:1] 15 | 16 | ,-> test @@ -626,7 +626,7 @@ 21 | } `---- - x WhiteSpace(WhiteSpaceToken { value: "\n\n " }) + x WhiteSpace { value: "\n\n " } ,-[$DIR/tests/recovery/cdo-and-cdc/input.css:17:1] 17 | 18 | ,-> --> @@ -675,7 +675,7 @@ 21 | } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/cdo-and-cdc/input.css:19:1] 19 | 20 | color: blue; @@ -922,7 +922,7 @@ 27 | test `---- - x WhiteSpace(WhiteSpaceToken { value: "\n\n" }) + x WhiteSpace { value: "\n\n" } ,-[$DIR/tests/recovery/cdo-and-cdc/input.css:24:1] 24 | color: red; 25 | ,-> ; `---- - x WhiteSpace(WhiteSpaceToken { value: "\n\n" }) + x WhiteSpace { value: "\n\n" } ,-[$DIR/tests/recovery/cdo-and-cdc/input.css:26:1] 26 | 27 | ,-> test @@ -1189,7 +1189,7 @@ 36 | color: red; `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/cdo-and-cdc/input.css:34:1] 34 | a { 35 | @@ -1452,7 +1452,7 @@ 43 | 90% { left: 300px; } `---- - x WhiteSpace(WhiteSpaceToken { value: "\n " }) + x WhiteSpace { value: "\n " } ,-[$DIR/tests/recovery/cdo-and-cdc/input.css:40:1] 40 | @keyframes box { 41 | ,-> @@ -1484,7 +1484,7 @@ 43 | 90% { left: 300px; } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/cdo-and-cdc/input.css:41:1] 41 | 42 | 50% { left: 0; } diff --git a/crates/swc_css_parser/tests/recovery/comments/bad-comment-1/span.swc-stderr b/crates/swc_css_parser/tests/recovery/comments/bad-comment-1/span.swc-stderr index 9a07a2cbc5a7..1d21d91bd920 100644 --- a/crates/swc_css_parser/tests/recovery/comments/bad-comment-1/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/comments/bad-comment-1/span.swc-stderr @@ -41,7 +41,7 @@ : ^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/comments/bad-comment-1/input.css:1:1] 1 | // comment : ^ diff --git a/crates/swc_css_parser/tests/recovery/comments/declaration/span.swc-stderr b/crates/swc_css_parser/tests/recovery/comments/declaration/span.swc-stderr index a45f3efc44e8..55bcffbe754f 100644 --- a/crates/swc_css_parser/tests/recovery/comments/declaration/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/comments/declaration/span.swc-stderr @@ -175,7 +175,7 @@ 3 | /* comment */: `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/comments/declaration/input.css:1:1] 1 | a { 2 | prop: url("test") /* comment */ /* comment */ @@ -191,7 +191,7 @@ 3 | /* comment */: `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/comments/declaration/input.css:1:1] 1 | a { 2 | prop: url("test") /* comment */ /* comment */ @@ -207,7 +207,7 @@ 4 | } `---- - x WhiteSpace(WhiteSpaceToken { value: "\n " }) + x WhiteSpace { value: "\n " } ,-[$DIR/tests/recovery/comments/declaration/input.css:1:1] 1 | a { 2 | ,-> prop: url("test") /* comment */ /* comment */ diff --git a/crates/swc_css_parser/tests/recovery/declaration/bad-value-1/span.swc-stderr b/crates/swc_css_parser/tests/recovery/declaration/bad-value-1/span.swc-stderr index 1ffd5a65f2b8..8823d3655d44 100644 --- a/crates/swc_css_parser/tests/recovery/declaration/bad-value-1/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/declaration/bad-value-1/span.swc-stderr @@ -166,7 +166,7 @@ 3 | } `---- - x WhiteSpace(WhiteSpaceToken { value: "\n" }) + x WhiteSpace { value: "\n" } ,-[$DIR/tests/recovery/declaration/bad-value-1/input.css:1:1] 1 | a { 2 | --var: [; diff --git a/crates/swc_css_parser/tests/recovery/declaration/bad-value-2/span.swc-stderr b/crates/swc_css_parser/tests/recovery/declaration/bad-value-2/span.swc-stderr index a518fa3b6340..e8665e187363 100644 --- a/crates/swc_css_parser/tests/recovery/declaration/bad-value-2/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/declaration/bad-value-2/span.swc-stderr @@ -166,7 +166,7 @@ 3 | } `---- - x WhiteSpace(WhiteSpaceToken { value: "\n" }) + x WhiteSpace { value: "\n" } ,-[$DIR/tests/recovery/declaration/bad-value-2/input.css:1:1] 1 | a { 2 | --var: (; diff --git a/crates/swc_css_parser/tests/recovery/declaration/bad-value/span.swc-stderr b/crates/swc_css_parser/tests/recovery/declaration/bad-value/span.swc-stderr index e176a0ad209f..c269fda3b4fc 100644 --- a/crates/swc_css_parser/tests/recovery/declaration/bad-value/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/declaration/bad-value/span.swc-stderr @@ -655,7 +655,7 @@ 11 | value: ! !important unknown; `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/declaration/bad-value/input.css:9:1] 9 | value: !!; 10 | value: ! !important; @@ -743,7 +743,7 @@ 12 | value: ! unknown; `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/declaration/bad-value/input.css:10:1] 10 | value: ! !important; 11 | value: ! !important unknown; @@ -791,7 +791,7 @@ 12 | value: ! unknown; `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/declaration/bad-value/input.css:10:1] 10 | value: ! !important; 11 | value: ! !important unknown; @@ -879,7 +879,7 @@ 13 | value: ! ! !; `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/declaration/bad-value/input.css:11:1] 11 | value: ! !important unknown; 12 | value: ! unknown; @@ -967,7 +967,7 @@ 14 | } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/declaration/bad-value/input.css:12:1] 12 | value: ! unknown; 13 | value: ! ! !; @@ -999,7 +999,7 @@ 14 | } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/declaration/bad-value/input.css:12:1] 12 | value: ! unknown; 13 | value: ! ! !; diff --git a/crates/swc_css_parser/tests/recovery/declaration/important-1/span.swc-stderr b/crates/swc_css_parser/tests/recovery/declaration/important-1/span.swc-stderr index 298b1474cffd..0f40dc403d6b 100644 --- a/crates/swc_css_parser/tests/recovery/declaration/important-1/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/declaration/important-1/span.swc-stderr @@ -147,7 +147,7 @@ 3 | } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/declaration/important-1/input.css:1:1] 1 | a { 2 | color: red !importan; diff --git a/crates/swc_css_parser/tests/recovery/declaration/important/span.swc-stderr b/crates/swc_css_parser/tests/recovery/declaration/important/span.swc-stderr index 6ae782c37a3b..158b669d4af0 100644 --- a/crates/swc_css_parser/tests/recovery/declaration/important/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/declaration/important/span.swc-stderr @@ -160,7 +160,7 @@ 3 | } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/declaration/important/input.css:1:1] 1 | .a { 2 | color: white !!important; @@ -344,7 +344,7 @@ 7 | } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/declaration/important/input.css:5:1] 5 | .class { 6 | color: red red red !important !important; @@ -376,7 +376,7 @@ 7 | } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/declaration/important/input.css:5:1] 5 | .class { 6 | color: red red red !important !important; @@ -408,7 +408,7 @@ 7 | } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/declaration/important/input.css:5:1] 5 | .class { 6 | color: red red red !important !important; @@ -608,7 +608,7 @@ 11 | } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/declaration/important/input.css:9:1] 9 | .class { 10 | color: red red red !important!important ; @@ -640,7 +640,7 @@ 11 | } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/declaration/important/input.css:9:1] 9 | .class { 10 | color: red red red !important!important ; @@ -672,7 +672,7 @@ 11 | } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/declaration/important/input.css:9:1] 9 | .class { 10 | color: red red red !important!important ; @@ -872,7 +872,7 @@ 15 | } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/declaration/important/input.css:13:1] 13 | .class { 14 | color: red red red /* test*/ !important /*test*/ !important /*test*/ ; @@ -904,7 +904,7 @@ 15 | } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/declaration/important/input.css:13:1] 13 | .class { 14 | color: red red red /* test*/ !important /*test*/ !important /*test*/ ; @@ -936,7 +936,7 @@ 15 | } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/declaration/important/input.css:13:1] 13 | .class { 14 | color: red red red /* test*/ !important /*test*/ !important /*test*/ ; @@ -952,7 +952,7 @@ 15 | } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/declaration/important/input.css:13:1] 13 | .class { 14 | color: red red red /* test*/ !important /*test*/ !important /*test*/ ; @@ -1152,7 +1152,7 @@ 19 | } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/declaration/important/input.css:17:1] 17 | .class { 18 | color: red red red !important !important!important; @@ -1184,7 +1184,7 @@ 19 | } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/declaration/important/input.css:17:1] 17 | .class { 18 | color: red red red !important !important!important; @@ -1216,7 +1216,7 @@ 19 | } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/declaration/important/input.css:17:1] 17 | .class { 18 | color: red red red !important !important!important; @@ -1264,7 +1264,7 @@ 19 | } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/declaration/important/input.css:17:1] 17 | .class { 18 | color: red red red !important !important!important; @@ -1464,7 +1464,7 @@ 23 | } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/declaration/important/input.css:21:1] 21 | .class { 22 | color: red red red /* test */ ! /*test */ important /* test */ ! /* test */ important /* test */; @@ -1496,7 +1496,7 @@ 23 | } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/declaration/important/input.css:21:1] 21 | .class { 22 | color: red red red /* test */ ! /*test */ important /* test */ ! /* test */ important /* test */; @@ -1528,7 +1528,7 @@ 23 | } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/declaration/important/input.css:21:1] 21 | .class { 22 | color: red red red /* test */ ! /*test */ important /* test */ ! /* test */ important /* test */; @@ -1544,7 +1544,7 @@ 23 | } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/declaration/important/input.css:21:1] 21 | .class { 22 | color: red red red /* test */ ! /*test */ important /* test */ ! /* test */ important /* test */; @@ -1576,7 +1576,7 @@ 23 | } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/declaration/important/input.css:21:1] 21 | .class { 22 | color: red red red /* test */ ! /*test */ important /* test */ ! /* test */ important /* test */; @@ -1592,7 +1592,7 @@ 23 | } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/declaration/important/input.css:21:1] 21 | .class { 22 | color: red red red /* test */ ! /*test */ important /* test */ ! /* test */ important /* test */; diff --git a/crates/swc_css_parser/tests/recovery/declaration/wrong-name/span.swc-stderr b/crates/swc_css_parser/tests/recovery/declaration/wrong-name/span.swc-stderr index 05747ce5c88d..5a82152a10c2 100644 --- a/crates/swc_css_parser/tests/recovery/declaration/wrong-name/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/declaration/wrong-name/span.swc-stderr @@ -139,7 +139,7 @@ 3 | } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/declaration/wrong-name/input.css:1:1] 1 | a { 2 | 20: red; diff --git a/crates/swc_css_parser/tests/recovery/delim-token/at-sign/span.swc-stderr b/crates/swc_css_parser/tests/recovery/delim-token/at-sign/span.swc-stderr index 53e7e4aed888..bb6f8418b825 100644 --- a/crates/swc_css_parser/tests/recovery/delim-token/at-sign/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/delim-token/at-sign/span.swc-stderr @@ -147,7 +147,7 @@ 3 | } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/delim-token/at-sign/input.css:1:1] 1 | a { 2 | color: @ red; diff --git a/crates/swc_css_parser/tests/recovery/delim-token/minus/span.swc-stderr b/crates/swc_css_parser/tests/recovery/delim-token/minus/span.swc-stderr index 0a2659226a61..0095f9334fca 100644 --- a/crates/swc_css_parser/tests/recovery/delim-token/minus/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/delim-token/minus/span.swc-stderr @@ -211,7 +211,7 @@ 4 | prop2: func(1 - 2); `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/delim-token/minus/input.css:2:1] 2 | prop: -; 3 | prop1: 1 - 2; @@ -243,7 +243,7 @@ 4 | prop2: func(1 - 2); `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/delim-token/minus/input.css:2:1] 2 | prop: -; 3 | prop1: 1 - 2; @@ -355,7 +355,7 @@ 5 | } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/delim-token/minus/input.css:3:1] 3 | prop1: 1 - 2; 4 | prop2: func(1 - 2); @@ -387,7 +387,7 @@ 5 | } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/delim-token/minus/input.css:3:1] 3 | prop1: 1 - 2; 4 | prop2: func(1 - 2); diff --git a/crates/swc_css_parser/tests/recovery/delim-token/plus/span.swc-stderr b/crates/swc_css_parser/tests/recovery/delim-token/plus/span.swc-stderr index 4cfe5066d569..f5ff0ec5be89 100644 --- a/crates/swc_css_parser/tests/recovery/delim-token/plus/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/delim-token/plus/span.swc-stderr @@ -211,7 +211,7 @@ 4 | prop2: func(1 + 2); `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/delim-token/plus/input.css:2:1] 2 | prop: +; 3 | prop1: 1 + 2; @@ -243,7 +243,7 @@ 4 | prop2: func(1 + 2); `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/delim-token/plus/input.css:2:1] 2 | prop: +; 3 | prop1: 1 + 2; @@ -355,7 +355,7 @@ 5 | } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/delim-token/plus/input.css:3:1] 3 | prop1: 1 + 2; 4 | prop2: func(1 + 2); @@ -387,7 +387,7 @@ 5 | } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/delim-token/plus/input.css:3:1] 3 | prop1: 1 + 2; 4 | prop2: func(1 + 2); diff --git a/crates/swc_css_parser/tests/recovery/escaped/id-selector/span.swc-stderr b/crates/swc_css_parser/tests/recovery/escaped/id-selector/span.swc-stderr index 9b73e9d0a303..aafce4019da6 100644 --- a/crates/swc_css_parser/tests/recovery/escaped/id-selector/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/escaped/id-selector/span.swc-stderr @@ -35,7 +35,7 @@ : ^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/escaped/id-selector/input.css:1:1] 1 | #0\2chash {} : ^ diff --git a/crates/swc_css_parser/tests/recovery/function/base/span.swc-stderr b/crates/swc_css_parser/tests/recovery/function/base/span.swc-stderr index da1bd477e9b1..ca227a3e18a8 100644 --- a/crates/swc_css_parser/tests/recovery/function/base/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/function/base/span.swc-stderr @@ -195,7 +195,7 @@ 3 | prop: func(ident.ident); `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/function/base/input.css:1:1] 1 | div { 2 | prop: func(1 + 2); @@ -227,7 +227,7 @@ 3 | prop: func(ident.ident); `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/function/base/input.css:1:1] 1 | div { 2 | prop: func(1 + 2); @@ -435,7 +435,7 @@ 5 | prop: func([foo bar]); `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/function/base/input.css:3:1] 3 | prop: func(ident.ident); 4 | prop: func3( ident.ident ); @@ -499,7 +499,7 @@ 5 | prop: func([foo bar]); `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/function/base/input.css:3:1] 3 | prop: func(ident.ident); 4 | prop: func3( ident.ident ); @@ -859,7 +859,7 @@ 8 | prop: func(1, 2); `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/function/base/input.css:6:1] 6 | prop: func((foo, bar)); 7 | prop: func({ foo: bar }); @@ -907,7 +907,7 @@ 8 | prop: func(1, 2); `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/function/base/input.css:6:1] 6 | prop: func((foo, bar)); 7 | prop: func({ foo: bar }); @@ -939,7 +939,7 @@ 8 | prop: func(1, 2); `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/function/base/input.css:6:1] 6 | prop: func((foo, bar)); 7 | prop: func({ foo: bar }); diff --git a/crates/swc_css_parser/tests/recovery/function/nested-unclosed/span.swc-stderr b/crates/swc_css_parser/tests/recovery/function/nested-unclosed/span.swc-stderr index e7c770ce45d3..44beae8a6510 100644 --- a/crates/swc_css_parser/tests/recovery/function/nested-unclosed/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/function/nested-unclosed/span.swc-stderr @@ -171,7 +171,7 @@ 3 | } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/function/nested-unclosed/input.css:1:1] 1 | a { 2 | prop: url("test") : diff --git a/crates/swc_css_parser/tests/recovery/function/rgb/span.swc-stderr b/crates/swc_css_parser/tests/recovery/function/rgb/span.swc-stderr index bcd586accbe6..d2cde23121e6 100644 --- a/crates/swc_css_parser/tests/recovery/function/rgb/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/function/rgb/span.swc-stderr @@ -317,7 +317,7 @@ 5 | color: rgb(100, "test", 100); `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/function/rgb/input.css:3:1] 3 | 4 | color: rgb("test", 100, 100); @@ -365,7 +365,7 @@ 5 | color: rgb(100, "test", 100); `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/function/rgb/input.css:3:1] 3 | 4 | color: rgb("test", 100, 100); @@ -501,7 +501,7 @@ 6 | color: rgb(100, 100, "test"); `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/function/rgb/input.css:4:1] 4 | color: rgb("test", 100, 100); 5 | color: rgb(100, "test", 100); @@ -549,7 +549,7 @@ 6 | color: rgb(100, 100, "test"); `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/function/rgb/input.css:4:1] 4 | color: rgb("test", 100, 100); 5 | color: rgb(100, "test", 100); @@ -685,7 +685,7 @@ 7 | color: rgb(100, 100, 100, "test"); `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/function/rgb/input.css:5:1] 5 | color: rgb(100, "test", 100); 6 | color: rgb(100, 100, "test"); @@ -733,7 +733,7 @@ 7 | color: rgb(100, 100, 100, "test"); `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/function/rgb/input.css:5:1] 5 | color: rgb(100, "test", 100); 6 | color: rgb(100, 100, "test"); @@ -855,7 +855,7 @@ : ^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/function/rgb/input.css:6:1] 6 | color: rgb(100, 100, "test"); 7 | color: rgb(100, 100, 100, "test"); @@ -897,7 +897,7 @@ : ^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/function/rgb/input.css:6:1] 6 | color: rgb(100, 100, "test"); 7 | color: rgb(100, 100, 100, "test"); @@ -939,7 +939,7 @@ : ^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/function/rgb/input.css:6:1] 6 | color: rgb(100, 100, "test"); 7 | color: rgb(100, 100, 100, "test"); @@ -1056,7 +1056,7 @@ 10 | color: rgb(100 "test" 100); `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/function/rgb/input.css:8:1] 8 | 9 | color: rgb("test" 100 100); @@ -1088,7 +1088,7 @@ 10 | color: rgb(100 "test" 100); `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/function/rgb/input.css:8:1] 8 | 9 | color: rgb("test" 100 100); @@ -1208,7 +1208,7 @@ 11 | color: rgb(100 100 "test"); `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/function/rgb/input.css:9:1] 9 | color: rgb("test" 100 100); 10 | color: rgb(100 "test" 100); @@ -1240,7 +1240,7 @@ 11 | color: rgb(100 100 "test"); `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/function/rgb/input.css:9:1] 9 | color: rgb("test" 100 100); 10 | color: rgb(100 "test" 100); @@ -1360,7 +1360,7 @@ 12 | color: rgb(100 100 100 / "test"); `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/function/rgb/input.css:10:1] 10 | color: rgb(100 "test" 100); 11 | color: rgb(100 100 "test"); @@ -1392,7 +1392,7 @@ 12 | color: rgb(100 100 100 / "test"); `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/function/rgb/input.css:10:1] 10 | color: rgb(100 "test" 100); 11 | color: rgb(100 100 "test"); @@ -1500,7 +1500,7 @@ : ^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/function/rgb/input.css:11:1] 11 | color: rgb(100 100 "test"); 12 | color: rgb(100 100 100 / "test"); @@ -1528,7 +1528,7 @@ : ^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/function/rgb/input.css:11:1] 11 | color: rgb(100 100 "test"); 12 | color: rgb(100 100 100 / "test"); @@ -1556,7 +1556,7 @@ : ^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/function/rgb/input.css:11:1] 11 | color: rgb(100 100 "test"); 12 | color: rgb(100 100 100 / "test"); @@ -1584,7 +1584,7 @@ : ^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/function/rgb/input.css:11:1] 11 | color: rgb(100 100 "test"); 12 | color: rgb(100 100 100 / "test"); diff --git a/crates/swc_css_parser/tests/recovery/function/unclosed-2/span.swc-stderr b/crates/swc_css_parser/tests/recovery/function/unclosed-2/span.swc-stderr index 2136c3bb44eb..369c2912223d 100644 --- a/crates/swc_css_parser/tests/recovery/function/unclosed-2/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/function/unclosed-2/span.swc-stderr @@ -175,7 +175,7 @@ 3 | } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/function/unclosed-2/input.css:1:1] 1 | .style { 2 | grid-template-columns: repeat(4, [col-start] 12px @@ -231,7 +231,7 @@ 3 | } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/function/unclosed-2/input.css:1:1] 1 | .style { 2 | grid-template-columns: repeat(4, [col-start] 12px @@ -263,7 +263,7 @@ 3 | } `---- - x WhiteSpace(WhiteSpaceToken { value: "\n" }) + x WhiteSpace { value: "\n" } ,-[$DIR/tests/recovery/function/unclosed-2/input.css:1:1] 1 | .style { 2 | grid-template-columns: repeat(4, [col-start] 12px @@ -292,7 +292,7 @@ : ^ `---- - x WhiteSpace(WhiteSpaceToken { value: "\n" }) + x WhiteSpace { value: "\n" } ,-[$DIR/tests/recovery/function/unclosed-2/input.css:2:1] 2 | grid-template-columns: repeat(4, [col-start] 12px 3 | } diff --git a/crates/swc_css_parser/tests/recovery/function/unclosed/span.swc-stderr b/crates/swc_css_parser/tests/recovery/function/unclosed/span.swc-stderr index faeab716dad5..0b36ed615215 100644 --- a/crates/swc_css_parser/tests/recovery/function/unclosed/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/function/unclosed/span.swc-stderr @@ -175,7 +175,7 @@ 3 | } `---- - x WhiteSpace(WhiteSpaceToken { value: "\n" }) + x WhiteSpace { value: "\n" } ,-[$DIR/tests/recovery/function/unclosed/input.css:1:1] 1 | .style { 2 | width: min(500px; @@ -204,7 +204,7 @@ : ^ `---- - x WhiteSpace(WhiteSpaceToken { value: "\n" }) + x WhiteSpace { value: "\n" } ,-[$DIR/tests/recovery/function/unclosed/input.css:2:1] 2 | width: min(500px; 3 | } diff --git a/crates/swc_css_parser/tests/recovery/hacks/span.swc-stderr b/crates/swc_css_parser/tests/recovery/hacks/span.swc-stderr index b4fe3698520a..46db9a8fbeec 100644 --- a/crates/swc_css_parser/tests/recovery/hacks/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/hacks/span.swc-stderr @@ -1015,7 +1015,7 @@ 14 | .selector { [;property: value;]; } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/hacks/input.css:12:1] 12 | 13 | .selector { (;property: value;); } @@ -1225,7 +1225,7 @@ : ^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/hacks/input.css:13:1] 13 | .selector { (;property: value;); } 14 | .selector { [;property: value;]; } @@ -1309,7 +1309,7 @@ : ^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/hacks/input.css:15:1] 15 | 16 | @media \\0 screen {} @@ -1337,7 +1337,7 @@ : ^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/hacks/input.css:15:1] 15 | 16 | @media \\0 screen {} @@ -1365,7 +1365,7 @@ : ^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/hacks/input.css:15:1] 15 | 16 | @media \\0 screen {} @@ -9503,7 +9503,7 @@ 105 | color: red; `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/hacks/input.css:103:1] 103 | .selector { 104 | !property: value; @@ -9757,7 +9757,7 @@ 109 | color: red; `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/hacks/input.css:107:1] 107 | .selector { 108 | $property: value; @@ -10011,7 +10011,7 @@ 113 | color: red; `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/hacks/input.css:111:1] 111 | .selector { 112 | &property: value; @@ -10265,7 +10265,7 @@ 117 | color: red; `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/hacks/input.css:115:1] 115 | .selector { 116 | *property: value; @@ -10519,7 +10519,7 @@ 121 | color: red; `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/hacks/input.css:119:1] 119 | .selector { 120 | )property: value; @@ -10773,7 +10773,7 @@ 125 | color: red; `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/hacks/input.css:123:1] 123 | .selector { 124 | =property: value; @@ -11027,7 +11027,7 @@ 129 | color: red; `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/hacks/input.css:127:1] 127 | .selector { 128 | %property: value; @@ -11281,7 +11281,7 @@ 133 | color: red; `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/hacks/input.css:131:1] 131 | .selector { 132 | +property: value; @@ -11583,7 +11583,7 @@ 137 | color: red; `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/hacks/input.css:135:1] 135 | .selector { 136 | @property: value; @@ -11765,7 +11765,7 @@ 141 | color: red; `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/hacks/input.css:139:1] 139 | .selector { 140 | ,property: value; @@ -12019,7 +12019,7 @@ 145 | color: red; `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/hacks/input.css:143:1] 143 | .selector { 144 | .property: value; @@ -12273,7 +12273,7 @@ 149 | color: red; `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/hacks/input.css:147:1] 147 | .selector { 148 | /property: value; @@ -12527,7 +12527,7 @@ 153 | color: red; `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/hacks/input.css:151:1] 151 | .selector { 152 | `property: value; @@ -12781,7 +12781,7 @@ 157 | color: red; `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/hacks/input.css:155:1] 155 | .selector { 156 | ]property: value; @@ -13019,7 +13019,7 @@ 161 | color: red; `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/hacks/input.css:159:1] 159 | .selector { 160 | #property: value; @@ -13273,7 +13273,7 @@ 165 | color: red; `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/hacks/input.css:163:1] 163 | .selector { 164 | ~property: value; @@ -13527,7 +13527,7 @@ 169 | color: red; `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/hacks/input.css:167:1] 167 | .selector { 168 | ?property: value; @@ -13781,7 +13781,7 @@ 173 | color: red; `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/hacks/input.css:171:1] 171 | .selector { 172 | :property: value; @@ -14032,7 +14032,7 @@ 177 | color: red; `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/hacks/input.css:175:1] 175 | .selector { 176 | |property: value; @@ -14254,7 +14254,7 @@ : ^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/hacks/input.css:179:1] 179 | 180 | .selector { property: value !ie; } @@ -15858,7 +15858,7 @@ 205 | .selector { [;property: value;]; } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/hacks/input.css:203:1] 203 | 204 | .selector { (;property: value;); } @@ -16068,7 +16068,7 @@ : ^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/hacks/input.css:204:1] 204 | .selector { (;property: value;); } 205 | .selector { [;property: value;]; } @@ -17889,7 +17889,7 @@ 226 | .selector { [;property: value;]; } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/hacks/input.css:224:1] 224 | 225 | .selector { (;property: value;); } @@ -18099,7 +18099,7 @@ : ^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/hacks/input.css:225:1] 225 | .selector { (;property: value;); } 226 | .selector { [;property: value;]; } @@ -19482,7 +19482,7 @@ : ^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/hacks/input.css:240:1] 240 | 241 | @media \\0 screen {} @@ -19510,7 +19510,7 @@ : ^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/hacks/input.css:240:1] 240 | 241 | @media \\0 screen {} @@ -19538,7 +19538,7 @@ : ^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/hacks/input.css:240:1] 240 | 241 | @media \\0 screen {} @@ -19712,7 +19712,7 @@ 245 | _background: white; `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/hacks/input.css:243:1] 243 | a { 244 | *color : black; @@ -19744,7 +19744,7 @@ 245 | _background: white; `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/hacks/input.css:243:1] 243 | a { 244 | *color : black; @@ -20008,7 +20008,7 @@ 248 | } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/hacks/input.css:246:1] 246 | font-size/**/: big; 247 | $(var)-size: 100%; diff --git a/crates/swc_css_parser/tests/recovery/ie-progid/span.swc-stderr b/crates/swc_css_parser/tests/recovery/ie-progid/span.swc-stderr index f9fee3159844..c7f374c66e0d 100644 --- a/crates/swc_css_parser/tests/recovery/ie-progid/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/ie-progid/span.swc-stderr @@ -639,7 +639,7 @@ 4 | } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/ie-progid/input.css:2:1] 2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0); 3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); diff --git a/crates/swc_css_parser/tests/recovery/number/span.swc-stderr b/crates/swc_css_parser/tests/recovery/number/span.swc-stderr index a22546689589..d07c2a8da472 100644 --- a/crates/swc_css_parser/tests/recovery/number/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/number/span.swc-stderr @@ -165,7 +165,7 @@ 4 | prop2: 10 `---- - x WhiteSpace(WhiteSpaceToken { value: "\n " }) + x WhiteSpace { value: "\n " } ,-[$DIR/tests/recovery/number/input.css:1:1] 1 | a { 2 | ,-> prop: 10.10px @@ -213,7 +213,7 @@ 4 | prop2: 10 `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/number/input.css:2:1] 2 | prop: 10.10px 3 | prop1: 10px @@ -245,7 +245,7 @@ 5 | prop3: 10.10 `---- - x WhiteSpace(WhiteSpaceToken { value: "\n " }) + x WhiteSpace { value: "\n " } ,-[$DIR/tests/recovery/number/input.css:2:1] 2 | prop: 10.10px 3 | ,-> prop1: 10px @@ -293,7 +293,7 @@ 5 | prop3: 10.10 `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/number/input.css:3:1] 3 | prop1: 10px 4 | prop2: 10 @@ -325,7 +325,7 @@ 6 | } `---- - x WhiteSpace(WhiteSpaceToken { value: "\n " }) + x WhiteSpace { value: "\n " } ,-[$DIR/tests/recovery/number/input.css:3:1] 3 | prop1: 10px 4 | ,-> prop2: 10 @@ -373,7 +373,7 @@ 6 | } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/number/input.css:4:1] 4 | prop2: 10 5 | prop3: 10.10 diff --git a/crates/swc_css_parser/tests/recovery/qualified-rule/basic/span.swc-stderr b/crates/swc_css_parser/tests/recovery/qualified-rule/basic/span.swc-stderr index adbb33b26535..b307b6dccae4 100644 --- a/crates/swc_css_parser/tests/recovery/qualified-rule/basic/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/qualified-rule/basic/span.swc-stderr @@ -56,7 +56,7 @@ : ^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/qualified-rule/basic/input.css:1:1] 1 | // test : ^ @@ -82,7 +82,7 @@ 4 | color: red; `---- - x WhiteSpace(WhiteSpaceToken { value: "\n\n" }) + x WhiteSpace { value: "\n\n" } ,-[$DIR/tests/recovery/qualified-rule/basic/input.css:1:1] 1 | ,-> // test 2 | `-> @@ -114,7 +114,7 @@ 4 | color: red; `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/qualified-rule/basic/input.css:2:1] 2 | 3 | a { diff --git a/crates/swc_css_parser/tests/recovery/qualified-rule/double-slash-comment/span.swc-stderr b/crates/swc_css_parser/tests/recovery/qualified-rule/double-slash-comment/span.swc-stderr index 4bbdbe38e6a2..6845c8fcd410 100644 --- a/crates/swc_css_parser/tests/recovery/qualified-rule/double-slash-comment/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/qualified-rule/double-slash-comment/span.swc-stderr @@ -58,7 +58,7 @@ 2 | a { `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/qualified-rule/double-slash-comment/input.css:1:1] 1 | // test : ^ @@ -87,7 +87,7 @@ 3 | color: red; `---- - x WhiteSpace(WhiteSpaceToken { value: "\n" }) + x WhiteSpace { value: "\n" } ,-[$DIR/tests/recovery/qualified-rule/double-slash-comment/input.css:1:1] 1 | // test : ^ @@ -119,7 +119,7 @@ 3 | color: red; `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/qualified-rule/double-slash-comment/input.css:1:1] 1 | // test 2 | a { diff --git a/crates/swc_css_parser/tests/recovery/rules/at-rule-in-middle/span.swc-stderr b/crates/swc_css_parser/tests/recovery/rules/at-rule-in-middle/span.swc-stderr index 6624ddf581f9..d08528b9ae25 100644 --- a/crates/swc_css_parser/tests/recovery/rules/at-rule-in-middle/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/rules/at-rule-in-middle/span.swc-stderr @@ -196,7 +196,7 @@ 5 | a { color: blue } `---- - x WhiteSpace(WhiteSpaceToken { value: "\n\n" }) + x WhiteSpace { value: "\n\n" } ,-[$DIR/tests/recovery/rules/at-rule-in-middle/input.css:2:1] 2 | 3 | ,-> @media {}; @@ -225,7 +225,7 @@ : ^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/rules/at-rule-in-middle/input.css:4:1] 4 | 5 | a { color: blue } diff --git a/crates/swc_css_parser/tests/recovery/rules/at-rule-with-semi/span.swc-stderr b/crates/swc_css_parser/tests/recovery/rules/at-rule-with-semi/span.swc-stderr index ea9f231c65fe..1a37ac45abf3 100644 --- a/crates/swc_css_parser/tests/recovery/rules/at-rule-with-semi/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/rules/at-rule-with-semi/span.swc-stderr @@ -77,7 +77,7 @@ 3 | a { color: red } `---- - x WhiteSpace(WhiteSpaceToken { value: "\n\n" }) + x WhiteSpace { value: "\n\n" } ,-[$DIR/tests/recovery/rules/at-rule-with-semi/input.css:1:1] 1 | ,-> @media {}; 2 | `-> @@ -105,7 +105,7 @@ : ^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/rules/at-rule-with-semi/input.css:2:1] 2 | 3 | a { color: red } diff --git a/crates/swc_css_parser/tests/recovery/rules/unclosed-brackets/span.swc-stderr b/crates/swc_css_parser/tests/recovery/rules/unclosed-brackets/span.swc-stderr index e6cb87762d1e..88382c19043d 100644 --- a/crates/swc_css_parser/tests/recovery/rules/unclosed-brackets/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/rules/unclosed-brackets/span.swc-stderr @@ -103,7 +103,7 @@ : ^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/rules/unclosed-brackets/input.css:1:1] 1 | .class[attr= { : ^ @@ -136,7 +136,7 @@ 3 | } `---- - x WhiteSpace(WhiteSpaceToken { value: "\n\n" }) + x WhiteSpace { value: "\n\n" } ,-[$DIR/tests/recovery/rules/unclosed-brackets/input.css:1:1] 1 | ,-> .class[attr= { 2 | `-> @@ -151,7 +151,7 @@ 5 | .class { color: red } `---- - x WhiteSpace(WhiteSpaceToken { value: "\n\n" }) + x WhiteSpace { value: "\n\n" } ,-[$DIR/tests/recovery/rules/unclosed-brackets/input.css:2:1] 2 | 3 | ,-> } @@ -194,7 +194,7 @@ : ^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/rules/unclosed-brackets/input.css:4:1] 4 | 5 | .class { color: red } @@ -229,7 +229,7 @@ : ^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/rules/unclosed-brackets/input.css:4:1] 4 | 5 | .class { color: red } @@ -271,7 +271,7 @@ : ^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/rules/unclosed-brackets/input.css:4:1] 4 | 5 | .class { color: red } @@ -299,7 +299,7 @@ : ^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/rules/unclosed-brackets/input.css:4:1] 4 | 5 | .class { color: red } @@ -314,7 +314,7 @@ 7 | .class { color: blue } `---- - x WhiteSpace(WhiteSpaceToken { value: "\n\n" }) + x WhiteSpace { value: "\n\n" } ,-[$DIR/tests/recovery/rules/unclosed-brackets/input.css:4:1] 4 | 5 | ,-> .class { color: red } @@ -357,7 +357,7 @@ : ^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/rules/unclosed-brackets/input.css:6:1] 6 | 7 | .class { color: blue } @@ -392,7 +392,7 @@ : ^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/rules/unclosed-brackets/input.css:6:1] 6 | 7 | .class { color: blue } @@ -434,7 +434,7 @@ : ^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/rules/unclosed-brackets/input.css:6:1] 6 | 7 | .class { color: blue } @@ -462,7 +462,7 @@ : ^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/rules/unclosed-brackets/input.css:6:1] 6 | 7 | .class { color: blue } diff --git a/crates/swc_css_parser/tests/recovery/rules/unclosed-curly/span.swc-stderr b/crates/swc_css_parser/tests/recovery/rules/unclosed-curly/span.swc-stderr index c189b92a77cc..ad2f879ed3b4 100644 --- a/crates/swc_css_parser/tests/recovery/rules/unclosed-curly/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/rules/unclosed-curly/span.swc-stderr @@ -65,7 +65,7 @@ 3 | a { color: red } `---- - x WhiteSpace(WhiteSpaceToken { value: "\n\n" }) + x WhiteSpace { value: "\n\n" } ,-[$DIR/tests/recovery/rules/unclosed-curly/input.css:1:1] 1 | ,-> test}; 2 | `-> @@ -93,7 +93,7 @@ : ^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/rules/unclosed-curly/input.css:2:1] 2 | 3 | a { color: red } diff --git a/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-matcher-1/span.swc-stderr b/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-matcher-1/span.swc-stderr index f50946900166..5745901253e2 100644 --- a/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-matcher-1/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-matcher-1/span.swc-stderr @@ -65,7 +65,7 @@ : ^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/selector/attribute/invalid-matcher-1/input.css:1:1] 1 | [href=] {} : ^ diff --git a/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-matcher-2/span.swc-stderr b/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-matcher-2/span.swc-stderr index 7927c6d0ba28..bf7d5225d48e 100644 --- a/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-matcher-2/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-matcher-2/span.swc-stderr @@ -89,7 +89,7 @@ : ^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/selector/attribute/invalid-matcher-2/input.css:1:1] 1 | [href#="test"] {} : ^ diff --git a/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-matcher-3/span.swc-stderr b/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-matcher-3/span.swc-stderr index be5f0b22d815..895b879697da 100644 --- a/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-matcher-3/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-matcher-3/span.swc-stderr @@ -76,7 +76,7 @@ 2 | color: purple; `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/selector/attribute/invalid-matcher-3/input.css:1:1] 1 | a[title * = "title" i ] { : ^ @@ -104,7 +104,7 @@ 2 | color: purple; `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/selector/attribute/invalid-matcher-3/input.css:1:1] 1 | a[title * = "title" i ] { : ^ @@ -132,7 +132,7 @@ 2 | color: purple; `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/selector/attribute/invalid-matcher-3/input.css:1:1] 1 | a[title * = "title" i ] { : ^ @@ -160,7 +160,7 @@ 2 | color: purple; `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/selector/attribute/invalid-matcher-3/input.css:1:1] 1 | a[title * = "title" i ] { : ^ @@ -188,7 +188,7 @@ 2 | color: purple; `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/selector/attribute/invalid-matcher-3/input.css:1:1] 1 | a[title * = "title" i ] { : ^ @@ -202,7 +202,7 @@ 2 | color: purple; `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/selector/attribute/invalid-matcher-3/input.css:1:1] 1 | a[title * = "title" i ] { : ^ diff --git a/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-matcher-4/span.swc-stderr b/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-matcher-4/span.swc-stderr index 6f5c376a6b74..3954b6bd639b 100644 --- a/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-matcher-4/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-matcher-4/span.swc-stderr @@ -118,7 +118,7 @@ 2 | color: purple; `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/selector/attribute/invalid-matcher-4/input.css:1:1] 1 | a[title%="title"] { : ^ diff --git a/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-matcher/span.swc-stderr b/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-matcher/span.swc-stderr index 10a028ac3ff9..53ea0ab902ad 100644 --- a/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-matcher/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-matcher/span.swc-stderr @@ -89,7 +89,7 @@ : ^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/selector/attribute/invalid-matcher/input.css:1:1] 1 | [href==".org"] {} : ^ diff --git a/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-modifier/span.swc-stderr b/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-modifier/span.swc-stderr index 91e7c0f9f54d..62341610cbce 100644 --- a/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-modifier/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-modifier/span.swc-stderr @@ -77,7 +77,7 @@ : ^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/selector/attribute/invalid-modifier/input.css:1:1] 1 | [href="test" "z"] {} : ^ @@ -101,7 +101,7 @@ : ^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/selector/attribute/invalid-modifier/input.css:1:1] 1 | [href="test" "z"] {} : ^ diff --git a/crates/swc_css_parser/tests/recovery/selector/attribute/unclosed/span.swc-stderr b/crates/swc_css_parser/tests/recovery/selector/attribute/unclosed/span.swc-stderr index 6cad6c6c65de..30776fd316d8 100644 --- a/crates/swc_css_parser/tests/recovery/selector/attribute/unclosed/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/selector/attribute/unclosed/span.swc-stderr @@ -87,7 +87,7 @@ : ^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/selector/attribute/unclosed/input.css:1:1] 1 | .class[attr= { : ^ @@ -120,7 +120,7 @@ 3 | } `---- - x WhiteSpace(WhiteSpaceToken { value: "\n\n" }) + x WhiteSpace { value: "\n\n" } ,-[$DIR/tests/recovery/selector/attribute/unclosed/input.css:1:1] 1 | ,-> .class[attr= { 2 | `-> @@ -134,7 +134,7 @@ : ^ `---- - x WhiteSpace(WhiteSpaceToken { value: "\n" }) + x WhiteSpace { value: "\n" } ,-[$DIR/tests/recovery/selector/attribute/unclosed/input.css:2:1] 2 | 3 | } diff --git a/crates/swc_css_parser/tests/recovery/selector/combinator/only/span.swc-stderr b/crates/swc_css_parser/tests/recovery/selector/combinator/only/span.swc-stderr index 04be8a4535c7..d3fa9346ac74 100644 --- a/crates/swc_css_parser/tests/recovery/selector/combinator/only/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/selector/combinator/only/span.swc-stderr @@ -38,7 +38,7 @@ : ^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/selector/combinator/only/input.css:1:1] 1 | > { : ^ diff --git a/crates/swc_css_parser/tests/recovery/selector/combinator/two/span.swc-stderr b/crates/swc_css_parser/tests/recovery/selector/combinator/two/span.swc-stderr index 41b8d1123517..0103d6487b26 100644 --- a/crates/swc_css_parser/tests/recovery/selector/combinator/two/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/selector/combinator/two/span.swc-stderr @@ -35,7 +35,7 @@ : ^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/selector/combinator/two/input.css:1:1] 1 | span ~ + {} : ^ @@ -59,7 +59,7 @@ : ^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/selector/combinator/two/input.css:1:1] 1 | span ~ + {} : ^ @@ -83,7 +83,7 @@ : ^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/selector/combinator/two/input.css:1:1] 1 | span ~ + {} : ^ diff --git a/crates/swc_css_parser/tests/recovery/selector/id/invalid/span.swc-stderr b/crates/swc_css_parser/tests/recovery/selector/id/invalid/span.swc-stderr index b6c8fab5d7ff..b561150bd8c9 100644 --- a/crates/swc_css_parser/tests/recovery/selector/id/invalid/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/selector/id/invalid/span.swc-stderr @@ -38,7 +38,7 @@ : ^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/selector/id/invalid/input.css:1:1] 1 | #1234 { : ^ diff --git a/crates/swc_css_parser/tests/recovery/selector/list/span.swc-stderr b/crates/swc_css_parser/tests/recovery/selector/list/span.swc-stderr index b740a20f382a..b05c09058a7a 100644 --- a/crates/swc_css_parser/tests/recovery/selector/list/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/selector/list/span.swc-stderr @@ -38,7 +38,7 @@ 2 | } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/selector/list/input.css:1:1] 1 | , { : ^ diff --git a/crates/swc_css_parser/tests/recovery/selector/pseudo-class/invalid-function/span.swc-stderr b/crates/swc_css_parser/tests/recovery/selector/pseudo-class/invalid-function/span.swc-stderr index 5429b9a5733d..1994da77f681 100644 --- a/crates/swc_css_parser/tests/recovery/selector/pseudo-class/invalid-function/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/selector/pseudo-class/invalid-function/span.swc-stderr @@ -38,7 +38,7 @@ : ^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/selector/pseudo-class/invalid-function/input.css:1:1] 1 | : nth-child(2) { : ^ @@ -80,7 +80,7 @@ : ^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/selector/pseudo-class/invalid-function/input.css:1:1] 1 | : nth-child(2) { : ^ diff --git a/crates/swc_css_parser/tests/recovery/selector/pseudo-class/invalid-ident/span.swc-stderr b/crates/swc_css_parser/tests/recovery/selector/pseudo-class/invalid-ident/span.swc-stderr index 2a87881b6c2d..fb28840e4e50 100644 --- a/crates/swc_css_parser/tests/recovery/selector/pseudo-class/invalid-ident/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/selector/pseudo-class/invalid-ident/span.swc-stderr @@ -41,7 +41,7 @@ 2 | `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/selector/pseudo-class/invalid-ident/input.css:1:1] 1 | : first-child { : ^ @@ -69,7 +69,7 @@ 2 | `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/selector/pseudo-class/invalid-ident/input.css:1:1] 1 | : first-child { : ^ diff --git a/crates/swc_css_parser/tests/recovery/selector/pseudo-class/invalid/span.swc-stderr b/crates/swc_css_parser/tests/recovery/selector/pseudo-class/invalid/span.swc-stderr index 6f68380a8b96..e9c7fc5cb381 100644 --- a/crates/swc_css_parser/tests/recovery/selector/pseudo-class/invalid/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/selector/pseudo-class/invalid/span.swc-stderr @@ -50,7 +50,7 @@ : ^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/selector/pseudo-class/invalid/input.css:1:1] 1 | a: b {} : ^ @@ -74,7 +74,7 @@ : ^ `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/selector/pseudo-class/invalid/input.css:1:1] 1 | a: b {} : ^ @@ -148,7 +148,7 @@ 4 | color: red; `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/selector/pseudo-class/invalid/input.css:2:1] 2 | 3 | a: b { @@ -180,7 +180,7 @@ 4 | color: red; `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/selector/pseudo-class/invalid/input.css:2:1] 2 | 3 | a: b { diff --git a/crates/swc_css_parser/tests/recovery/selector/pseudo-element/after/span.swc-stderr b/crates/swc_css_parser/tests/recovery/selector/pseudo-element/after/span.swc-stderr index 58eca1c4c696..768e5528bedd 100644 --- a/crates/swc_css_parser/tests/recovery/selector/pseudo-element/after/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/selector/pseudo-element/after/span.swc-stderr @@ -55,7 +55,7 @@ 2 | `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/selector/pseudo-element/after/input.css:1:1] 1 | :: foo { : ^ @@ -83,7 +83,7 @@ 2 | `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/selector/pseudo-element/after/input.css:1:1] 1 | :: foo { : ^ diff --git a/crates/swc_css_parser/tests/recovery/selector/pseudo-element/between/span.swc-stderr b/crates/swc_css_parser/tests/recovery/selector/pseudo-element/between/span.swc-stderr index b8f77c92cd72..a835f8cd47ea 100644 --- a/crates/swc_css_parser/tests/recovery/selector/pseudo-element/between/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/selector/pseudo-element/between/span.swc-stderr @@ -41,7 +41,7 @@ 2 | `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/selector/pseudo-element/between/input.css:1:1] 1 | : :foo { : ^ @@ -83,7 +83,7 @@ 2 | `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/selector/pseudo-element/between/input.css:1:1] 1 | : :foo { : ^ diff --git a/crates/swc_css_parser/tests/recovery/selector/pseudo-element/invalid/span.swc-stderr b/crates/swc_css_parser/tests/recovery/selector/pseudo-element/invalid/span.swc-stderr index eed53337b2e4..3d7ededd9062 100644 --- a/crates/swc_css_parser/tests/recovery/selector/pseudo-element/invalid/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/selector/pseudo-element/invalid/span.swc-stderr @@ -80,7 +80,7 @@ 2 | } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/selector/pseudo-element/invalid/input.css:1:1] 1 | a::1 { : ^ diff --git a/crates/swc_css_parser/tests/recovery/style-blocks-contents/basic/span.swc-stderr b/crates/swc_css_parser/tests/recovery/style-blocks-contents/basic/span.swc-stderr index e021a32c306b..f76b4af878db 100644 --- a/crates/swc_css_parser/tests/recovery/style-blocks-contents/basic/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/style-blocks-contents/basic/span.swc-stderr @@ -359,7 +359,7 @@ 7 | } `---- - x WhiteSpace(WhiteSpaceToken { value: "\n " }) + x WhiteSpace { value: "\n " } ,-[$DIR/tests/recovery/style-blocks-contents/basic/input.css:4:1] 4 | &.foo { 5 | ,-> ident @@ -407,7 +407,7 @@ 7 | } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/style-blocks-contents/basic/input.css:5:1] 5 | ident 6 | color: green; @@ -834,7 +834,7 @@ 15 | } `---- - x WhiteSpace(WhiteSpaceToken { value: "\n " }) + x WhiteSpace { value: "\n " } ,-[$DIR/tests/recovery/style-blocks-contents/basic/input.css:12:1] 12 | & .class { 13 | ,-> ident @@ -882,7 +882,7 @@ 15 | } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/style-blocks-contents/basic/input.css:13:1] 13 | ident 14 | color: red @@ -914,7 +914,7 @@ 16 | } `---- - x WhiteSpace(WhiteSpaceToken { value: " \n " }) + x WhiteSpace { value: " \n " } ,-[$DIR/tests/recovery/style-blocks-contents/basic/input.css:13:1] 13 | ident 14 | ,-> color: red @@ -1933,7 +1933,7 @@ 40 | } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/style-blocks-contents/basic/input.css:38:1] 38 | color: red; 39 | & test; @@ -2207,7 +2207,7 @@ 47 | } `---- - x WhiteSpace(WhiteSpaceToken { value: "\n " }) + x WhiteSpace { value: "\n " } ,-[$DIR/tests/recovery/style-blocks-contents/basic/input.css:44:1] 44 | &.foo { 45 | ,-> __ident__ diff --git a/crates/swc_css_parser/tests/recovery/style-blocks-contents/invalid-nested-1/span.swc-stderr b/crates/swc_css_parser/tests/recovery/style-blocks-contents/invalid-nested-1/span.swc-stderr index d0b54c2ca2f1..9dceed9a1105 100644 --- a/crates/swc_css_parser/tests/recovery/style-blocks-contents/invalid-nested-1/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/style-blocks-contents/invalid-nested-1/span.swc-stderr @@ -190,7 +190,7 @@ 5 | margin: 1em; `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/style-blocks-contents/invalid-nested-1/input.css:3:1] 3 | 4 | input { @@ -232,7 +232,7 @@ 6 | } `---- - x WhiteSpace(WhiteSpaceToken { value: "\n " }) + x WhiteSpace { value: "\n " } ,-[$DIR/tests/recovery/style-blocks-contents/invalid-nested-1/input.css:3:1] 3 | 4 | ,-> input { @@ -280,7 +280,7 @@ 6 | } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/style-blocks-contents/invalid-nested-1/input.css:4:1] 4 | input { 5 | margin: 1em; @@ -328,7 +328,7 @@ 7 | } `---- - x WhiteSpace(WhiteSpaceToken { value: "\n " }) + x WhiteSpace { value: "\n " } ,-[$DIR/tests/recovery/style-blocks-contents/invalid-nested-1/input.css:4:1] 4 | input { 5 | ,-> margin: 1em; @@ -344,7 +344,7 @@ 7 | } `---- - x WhiteSpace(WhiteSpaceToken { value: "\n" }) + x WhiteSpace { value: "\n" } ,-[$DIR/tests/recovery/style-blocks-contents/invalid-nested-1/input.css:5:1] 5 | margin: 1em; 6 | } diff --git a/crates/swc_css_parser/tests/recovery/style-blocks-contents/invalid-nested-2/span.swc-stderr b/crates/swc_css_parser/tests/recovery/style-blocks-contents/invalid-nested-2/span.swc-stderr index 94046e077780..905071627a3a 100644 --- a/crates/swc_css_parser/tests/recovery/style-blocks-contents/invalid-nested-2/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/style-blocks-contents/invalid-nested-2/span.swc-stderr @@ -187,7 +187,7 @@ 4 | background: red `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/style-blocks-contents/invalid-nested-2/input.css:2:1] 2 | color: red; 3 | & test; diff --git a/crates/swc_css_parser/tests/recovery/style-blocks-contents/invalid-nested/span.swc-stderr b/crates/swc_css_parser/tests/recovery/style-blocks-contents/invalid-nested/span.swc-stderr index f70236ca2789..6ffb6e566110 100644 --- a/crates/swc_css_parser/tests/recovery/style-blocks-contents/invalid-nested/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/style-blocks-contents/invalid-nested/span.swc-stderr @@ -187,7 +187,7 @@ 4 | background: red; `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/style-blocks-contents/invalid-nested/input.css:2:1] 2 | color: red; 3 | & test; diff --git a/crates/swc_css_parser/tests/recovery/styled-jsx/1/span.swc-stderr b/crates/swc_css_parser/tests/recovery/styled-jsx/1/span.swc-stderr index 2a00e07fc291..b8ef7199d8c8 100644 --- a/crates/swc_css_parser/tests/recovery/styled-jsx/1/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/styled-jsx/1/span.swc-stderr @@ -405,7 +405,7 @@ 8 | padding: __styled-jsx-placeholder__1; `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/styled-jsx/1/input.css:6:1] 6 | 7 | .removed-214123 :global(> .removed-214123-item) { @@ -929,7 +929,7 @@ 16 | flex-basis: __styled-jsx-placeholder__3%; `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/styled-jsx/1/input.css:14:1] 14 | @media screen { 15 | .removed-214123 :global(> .removed-214123-item) { @@ -1283,7 +1283,7 @@ 22 | flex-basis: __styled-jsx-placeholder__4%; `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/styled-jsx/1/input.css:20:1] 20 | @media screen { 21 | .removed-214123 :global(> .removed-214123-item) { diff --git a/crates/swc_css_parser/tests/recovery/styled-jsx/2/span.swc-stderr b/crates/swc_css_parser/tests/recovery/styled-jsx/2/span.swc-stderr index 97a6d84e2f09..3db8ee9de8e0 100644 --- a/crates/swc_css_parser/tests/recovery/styled-jsx/2/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/styled-jsx/2/span.swc-stderr @@ -118,7 +118,7 @@ 2 | flex-basis: __styled-jsx-placeholder__0%; `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/styled-jsx/2/input.css:1:1] 1 | .a :global(> .b) { : ^ diff --git a/crates/swc_css_parser/tests/recovery/value/custom-properties/only-dashed/span.swc-stderr b/crates/swc_css_parser/tests/recovery/value/custom-properties/only-dashed/span.swc-stderr index 1a093f565027..38ce97af6c44 100644 --- a/crates/swc_css_parser/tests/recovery/value/custom-properties/only-dashed/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/value/custom-properties/only-dashed/span.swc-stderr @@ -304,7 +304,7 @@ 7 | } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/value/custom-properties/only-dashed/input.css:5:1] 5 | .a { 6 | counter-reset: -- --a -a; @@ -336,7 +336,7 @@ 7 | } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/value/custom-properties/only-dashed/input.css:5:1] 5 | .a { 6 | counter-reset: -- --a -a; diff --git a/crates/swc_css_parser/tests/recovery/value/quotes/span.swc-stderr b/crates/swc_css_parser/tests/recovery/value/quotes/span.swc-stderr index 8d49775fe1f3..faea4a0f6589 100644 --- a/crates/swc_css_parser/tests/recovery/value/quotes/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/value/quotes/span.swc-stderr @@ -172,7 +172,7 @@ 4 | } `---- - x WhiteSpace(WhiteSpaceToken { value: "\n " }) + x WhiteSpace { value: "\n " } ,-[$DIR/tests/recovery/value/quotes/input.css:1:1] 1 | p::before { 2 | ,-> content: "tes diff --git a/crates/swc_css_parser/tests/recovery/value/url/basic/span.swc-stderr b/crates/swc_css_parser/tests/recovery/value/url/basic/span.swc-stderr index cdc5f4c526fe..c0939ab340dd 100644 --- a/crates/swc_css_parser/tests/recovery/value/url/basic/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/value/url/basic/span.swc-stderr @@ -1055,7 +1055,7 @@ 18 | } `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/value/url/basic/input.css:16:1] 16 | .style { 17 | background: url("foo", "bar"); diff --git a/crates/swc_css_parser/tests/recovery/vercel/001/span.swc-stderr b/crates/swc_css_parser/tests/recovery/vercel/001/span.swc-stderr index 42df901f918f..a02b20df9dc2 100644 --- a/crates/swc_css_parser/tests/recovery/vercel/001/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/vercel/001/span.swc-stderr @@ -1049,7 +1049,7 @@ 15 | } `---- - x WhiteSpace(WhiteSpaceToken { value: "\n" }) + x WhiteSpace { value: "\n" } ,-[$DIR/tests/recovery/vercel/001/input.css:13:1] 13 | } 14 | __styled-jsx-placeholder__7 diff --git a/crates/swc_css_parser/tests/recovery/vercel/002/span.swc-stderr b/crates/swc_css_parser/tests/recovery/vercel/002/span.swc-stderr index e6c84e3e5632..43d42abbdd88 100644 --- a/crates/swc_css_parser/tests/recovery/vercel/002/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/vercel/002/span.swc-stderr @@ -328,7 +328,7 @@ 5 | border-radius: 7px; `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/vercel/002/input.css:3:1] 3 | height: __styled-jsx-placeholder__7px; 4 | margin: 0 calc(__styled-jsx-placeholder__7vw - __styled-jsx-placeholder__7px); @@ -360,7 +360,7 @@ 5 | border-radius: 7px; `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/vercel/002/input.css:3:1] 3 | height: __styled-jsx-placeholder__7px; 4 | margin: 0 calc(__styled-jsx-placeholder__7vw - __styled-jsx-placeholder__7px); diff --git a/crates/swc_css_parser/tests/recovery/vercel/003/span.swc-stderr b/crates/swc_css_parser/tests/recovery/vercel/003/span.swc-stderr index 1d88885f4207..1a93d038e2e8 100644 --- a/crates/swc_css_parser/tests/recovery/vercel/003/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/vercel/003/span.swc-stderr @@ -455,7 +455,7 @@ 8 | padding: __ident__; `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/vercel/003/input.css:6:1] 6 | } 7 | .geist-list :global(> .geist-list-item) { diff --git a/crates/swc_css_parser/tests/recovery/vercel/004/span.swc-stderr b/crates/swc_css_parser/tests/recovery/vercel/004/span.swc-stderr index 69564704dcf6..f13a19d212da 100644 --- a/crates/swc_css_parser/tests/recovery/vercel/004/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/vercel/004/span.swc-stderr @@ -224,7 +224,7 @@ 5 | color: white; `---- - x WhiteSpace(WhiteSpaceToken { value: "\n " }) + x WhiteSpace { value: "\n " } ,-[$DIR/tests/recovery/vercel/004/input.css:2:1] 2 | margin: 0; 3 | ,-> __ident__ @@ -272,7 +272,7 @@ 5 | color: white; `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/vercel/004/input.css:3:1] 3 | __ident__ 4 | border-radius: 7px; @@ -464,7 +464,7 @@ 9 | } `---- - x WhiteSpace(WhiteSpaceToken { value: "\n " }) + x WhiteSpace { value: "\n " } ,-[$DIR/tests/recovery/vercel/004/input.css:6:1] 6 | background: __ident__; 7 | ,-> __ident__ @@ -496,7 +496,7 @@ 9 | } `---- - x WhiteSpace(WhiteSpaceToken { value: "\n" }) + x WhiteSpace { value: "\n" } ,-[$DIR/tests/recovery/vercel/004/input.css:7:1] 7 | __ident__ 8 | __ident__ diff --git a/crates/swc_css_parser/tests/recovery/vercel/005/span.swc-stderr b/crates/swc_css_parser/tests/recovery/vercel/005/span.swc-stderr index de8ee677c23e..578bb3196e38 100644 --- a/crates/swc_css_parser/tests/recovery/vercel/005/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/vercel/005/span.swc-stderr @@ -152,7 +152,7 @@ 5 | color: white; `---- - x WhiteSpace(WhiteSpaceToken { value: "\n " }) + x WhiteSpace { value: "\n " } ,-[$DIR/tests/recovery/vercel/005/input.css:2:1] 2 | margin: 0; 3 | ,-> __ident__ @@ -200,7 +200,7 @@ 5 | color: white; `---- - x WhiteSpace(WhiteSpaceToken { value: " " }) + x WhiteSpace { value: " " } ,-[$DIR/tests/recovery/vercel/005/input.css:3:1] 3 | __ident__ 4 | border-radius: 7px; @@ -368,7 +368,7 @@ 9 | } `---- - x WhiteSpace(WhiteSpaceToken { value: "\n " }) + x WhiteSpace { value: "\n " } ,-[$DIR/tests/recovery/vercel/005/input.css:6:1] 6 | background: __ident__; 7 | ,-> __ident__ @@ -400,7 +400,7 @@ 9 | } `---- - x WhiteSpace(WhiteSpaceToken { value: "\n" }) + x WhiteSpace { value: "\n" } ,-[$DIR/tests/recovery/vercel/005/input.css:7:1] 7 | __ident__ 8 | __ident__ From 54c7fa30b05a30e2687cfd69ae1907efe9b48be7 Mon Sep 17 00:00:00 2001 From: "alexander.akait" Date: Mon, 5 Dec 2022 03:50:28 +0300 Subject: [PATCH 35/42] refactor: unwrap often whitespace token --- crates/swc_css_codegen/src/lib.rs | 4 ++-- crates/swc_css_codegen/tests/fixture.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/swc_css_codegen/src/lib.rs b/crates/swc_css_codegen/src/lib.rs index 1d9281f3c4e4..9b2e72cbfa46 100644 --- a/crates/swc_css_codegen/src/lib.rs +++ b/crates/swc_css_codegen/src/lib.rs @@ -2058,8 +2058,8 @@ where write_raw!(self, span, &hash); } - Token::WhiteSpace(token) => { - write_str!(self, span, &token.value); + Token::WhiteSpace { value } => { + write_str!(self, span, value); } Token::CDC => { write_raw!(self, span, "-->"); diff --git a/crates/swc_css_codegen/tests/fixture.rs b/crates/swc_css_codegen/tests/fixture.rs index 58a4596946a4..4fd5a859e97d 100644 --- a/crates/swc_css_codegen/tests/fixture.rs +++ b/crates/swc_css_codegen/tests/fixture.rs @@ -382,7 +382,7 @@ impl VisitMut for NormalizeTest { n.visit_mut_children_with(self); if let Token::WhiteSpace { .. } = &n.token { - n.token = Token::WhiteSpace(Box::new(WhiteSpaceToken { value: "".into() })) + n.token = Token::WhiteSpace { value: "".into() }; } } From e1b14dfed9d35c023f4ec5efcea7a6fc5bd84a1f Mon Sep 17 00:00:00 2001 From: "alexander.akait" Date: Mon, 5 Dec 2022 04:41:33 +0300 Subject: [PATCH 36/42] refactor: unwrap often whitespace token --- crates/swc_css_ast/src/token.rs | 223 ++++++------------ crates/swc_css_codegen/src/lib.rs | 52 ++-- crates/swc_css_minifier/src/compressor/mod.rs | 16 +- crates/swc_css_parser/src/lexer/mod.rs | 84 ++++--- crates/swc_css_parser/src/macros.rs | 34 +-- .../swc_css_parser/src/parser/at_rules/mod.rs | 70 ++---- crates/swc_css_parser/src/parser/input.rs | 6 +- crates/swc_css_parser/src/parser/macros.rs | 6 +- .../src/parser/selectors/mod.rs | 28 +-- .../swc_css_parser/src/parser/syntax/mod.rs | 14 +- crates/swc_css_parser/src/parser/util.rs | 2 +- .../src/parser/values_and_units/mod.rs | 190 ++++++--------- 12 files changed, 288 insertions(+), 437 deletions(-) diff --git a/crates/swc_css_ast/src/token.rs b/crates/swc_css_ast/src/token.rs index d2a792dc6ea8..3b05833e4403 100644 --- a/crates/swc_css_ast/src/token.rs +++ b/crates/swc_css_ast/src/token.rs @@ -35,71 +35,6 @@ pub enum NumberType { Number, } -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, EqIgnoreSpan)] -#[cfg_attr( - feature = "rkyv", - derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize) -)] -pub struct IdentToken { - #[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))] - pub value: JsWord, - pub raw: Atom, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, EqIgnoreSpan)] -#[cfg_attr( - feature = "rkyv", - derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize) -)] -pub struct FunctionToken { - #[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))] - pub value: JsWord, - pub raw: Atom, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, EqIgnoreSpan)] -#[cfg_attr( - feature = "rkyv", - derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize) -)] -pub struct AtKeywordToken { - #[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))] - pub value: JsWord, - pub raw: Atom, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, EqIgnoreSpan)] -#[cfg_attr( - feature = "rkyv", - derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize) -)] -pub struct HashToken { - pub is_id: bool, - #[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))] - pub value: JsWord, - pub raw: Atom, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, EqIgnoreSpan)] -#[cfg_attr( - feature = "rkyv", - derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize) -)] -pub struct StringToken { - #[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))] - pub value: JsWord, - pub raw: Atom, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, EqIgnoreSpan)] -#[cfg_attr( - feature = "rkyv", - derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize) -)] -pub struct BadStringToken { - pub raw: Atom, -} - /// `url(value)` #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, EqIgnoreSpan)] #[cfg_attr( @@ -115,47 +50,6 @@ pub struct UrlToken { pub raw: Box<(Atom, Atom)>, } -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, EqIgnoreSpan)] -#[cfg_attr( - feature = "rkyv", - derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize) -)] -pub struct BadUrlToken { - /// Name and value - pub raw: Box<(Atom, Atom)>, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, EqIgnoreSpan)] -#[cfg_attr( - feature = "rkyv", - derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize) -)] -pub struct DelimToken { - pub value: char, -} - -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, EqIgnoreSpan)] -#[cfg_attr( - feature = "rkyv", - derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize) -)] -pub struct NumberToken { - pub value: f64, - pub raw: Atom, - #[serde(rename = "type")] - pub type_flag: NumberType, -} - -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, EqIgnoreSpan)] -#[cfg_attr( - feature = "rkyv", - derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize) -)] -pub struct PercentageToken { - pub value: f64, - pub raw: Atom, -} - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, EqIgnoreSpan)] #[cfg_attr( feature = "rkyv", @@ -185,20 +79,55 @@ pub struct DimensionToken { )) )] pub enum Token { - Ident(Box), - Function(Box), + Ident { + #[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))] + value: JsWord, + raw: Atom, + }, + Function { + #[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))] + value: JsWord, + raw: Atom, + }, /// `@` - AtKeyword(Box), + AtKeyword { + #[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))] + value: JsWord, + raw: Atom, + }, /// `#` - Hash(Box), - String(Box), - BadString(Box), + Hash { + is_id: bool, + #[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))] + value: JsWord, + raw: Atom, + }, + String { + #[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))] + value: JsWord, + raw: Atom, + }, + BadString { + raw: Atom, + }, /// `url(value)` Url(Box), - BadUrl(Box), - Delim(Box), - Number(Box), - Percentage(Box), + BadUrl { + raw: Box<(Atom, Atom)>, + }, + Delim { + value: char, + }, + Number { + value: f64, + raw: Atom, + #[serde(rename = "type")] + type_flag: NumberType, + }, + Percentage { + value: f64, + raw: Atom, + }, Dimension(Box), /// One or more whitespace. WhiteSpace { @@ -247,49 +176,53 @@ impl Hash for Token { } match self { - Token::Ident(ident) => { - ident.value.hash(state); - ident.raw.hash(state); + Token::Ident { value, raw } => { + value.hash(state); + raw.hash(state); } - Token::Function(function) => { - function.value.hash(state); - function.raw.hash(state); + Token::Function { value, raw } => { + value.hash(state); + raw.hash(state); } - Token::AtKeyword(at_keyword) => { - at_keyword.value.hash(state); - at_keyword.raw.hash(state); + Token::AtKeyword { value, raw } => { + value.hash(state); + raw.hash(state); } - Token::String(string) => { - string.value.hash(state); - string.raw.hash(state); + Token::String { value, raw } => { + value.hash(state); + raw.hash(state); } - Token::BadString(bad_string) => { - bad_string.raw.hash(state); + Token::BadString { raw } => { + raw.hash(state); } - Token::Hash(hash) => { - hash.value.hash(state); - hash.raw.hash(state); - hash.is_id.hash(state); + Token::Hash { value, raw, is_id } => { + value.hash(state); + raw.hash(state); + is_id.hash(state); } Token::Url(url) => { url.name.hash(state); url.value.hash(state); url.raw.hash(state); } - Token::BadUrl(bad_url) => { - bad_url.raw.hash(state); + Token::BadUrl { raw, .. } => { + raw.hash(state); } - Token::Delim(delim) => { - delim.value.hash(state); + Token::Delim { value } => { + value.hash(state); } - Token::Number(number) => { - integer_decode(number.value).hash(state); - number.raw.hash(state); - number.type_flag.hash(state); + Token::Number { + value, + raw, + type_flag, + } => { + integer_decode(*value).hash(state); + raw.hash(state); + type_flag.hash(state); } - Token::Percentage(percentage) => { - integer_decode(percentage.value).hash(state); - percentage.raw.hash(state); + Token::Percentage { value, raw } => { + integer_decode(*value).hash(state); + raw.hash(state); } Token::Dimension(dimension) => { integer_decode(dimension.value).hash(state); diff --git a/crates/swc_css_codegen/src/lib.rs b/crates/swc_css_codegen/src/lib.rs index 9b2e72cbfa46..c57b319ec3cd 100644 --- a/crates/swc_css_codegen/src/lib.rs +++ b/crates/swc_css_codegen/src/lib.rs @@ -1956,16 +1956,16 @@ where let span = n.span; match &n.token { - Token::AtKeyword(token) => { - let mut at_keyword = String::with_capacity(1 + token.raw.len()); + Token::AtKeyword { raw, .. } => { + let mut at_keyword = String::with_capacity(1 + raw.len()); at_keyword.push('@'); - at_keyword.push_str(&token.raw); + at_keyword.push_str(raw); write_raw!(self, span, &at_keyword); } - Token::Delim(token) => { - write_raw!(self, span, &token.value.to_string()); + Token::Delim { value } => { + write_raw!(self, span, &value.to_string()); } Token::LParen => { write_raw!(self, span, "("); @@ -1979,13 +1979,13 @@ where Token::RBracket => { write_raw!(self, span, "]"); } - Token::Number(token) => { - write_raw!(self, span, &token.raw); + Token::Number { raw, .. } => { + write_raw!(self, span, raw); } - Token::Percentage(token) => { - let mut percentage = String::with_capacity(token.raw.len() + 1); + Token::Percentage { raw, .. } => { + let mut percentage = String::with_capacity(raw.len() + 1); - percentage.push_str(&token.raw); + percentage.push_str(&raw); percentage.push('%'); write_raw!(self, span, &percentage); @@ -1998,22 +1998,22 @@ where write_raw!(self, span, &dimension); } - Token::Ident(token) => { - write_raw!(self, span, &token.raw); + Token::Ident { raw, .. } => { + write_raw!(self, span, raw); } - Token::Function(token) => { - let mut function = String::with_capacity(token.raw.len() + 1); + Token::Function { raw, .. } => { + let mut function = String::with_capacity(raw.len() + 1); - function.push_str(&token.raw); + function.push_str(raw); function.push('('); write_raw!(self, span, &function); } - Token::BadString(token) => { - write_str!(self, span, &token.raw); + Token::BadString { raw } => { + write_str!(self, span, raw); } - Token::String(token) => { - write_str!(self, span, &token.raw); + Token::String { raw, .. } => { + write_str!(self, span, raw); } Token::Url(token) => { let mut url = String::with_capacity(token.raw.0.len() + token.raw.1.len() + 2); @@ -2025,12 +2025,12 @@ where write_str!(self, span, &url); } - Token::BadUrl(token) => { - let mut bad_url = String::with_capacity(token.raw.0.len() + token.raw.1.len() + 2); + Token::BadUrl { raw, .. } => { + let mut bad_url = String::with_capacity(raw.0.len() + raw.1.len() + 2); - bad_url.push_str(&token.raw.0); + bad_url.push_str(&raw.0); bad_url.push('('); - bad_url.push_str(&token.raw.1); + bad_url.push_str(&raw.1); bad_url.push(')'); write_str!(self, span, &bad_url); @@ -2050,11 +2050,11 @@ where Token::Colon => { write_raw!(self, span, ":"); } - Token::Hash(token) => { - let mut hash = String::with_capacity(token.raw.len() + 1); + Token::Hash { raw, .. } => { + let mut hash = String::with_capacity(raw.len() + 1); hash.push('#'); - hash.push_str(&token.raw); + hash.push_str(raw); write_raw!(self, span, &hash); } diff --git a/crates/swc_css_minifier/src/compressor/mod.rs b/crates/swc_css_minifier/src/compressor/mod.rs index a95c60892971..2acbed210a5c 100644 --- a/crates/swc_css_minifier/src/compressor/mod.rs +++ b/crates/swc_css_minifier/src/compressor/mod.rs @@ -396,23 +396,19 @@ impl VisitMut for Compressor { if !self.need_utf8_at_rule { match &token_and_span.token { - Token::Ident(box IdentToken { value, .. }) - | Token::Function(box FunctionToken { value, .. }) - | Token::AtKeyword(box AtKeywordToken { value, .. }) - | Token::String(box StringToken { value, .. }) + Token::Ident { value, .. } + | Token::Function { value, .. } + | Token::AtKeyword { value, .. } + | Token::String { value, .. } | Token::Url(box UrlToken { value, .. }) if !contains_only_ascii_characters(value) => { self.need_utf8_at_rule = true; } - Token::BadString(box BadStringToken { raw: value, .. }) - if !contains_only_ascii_characters(value) => - { + Token::BadString { raw: value, .. } if !contains_only_ascii_characters(value) => { self.need_utf8_at_rule = true; } - Token::BadUrl(box BadUrlToken { raw: value, .. }) - if !contains_only_ascii_characters(&value.1) => - { + Token::BadUrl { raw: value, .. } if !contains_only_ascii_characters(&value.1) => { self.need_utf8_at_rule = true; } Token::Dimension(box DimensionToken { unit: value, .. }) diff --git a/crates/swc_css_parser/src/lexer/mod.rs b/crates/swc_css_parser/src/lexer/mod.rs index dc13cb275ad8..2e43260dc451 100644 --- a/crates/swc_css_parser/src/lexer/mod.rs +++ b/crates/swc_css_parser/src/lexer/mod.rs @@ -2,11 +2,7 @@ use std::{cell::RefCell, char::REPLACEMENT_CHARACTER, rc::Rc}; use swc_atoms::{js_word, Atom, JsWord}; use swc_common::{input::Input, BytePos, Span}; -use swc_css_ast::{ - AtKeywordToken, BadStringToken, BadUrlToken, DelimToken, DimensionToken, FunctionToken, - HashToken, IdentToken, NumberToken, NumberType, PercentageToken, StringToken, Token, - TokenAndSpan, -}; +use swc_css_ast::{DimensionToken, NumberType, Token, TokenAndSpan}; use crate::{ error::{Error, ErrorKind}, @@ -275,11 +271,11 @@ where || self.is_valid_escape(first, second)? { // Create a . - let mut hash_token = Token::Hash(Box::new(HashToken { + let mut hash_token = Token::Hash { is_id: Default::default(), value: Default::default(), raw: Default::default(), - })); + }; // If the next 3 input code points would start an identifier, set the // ’s type flag to "id". @@ -287,7 +283,7 @@ where let is_would_start_ident = self.would_start_ident(first, second, third)?; match hash_token { - Token::Hash(box HashToken { ref mut is_id, .. }) => { + Token::Hash { ref mut is_id, .. } => { *is_id = is_would_start_ident; } _ => { @@ -299,11 +295,11 @@ where let ident_sequence = self.read_ident_sequence()?; match hash_token { - Token::Hash(box HashToken { + Token::Hash { ref mut value, ref mut raw, .. - }) => { + } => { *value = ident_sequence.0; *raw = ident_sequence.1; } @@ -316,7 +312,7 @@ where return Ok(hash_token); } - Ok(Token::Delim(Box::new(DelimToken { value: '#' }))) + Ok(Token::Delim { value: '#' }) } // U+0027 APOSTROPHE (') // Consume a string token and return it. @@ -339,7 +335,7 @@ where // Otherwise, return a with its value set to the current input // code point. - Ok(Token::Delim(Box::new(DelimToken { value: '+' }))) + Ok(Token::Delim { value: '+' }) } // U+002C COMMA (,) // Return a . @@ -371,7 +367,7 @@ where // Otherwise, return a with its value set to the current input // code point. - Ok(Token::Delim(Box::new(DelimToken { value: '-' }))) + Ok(Token::Delim { value: '-' }) } // U+002E FULL STOP (.) Some('.') => { @@ -385,7 +381,7 @@ where // Otherwise, return a with its value set to the current input // code point. - Ok(Token::Delim(Box::new(DelimToken { value: '.' }))) + Ok(Token::Delim { value: '.' }) } // U+003A COLON (:) // Return a . @@ -411,7 +407,7 @@ where // Otherwise, return a with its value set to the current input // code point. - Ok(Token::Delim(Box::new(DelimToken { value: '<' }))) + Ok(Token::Delim { value: '<' }) } // U+0040 COMMERCIAL AT (@) Some('@') => { @@ -425,15 +421,15 @@ where if self.would_start_ident(first, second, third)? { let ident_sequence = self.read_ident_sequence()?; - return Ok(Token::AtKeyword(Box::new(AtKeywordToken { + return Ok(Token::AtKeyword { value: ident_sequence.0, raw: ident_sequence.1, - }))); + }); } // Otherwise, return a with its value set to the current input // code point. - Ok(Token::Delim(Box::new(DelimToken { value: '@' }))) + Ok(Token::Delim { value: '@' }) } // U+005B LEFT SQUARE BRACKET ([) // Return a <[-token>. @@ -452,7 +448,7 @@ where // to the current input code point. self.emit_error(ErrorKind::InvalidEscape); - Ok(Token::Delim(Box::new(DelimToken { value: '\\' }))) + Ok(Token::Delim { value: '\\' }) } // U+005D RIGHT SQUARE BRACKET (]) // Return a <]-token>. @@ -482,7 +478,7 @@ where None => Err(ErrorKind::Eof), // anything else // Return a with its value set to the current input code point. - Some(c) => Ok(Token::Delim(Box::new(DelimToken { value: c }))), + Some(c) => Ok(Token::Delim { value: c }), } } @@ -580,19 +576,19 @@ where else if next_first == Some('%') { self.consume(); - return Ok(Token::Percentage(Box::new(PercentageToken { + return Ok(Token::Percentage { value: number.0, raw: number.1, - }))); + }); } // Otherwise, create a with the same value and type flag as // number, and return it. - Ok(Token::Number(Box::new(NumberToken { + Ok(Token::Number { value: number.0, raw: number.1, type_flag: number.2, - }))) + }) } // This section describes how to consume an ident-like token from a stream of @@ -638,16 +634,16 @@ where // should not be part of token self.last_pos = Some(start_whitespace); - return Ok(Token::Function(Box::new(FunctionToken { + return Ok(Token::Function { value: ident_sequence.0, raw: ident_sequence.1, - }))); + }); } Some('"' | '\'') => { - return Ok(Token::Function(Box::new(FunctionToken { + return Ok(Token::Function { value: ident_sequence.0, raw: ident_sequence.1, - }))); + }); } // Otherwise, consume a url token, and return it. _ => { @@ -660,18 +656,18 @@ where else if self.next() == Some('(') { self.consume(); - return Ok(Token::Function(Box::new(FunctionToken { + return Ok(Token::Function { value: ident_sequence.0, raw: ident_sequence.1, - }))); + }); } // Otherwise, create an with its value set to string and return // it. - Ok(Token::Ident(Box::new(IdentToken { + Ok(Token::Ident { value: ident_sequence.0, raw: ident_sequence.1, - }))) + }) } // This section describes how to consume a string token from a stream of code @@ -706,10 +702,10 @@ where None => { l.emit_error(ErrorKind::UnterminatedString); - return Ok(Token::String(Box::new(StringToken { + return Ok(Token::String { value: (&**buf).into(), raw: (&**raw).into(), - }))); + }); } // Newline @@ -719,9 +715,9 @@ where l.emit_error(ErrorKind::NewlineInString); l.reconsume(); - return Ok(Token::BadString(Box::new(BadStringToken { + return Ok(Token::BadString { raw: (&**raw).into(), - }))); + }); } // U+005C REVERSE SOLIDUS (\) @@ -760,10 +756,10 @@ where } } - Ok(Token::String(Box::new(StringToken { + Ok(Token::String { value: (&**buf).into(), raw: (&**raw).into(), - }))) + }) }) } @@ -870,9 +866,9 @@ where out.push_str(&remnants.0); raw.push_str(&remnants.1); - return Ok(Token::BadUrl(Box::new(BadUrlToken { + return Ok(Token::BadUrl { raw: Box::new((name.1, (&**raw).into())), - }))); + }); } // U+0022 QUOTATION MARK (") @@ -891,9 +887,9 @@ where raw.push(c); raw.push_str(&remnants.1); - return Ok(Token::BadUrl(Box::new(swc_css_ast::BadUrlToken { + return Ok(Token::BadUrl { raw: Box::new((name.1, (&**raw).into())), - }))); + }); } // U+005C REVERSE SOLIDUS (\) @@ -920,9 +916,9 @@ where raw.push(c); raw.push_str(&remnants.1); - return Ok(Token::BadUrl(Box::new(swc_css_ast::BadUrlToken { + return Ok(Token::BadUrl { raw: Box::new((name.1, (&**raw).into())), - }))); + }); } } diff --git a/crates/swc_css_parser/src/macros.rs b/crates/swc_css_parser/src/macros.rs index 02d0d597d7db..87bce72aa087 100644 --- a/crates/swc_css_parser/src/macros.rs +++ b/crates/swc_css_parser/src/macros.rs @@ -32,7 +32,7 @@ macro_rules! tok { }; ("bad-url") => { - swc_css_ast::Token::BadUrl(_) + swc_css_ast::Token::BadUrl { .. } }; ("[") => { @@ -52,7 +52,7 @@ macro_rules! tok { }; ("%") => { - swc_css_ast::Token::Delim(box DelimToken { value: '%', .. }) + swc_css_ast::Token::Delim { value: '%', .. } }; (",") => { @@ -64,11 +64,11 @@ macro_rules! tok { }; ("!") => { - swc_css_ast::Token::Delim(box DelimToken { value: '!', .. }) + swc_css_ast::Token::Delim { value: '!', .. } }; ("?") => { - swc_css_ast::Token::Delim(box DelimToken { value: '?', .. }) + swc_css_ast::Token::Delim { value: '?', .. } }; ("{") => { @@ -92,7 +92,7 @@ macro_rules! tok { }; ("*") => { - swc_css_ast::Token::Delim(box DelimToken { value: '*', .. }) + swc_css_ast::Token::Delim { value: '*', .. } }; ("@") => { @@ -104,27 +104,27 @@ macro_rules! tok { }; ("&") => { - swc_css_ast::Token::Delim(box DelimToken { value: '&', .. }) + swc_css_ast::Token::Delim { value: '&', .. } }; ("|") => { - swc_css_ast::Token::Delim(box DelimToken { value: '|', .. }) + swc_css_ast::Token::Delim { value: '|', .. } }; ("$") => { - swc_css_ast::Token::Delim(box DelimToken { value: '$', .. }) + swc_css_ast::Token::Delim { value: '$', .. } }; ("^") => { - swc_css_ast::Token::Delim(box DelimToken { value: '^', .. }) + swc_css_ast::Token::Delim { value: '^', .. } }; ("~") => { - swc_css_ast::Token::Delim(box DelimToken { value: '~', .. }) + swc_css_ast::Token::Delim { value: '~', .. } }; ("=") => { - swc_css_ast::Token::Delim(box DelimToken { value: '=', .. }) + swc_css_ast::Token::Delim { value: '=', .. } }; (" ") => { @@ -140,26 +140,26 @@ macro_rules! tok { }; ("+") => { - swc_css_ast::Token::Delim(box DelimToken { value: '+', .. }) + swc_css_ast::Token::Delim { value: '+', .. } }; ("-") => { - swc_css_ast::Token::Delim(box DelimToken { value: '-', .. }) + swc_css_ast::Token::Delim { value: '-', .. } }; (".") => { - swc_css_ast::Token::Delim(box DelimToken { value: '.', .. }) + swc_css_ast::Token::Delim { value: '.', .. } }; ("/") => { - swc_css_ast::Token::Delim(box DelimToken { value: '/', .. }) + swc_css_ast::Token::Delim { value: '/', .. } }; ("<") => { - swc_css_ast::Token::Delim(box DelimToken { value: '<', .. }) + swc_css_ast::Token::Delim { value: '<', .. } }; (">") => { - swc_css_ast::Token::Delim(box DelimToken { value: '>', .. }) + swc_css_ast::Token::Delim { value: '>', .. } }; } diff --git a/crates/swc_css_parser/src/parser/at_rules/mod.rs b/crates/swc_css_parser/src/parser/at_rules/mod.rs index b78c0365f82a..be522e1975c8 100644 --- a/crates/swc_css_parser/src/parser/at_rules/mod.rs +++ b/crates/swc_css_parser/src/parser/at_rules/mod.rs @@ -31,7 +31,7 @@ where self.input.skip_ws(); let name = match cur!(self) { - Token::Ident(box IdentToken { value, .. }) => { + Token::Ident { value, .. } => { if value.starts_with("--") { ColorProfileName::DashedIdent(self.parse()?) } else { @@ -175,16 +175,14 @@ where let layer_name = if !is!(self, EOF) { match cur!(self) { - Token::Ident(box IdentToken { value, .. }) - if *value.to_ascii_lowercase() == *"layer" => - { + Token::Ident { value, .. } if *value.to_ascii_lowercase() == *"layer" => { let name = ImportLayerName::Ident(self.parse()?); self.input.skip_ws(); Some(Box::new(name)) } - Token::Function(box FunctionToken { value, .. }) + Token::Function { value, .. } if *value.to_ascii_lowercase() == *"layer" => { let ctx = Ctx { @@ -774,9 +772,7 @@ where let supports = if !is!(self, EOF) { match cur!(self) { - Token::Function(box FunctionToken { value, .. }) - if *value.to_ascii_lowercase() == *"supports" => - { + Token::Function { value, .. } if *value.to_ascii_lowercase() == *"supports" => { let ctx = Ctx { in_import_at_rule: true, ..self.ctx @@ -823,13 +819,13 @@ where bump!(self); match cur!(self) { - Token::Function(box FunctionToken { value, .. }) + Token::Function { value, .. } if (&*value.to_ascii_lowercase() == "local" || &*value.to_ascii_lowercase() == "global") => { let span = self.input.cur_span(); let pseudo = match bump!(self) { - Token::Function(box FunctionToken { value, raw }) => Ident { + Token::Function { value, raw } => Ident { span: span!(self, span.lo), value, raw: Some(raw), @@ -855,7 +851,7 @@ where }, ))) } - Token::Ident(box IdentToken { value, .. }) + Token::Ident { value, .. } if (&*value.to_ascii_lowercase() == "local" || &*value.to_ascii_lowercase() == "global") => { @@ -1026,9 +1022,7 @@ where fn parse(&mut self) -> PResult { let span = self.input.cur_span(); let keyword = match cur!(self) { - Token::Ident(box IdentToken { value, .. }) - if value.as_ref().eq_ignore_ascii_case("not") => - { + Token::Ident { value, .. } if value.as_ref().eq_ignore_ascii_case("not") => { Some(self.parse()?) } _ => { @@ -1058,9 +1052,7 @@ where fn parse(&mut self) -> PResult { let span = self.input.cur_span(); let keyword = match cur!(self) { - Token::Ident(box IdentToken { value, .. }) - if value.as_ref().eq_ignore_ascii_case("and") => - { + Token::Ident { value, .. } if value.as_ref().eq_ignore_ascii_case("and") => { Some(self.parse()?) } _ => { @@ -1090,9 +1082,7 @@ where fn parse(&mut self) -> PResult { let span = self.input.cur_span(); let keyword = match cur!(self) { - Token::Ident(box IdentToken { value, .. }) - if value.as_ref().eq_ignore_ascii_case("or") => - { + Token::Ident { value, .. } if value.as_ref().eq_ignore_ascii_case("or") => { Some(self.parse()?) } _ => { @@ -1186,9 +1176,7 @@ where Ok(SupportsFeature::Declaration(Box::new(declaration))) } - Token::Function(box FunctionToken { value, .. }) - if &*value.to_ascii_lowercase() == "selector" => - { + Token::Function { value, .. } if &*value.to_ascii_lowercase() == "selector" => { // TODO improve me let ctx = Ctx { in_supports_at_rule: true, @@ -1288,10 +1276,10 @@ where fn parse(&mut self) -> PResult { match cur!(self) { tok!("url") => Ok(DocumentPreludeMatchingFunction::Url(self.parse()?)), - Token::Function(box FunctionToken { + Token::Function { value: function_name, .. - }) => { + } => { if &*function_name.to_ascii_lowercase() == "url" || &*function_name.to_ascii_lowercase() == "src" { @@ -1556,9 +1544,7 @@ where fn parse(&mut self) -> PResult { let span = self.input.cur_span(); let keyword = match cur!(self) { - Token::Ident(box IdentToken { value, .. }) - if value.as_ref().eq_ignore_ascii_case("not") => - { + Token::Ident { value, .. } if value.as_ref().eq_ignore_ascii_case("not") => { Some(self.parse()?) } _ => { @@ -1588,9 +1574,7 @@ where fn parse(&mut self) -> PResult { let span = self.input.cur_span(); let keyword = match cur!(self) { - Token::Ident(box IdentToken { value, .. }) - if value.as_ref().eq_ignore_ascii_case("and") => - { + Token::Ident { value, .. } if value.as_ref().eq_ignore_ascii_case("and") => { Some(self.parse()?) } _ => { @@ -1620,9 +1604,7 @@ where fn parse(&mut self) -> PResult { let span = self.input.cur_span(); let keyword = match cur!(self) { - Token::Ident(box IdentToken { value, .. }) - if value.as_ref().eq_ignore_ascii_case("or") => - { + Token::Ident { value, .. } if value.as_ref().eq_ignore_ascii_case("or") => { Some(self.parse()?) } _ => { @@ -1883,7 +1865,7 @@ where } tok!("ident") => Ok(MediaFeatureValue::Ident(self.parse()?)), tok!("dimension") => Ok(MediaFeatureValue::Dimension(self.parse()?)), - Token::Function(box FunctionToken { value, .. }) if is_math_function(value) => { + Token::Function { value, .. } if is_math_function(value) => { let function = self.parse()?; Ok(MediaFeatureValue::Function(function)) @@ -2002,7 +1984,7 @@ where expect!(self, ":"); let value = match cur!(self) { - Token::Ident(box IdentToken { value, .. }) + Token::Ident { value, .. } if matches!( &*value.to_ascii_lowercase(), "left" | "right" | "first" | "blank" @@ -2159,9 +2141,7 @@ where fn parse(&mut self) -> PResult { let span = self.input.cur_span(); let keyword = match cur!(self) { - Token::Ident(box IdentToken { value, .. }) - if value.as_ref().eq_ignore_ascii_case("not") => - { + Token::Ident { value, .. } if value.as_ref().eq_ignore_ascii_case("not") => { Some(self.parse()?) } _ => { @@ -2191,9 +2171,7 @@ where fn parse(&mut self) -> PResult { let span = self.input.cur_span(); let keyword = match cur!(self) { - Token::Ident(box IdentToken { value, .. }) - if value.as_ref().eq_ignore_ascii_case("and") => - { + Token::Ident { value, .. } if value.as_ref().eq_ignore_ascii_case("and") => { Some(self.parse()?) } _ => { @@ -2223,9 +2201,7 @@ where fn parse(&mut self) -> PResult { let span = self.input.cur_span(); let keyword = match cur!(self) { - Token::Ident(box IdentToken { value, .. }) - if value.as_ref().eq_ignore_ascii_case("or") => - { + Token::Ident { value, .. } if value.as_ref().eq_ignore_ascii_case("or") => { Some(self.parse()?) } _ => { @@ -2482,7 +2458,7 @@ where } tok!("ident") => Ok(SizeFeatureValue::Ident(self.parse()?)), tok!("dimension") => Ok(SizeFeatureValue::Dimension(self.parse()?)), - Token::Function(box FunctionToken { value, .. }) if is_math_function(value) => { + Token::Function { value, .. } if is_math_function(value) => { let function = self.parse()?; Ok(SizeFeatureValue::Function(function)) @@ -2507,7 +2483,7 @@ where } match bump!(self) { - Token::Ident(box IdentToken { value, raw, .. }) => { + Token::Ident { value, raw, .. } => { if !value.starts_with("--") { return Err(Error::new( span, diff --git a/crates/swc_css_parser/src/parser/input.rs b/crates/swc_css_parser/src/parser/input.rs index d349920fea90..3ef45f9a4f0c 100644 --- a/crates/swc_css_parser/src/parser/input.rs +++ b/crates/swc_css_parser/src/parser/input.rs @@ -2,7 +2,7 @@ use std::{fmt::Debug, mem::take}; use swc_atoms::{Atom, JsWord}; use swc_common::{BytePos, Span, Spanned, SyntaxContext}; -use swc_css_ast::{ComponentValue, FunctionToken, ListOfComponentValues, Token, TokenAndSpan}; +use swc_css_ast::{ComponentValue, ListOfComponentValues, Token, TokenAndSpan}; use super::PResult; use crate::error::{Error, ErrorKind}; @@ -371,10 +371,10 @@ impl<'a> Input<'a> { TokenOrBlock::Token(token_and_span) => *token_and_span, TokenOrBlock::Function(function) => TokenAndSpan { span: function.0, - token: Token::Function(Box::new(FunctionToken { + token: Token::Function { value: function.1, raw: function.2, - })), + }, }, TokenOrBlock::LBracket(span) => TokenAndSpan { span: *span, diff --git a/crates/swc_css_parser/src/parser/macros.rs b/crates/swc_css_parser/src/parser/macros.rs index 69a38423de4c..5914f0db9725 100644 --- a/crates/swc_css_parser/src/parser/macros.rs +++ b/crates/swc_css_parser/src/parser/macros.rs @@ -7,7 +7,7 @@ macro_rules! span { macro_rules! tok_pat { (Ident) => { - swc_css_ast::Token::Ident(box IdentToken { .. }) + swc_css_ast::Token::Ident { .. } }; (Percentage) => { @@ -94,7 +94,7 @@ macro_rules! bump { macro_rules! is_case_insensitive_ident { ($parser:expr, $tt:tt) => {{ match $parser.input.cur() { - Some(swc_css_ast::Token::Ident(box IdentToken { value, .. })) + Some(swc_css_ast::Token::Ident { value, .. }) if &*value.to_ascii_lowercase() == $tt => { true @@ -107,7 +107,7 @@ macro_rules! is_case_insensitive_ident { macro_rules! is_one_of_case_insensitive_ident { ($parser:expr, $($tt:tt),+) => { match $parser.input.cur() { - Some(swc_css_ast::Token::Ident(box IdentToken { value, .. })) => { + Some(swc_css_ast::Token::Ident { value, .. }) => { let lowercased = &*value.to_ascii_lowercase(); if $(lowercased == $tt)||* { diff --git a/crates/swc_css_parser/src/parser/selectors/mod.rs b/crates/swc_css_parser/src/parser/selectors/mod.rs index d5d41b987b3f..5da5c0b2c948 100644 --- a/crates/swc_css_parser/src/parser/selectors/mod.rs +++ b/crates/swc_css_parser/src/parser/selectors/mod.rs @@ -534,7 +534,7 @@ where name, })); } - Token::Delim(box DelimToken { value, .. }) if *value == '*' => { + Token::Delim { value, .. } if *value == '*' => { bump!(self); namespace = Some(Namespace::Any(AnyNamespace { @@ -618,9 +618,9 @@ where fn parse(&mut self) -> PResult { let span = self.input.cur_span(); let text = match bump!(self) { - Token::Hash(box HashToken { + Token::Hash { is_id, value, raw, .. - }) => { + } => { if !is_id { return Err(Error::new( span, @@ -845,7 +845,7 @@ where let fn_span = self.input.cur_span(); let name = bump!(self); let names = match name { - Token::Function(box FunctionToken { value, raw }) => (value, raw), + Token::Function { value, raw } => (value, raw), _ => unreachable!(), }; let state = self.input.state(); @@ -1073,7 +1073,7 @@ where let fn_span = self.input.cur_span(); let name = bump!(self); let names = match name { - Token::Function(box FunctionToken { value, raw }) => (value, raw), + Token::Function { value, raw } => (value, raw), _ => unreachable!(), }; let state = self.input.state(); @@ -1186,7 +1186,7 @@ where match cur!(self) { // odd | even - Token::Ident(box IdentToken { value, .. }) + Token::Ident { value, .. } if &(*value).to_ascii_lowercase() == "odd" || &(*value).to_ascii_lowercase() == "even" => { @@ -1195,7 +1195,7 @@ where // tok!("number") => { let number = match bump!(self) { - Token::Number(box NumberToken { value, raw, .. }) => (value, raw), + Token::Number { value, raw, .. } => (value, raw), _ => { unreachable!(); } @@ -1229,7 +1229,7 @@ where let mut has_plus_sign = false; // '+' n - if let Token::Delim(box DelimToken { value: '+' }) = cur!(self){ + if let Token::Delim { value: '+' } = cur!(self){ let peeked = self.input.peek(); if let Some(Token::Ident { .. }) = peeked { @@ -1245,7 +1245,7 @@ where match cur!(self) { Token::Ident { .. } => { let ident_value = match bump!(self) { - Token::Ident(box IdentToken { value, .. }) => value, + Token::Ident { value, .. } => value, _ => { unreachable!(); } @@ -1306,7 +1306,7 @@ where // tok!("number") if dash_after_n.is_none() => { let number = match bump!(self) { - Token::Number(box NumberToken { value, raw, .. }) => (value, raw), + Token::Number { value, raw, .. } => (value, raw), _ => { unreachable!(); } @@ -1320,7 +1320,7 @@ where // tok!("number") if dash_after_n == Some('-') => { let number = match bump!(self) { - Token::Number(box NumberToken { value, raw, .. }) => (value, raw), + Token::Number { value, raw, .. } => (value, raw), _ => { unreachable!(); } @@ -1339,7 +1339,7 @@ where // ['+' | '-'] tok!("-") | tok!("+") => { let (b_sign, b_sign_raw) = match bump!(self) { - Token::Delim(box DelimToken { value, .. }) => (if value == '-' { -1 } else { 1 }, value), + Token::Delim { value, .. } => (if value == '-' { -1 } else { 1 }, value), _ => { unreachable!(); } @@ -1348,7 +1348,7 @@ where self.input.skip_ws(); let number = match bump!(self) { - Token::Number(box NumberToken { value, raw, .. }) => (value, raw), + Token::Number { value, raw, .. } => (value, raw), _ => { return Err(Error::new(span, ErrorKind::Expected("Num"))); } @@ -1420,7 +1420,7 @@ where } match bump!(self) { - Token::Ident(box IdentToken { value, raw, .. }) => Ok(CustomHighlightName { + Token::Ident { value, raw, .. } => Ok(CustomHighlightName { span, value, raw: Some(raw), diff --git a/crates/swc_css_parser/src/parser/syntax/mod.rs b/crates/swc_css_parser/src/parser/syntax/mod.rs index f0b8063928ce..1006685e592e 100644 --- a/crates/swc_css_parser/src/parser/syntax/mod.rs +++ b/crates/swc_css_parser/src/parser/syntax/mod.rs @@ -143,7 +143,7 @@ where // and its value initially set to nothing. let span = self.input.cur_span(); let at_keyword_name = match bump!(self) { - Token::AtKeyword(box AtKeywordToken { value, raw }) => (value, raw), + Token::AtKeyword { value, raw } => (value, raw), _ => { unreachable!() } @@ -371,7 +371,7 @@ where // Constructions like `a { prop: {value}; }` still affected this problem, but // `{`/`}` doesn't used in declarations if self.config.legacy_nesting - && matches!(self.input.cur(), Some(Token::Ident(box IdentToken { value, .. })) if !value.starts_with("--")) + && matches!(self.input.cur(), Some(Token::Ident { value, .. }) if !value.starts_with("--")) { if let Some(legacy_nested) = self.try_to_parse_legacy_nesting() { rules.push(StyleBlock::QualifiedRule(Box::new(legacy_nested))); @@ -606,7 +606,7 @@ where // Return nothing. let span = self.input.cur_span(); let is_dashed_ident = match cur!(self) { - Token::Ident(box IdentToken { value, .. }) => value.starts_with("--"), + Token::Ident { value, .. } => value.starts_with("--"), _ => { return Err(Error::new(span, ErrorKind::Expected("ident"))); } @@ -653,7 +653,7 @@ where // Optimization for step 6 ComponentValue::PreservedToken(box TokenAndSpan { span, - token: Token::Delim(box DelimToken { value: '!', .. }), + token: Token::Delim { value: '!', .. }, .. }) if is!(self, " ") || is_case_insensitive_ident!(self, "important") => { if let Some(span) = &exclamation_point_span { @@ -689,7 +689,7 @@ where }, ComponentValue::PreservedToken( token_and_span @ box TokenAndSpan { - token: Token::Ident(box IdentToken { value, .. }), + token: Token::Ident { value, .. }, .. }, ) if exclamation_point_span.is_some() @@ -736,7 +736,7 @@ where Default::default(), ); let value = match important_ident.token { - Token::Ident(box IdentToken { value, raw, .. }) => (value, raw), + Token::Ident { value, raw, .. } => (value, raw), _ => { unreachable!(); } @@ -920,7 +920,7 @@ where // and with its value initially set to an empty list. let span = self.input.cur_span(); let ident = match bump!(self) { - Token::Function(box FunctionToken { value, raw }) => (value, raw), + Token::Function { value, raw } => (value, raw), _ => { unreachable!() } diff --git a/crates/swc_css_parser/src/parser/util.rs b/crates/swc_css_parser/src/parser/util.rs index f7d194e03366..61247dfd4ee0 100644 --- a/crates/swc_css_parser/src/parser/util.rs +++ b/crates/swc_css_parser/src/parser/util.rs @@ -434,7 +434,7 @@ where } ComponentValue::PreservedToken(box TokenAndSpan { span, - token: Token::Delim(box DelimToken { value: '!' }), + token: Token::Delim { value: '!' }, }) => { return Err(Error::new( *span, diff --git a/crates/swc_css_parser/src/parser/values_and_units/mod.rs b/crates/swc_css_parser/src/parser/values_and_units/mod.rs index bd71f0044174..e8dbf266dcf9 100644 --- a/crates/swc_css_parser/src/parser/values_and_units/mod.rs +++ b/crates/swc_css_parser/src/parser/values_and_units/mod.rs @@ -47,20 +47,18 @@ where return Ok(ComponentValue::Url(self.parse()?)); } - Token::Function(box FunctionToken { value, .. }) => { - match &*value.to_ascii_lowercase() { - "url" | "src" => { - return Ok(ComponentValue::Url(self.parse()?)); - } - "rgb" | "rgba" | "hsl" | "hsla" | "hwb" | "lab" | "lch" | "oklab" | "oklch" - | "color" | "device-cmyk" | "color-mix" | "color-contrast" => { - return Ok(ComponentValue::Color(self.parse()?)); - } - _ => { - return Ok(ComponentValue::Function(self.parse()?)); - } + Token::Function { value, .. } => match &*value.to_ascii_lowercase() { + "url" | "src" => { + return Ok(ComponentValue::Url(self.parse()?)); } - } + "rgb" | "rgba" | "hsl" | "hsla" | "hwb" | "lab" | "lch" | "oklab" | "oklch" + | "color" | "device-cmyk" | "color-mix" | "color-contrast" => { + return Ok(ComponentValue::Color(self.parse()?)); + } + _ => { + return Ok(ComponentValue::Function(self.parse()?)); + } + }, tok!("percentage") => { return Ok(ComponentValue::Percentage(self.parse()?)); @@ -68,7 +66,7 @@ where tok!("dimension") => return Ok(ComponentValue::Dimension(self.parse()?)), - Token::Number(box NumberToken { type_flag, .. }) => { + Token::Number { type_flag, .. } => { if *type_flag == NumberType::Integer { return Ok(ComponentValue::Integer(self.parse()?)); } @@ -76,7 +74,7 @@ where return Ok(ComponentValue::Number(self.parse()?)); } - Token::Ident(box IdentToken { value, .. }) => { + Token::Ident { value, .. } => { if value.starts_with("--") { return Ok(ComponentValue::DashedIdent(self.parse()?)); } else if &*value.to_ascii_lowercase() == "u" @@ -372,9 +370,7 @@ where let mut is_legacy_syntax = true; match cur!(self) { - Token::Ident(box IdentToken { value, .. }) - if &*value.to_ascii_lowercase() == "from" => - { + Token::Ident { value, .. } if &*value.to_ascii_lowercase() == "from" => { is_legacy_syntax = false; values.push(ComponentValue::Ident(self.parse()?)); @@ -403,9 +399,7 @@ where Ok(Some(ComponentValue::Percentage(parser.parse()?))) } tok!("number") => Ok(Some(ComponentValue::Number(parser.parse()?))), - Token::Function(box FunctionToken { value, .. }) - if is_math_function(value) => - { + Token::Function { value, .. } if is_math_function(value) => { Ok(Some(ComponentValue::Function(parser.parse()?))) } tok!("ident") => { @@ -463,9 +457,7 @@ where )) } } - Token::Function(box FunctionToken { value, .. }) - if is_math_function(value) => - { + Token::Function { value, .. } if is_math_function(value) => { Ok(Some(ComponentValue::Function(parser.parse()?))) } _ => { @@ -520,9 +512,7 @@ where Ok(Some(ComponentValue::Percentage(parser.parse()?))) } tok!("number") => Ok(Some(ComponentValue::Number(parser.parse()?))), - Token::Function(box FunctionToken { value, .. }) - if is_math_function(value) => - { + Token::Function { value, .. } if is_math_function(value) => { Ok(Some(ComponentValue::Function(parser.parse()?))) } tok!("ident") if !is_legacy_syntax => { @@ -566,9 +556,7 @@ where tok!("percentage") => { Ok(Some(ComponentValue::Percentage(parser.parse()?))) } - Token::Function(box FunctionToken { value, .. }) - if is_math_function(value) => - { + Token::Function { value, .. } if is_math_function(value) => { Ok(Some(ComponentValue::Function(parser.parse()?))) } tok!("ident") => { @@ -640,9 +628,7 @@ where Ok(Some(ComponentValue::Percentage(parser.parse()?))) } tok!("number") => Ok(Some(ComponentValue::Number(parser.parse()?))), - Token::Function(box FunctionToken { value, .. }) - if is_math_function(value) => - { + Token::Function { value, .. } if is_math_function(value) => { Ok(Some(ComponentValue::Function(parser.parse()?))) } tok!("ident") if !is_legacy_syntax => { @@ -686,9 +672,7 @@ where tok!("percentage") => { Ok(Some(ComponentValue::Percentage(parser.parse()?))) } - Token::Function(box FunctionToken { value, .. }) - if is_math_function(value) => - { + Token::Function { value, .. } if is_math_function(value) => { Ok(Some(ComponentValue::Function(parser.parse()?))) } tok!("ident") => { @@ -741,9 +725,7 @@ where tok!("number") | tok!("percentage") => { Ok(Some(ComponentValue::AlphaValue(parser.parse()?))) } - Token::Function(box FunctionToken { value, .. }) - if is_math_function(value) => - { + Token::Function { value, .. } if is_math_function(value) => { Ok(Some(ComponentValue::Function(parser.parse()?))) } _ => { @@ -777,9 +759,7 @@ where tok!("number") | tok!("percentage") => { Ok(Some(ComponentValue::AlphaValue(parser.parse()?))) } - Token::Function(box FunctionToken { value, .. }) - if is_math_function(value) => - { + Token::Function { value, .. } if is_math_function(value) => { Ok(Some(ComponentValue::Function(parser.parse()?))) } tok!("ident") => { @@ -824,7 +804,7 @@ where let mut has_variable = false; match cur!(self) { - Token::Ident(box IdentToken { value, .. }) + Token::Ident { value, .. } if &*value.to_ascii_lowercase() == "from" && function_name != "device-cmyk" => { @@ -853,9 +833,7 @@ where tok!("number") | tok!("dimension") => { Ok(Some(ComponentValue::Hue(parser.parse()?))) } - Token::Function(box FunctionToken { value, .. }) - if is_math_function(value) => - { + Token::Function { value, .. } if is_math_function(value) => { Ok(Some(ComponentValue::Function(parser.parse()?))) } tok!("ident") => { @@ -900,9 +878,7 @@ where Ok(Some(ComponentValue::Percentage(parser.parse()?))) } tok!("number") => Ok(Some(ComponentValue::Number(parser.parse()?))), - Token::Function(box FunctionToken { value, .. }) - if is_math_function(value) => - { + Token::Function { value, .. } if is_math_function(value) => { Ok(Some(ComponentValue::Function(parser.parse()?))) } tok!("ident") => { @@ -965,9 +941,7 @@ where tok!("percentage") => { Ok(Some(ComponentValue::Percentage(parser.parse()?))) } - Token::Function(box FunctionToken { value, .. }) - if is_math_function(value) => - { + Token::Function { value, .. } if is_math_function(value) => { Ok(Some(ComponentValue::Function(parser.parse()?))) } tok!("ident") => { @@ -1016,9 +990,7 @@ where tok!("number") => { Ok(Some(ComponentValue::Number(parser.parse()?))) } - Token::Function(box FunctionToken { value, .. }) - if is_math_function(value) => - { + Token::Function { value, .. } if is_math_function(value) => { Ok(Some(ComponentValue::Function(parser.parse()?))) } tok!("ident") => { @@ -1086,9 +1058,7 @@ where tok!("percentage") => { Ok(Some(ComponentValue::Percentage(parser.parse()?))) } - Token::Function(box FunctionToken { value, .. }) - if is_math_function(value) => - { + Token::Function { value, .. } if is_math_function(value) => { Ok(Some(ComponentValue::Function(parser.parse()?))) } tok!("ident") => { @@ -1137,9 +1107,7 @@ where tok!("number") => { Ok(Some(ComponentValue::Number(parser.parse()?))) } - Token::Function(box FunctionToken { value, .. }) - if is_math_function(value) => - { + Token::Function { value, .. } if is_math_function(value) => { Ok(Some(ComponentValue::Function(parser.parse()?))) } tok!("ident") => { @@ -1185,9 +1153,7 @@ where tok!("number") | tok!("dimension") => { Ok(Some(ComponentValue::Hue(parser.parse()?))) } - Token::Function(box FunctionToken { value, .. }) - if is_math_function(value) => - { + Token::Function { value, .. } if is_math_function(value) => { Ok(Some(ComponentValue::Function(parser.parse()?))) } tok!("ident") => { @@ -1270,9 +1236,7 @@ where tok!("number") | tok!("percentage") => { Ok(Some(ComponentValue::AlphaValue(parser.parse()?))) } - Token::Function(box FunctionToken { value, .. }) - if is_math_function(value) => - { + Token::Function { value, .. } if is_math_function(value) => { Ok(Some(ComponentValue::Function(parser.parse()?))) } tok!("ident") if !matches!(function_name, "device-cmyk") => { @@ -1317,9 +1281,7 @@ where let mut has_variable = false; match cur!(self) { - Token::Ident(box IdentToken { value, .. }) - if &*value.to_ascii_lowercase() == "from" => - { + Token::Ident { value, .. } if &*value.to_ascii_lowercase() == "from" => { values.push(ComponentValue::Ident(self.parse()?)); self.input.skip_ws(); @@ -1343,7 +1305,7 @@ where let ident = self.try_parse_variable_function( |parser, _| match cur!(parser) { - Token::Ident(box IdentToken { value, .. }) => { + Token::Ident { value, .. } => { if value.starts_with("--") && value.len() > 2 { is_custom_params = true; @@ -1383,9 +1345,7 @@ where tok!("percentage") if !is_xyz => { Ok(Some(ComponentValue::Percentage(parser.parse()?))) } - Token::Function(box FunctionToken { value, .. }) - if is_math_function(value) => - { + Token::Function { value, .. } if is_math_function(value) => { Ok(Some(ComponentValue::Function(parser.parse()?))) } tok!("ident") => { @@ -1434,7 +1394,7 @@ where tok!("percentage") if !is_xyz => { ComponentValue::Percentage(self.parse()?) } - Token::Function(box FunctionToken { value, .. }) + Token::Function { value, .. } if is_math_function(value) || matches!( &*value.to_ascii_lowercase(), @@ -1471,9 +1431,7 @@ where tok!("percentage") if !is_xyz => { Ok(Some(ComponentValue::Percentage(parser.parse()?))) } - Token::Function(box FunctionToken { value, .. }) - if is_math_function(value) => - { + Token::Function { value, .. } if is_math_function(value) => { Ok(Some(ComponentValue::Function(parser.parse()?))) } tok!("ident") => { @@ -1529,9 +1487,7 @@ where )) } } - Token::Function(box FunctionToken { value, .. }) - if is_math_function(value) => - { + Token::Function { value, .. } if is_math_function(value) => { Ok(Some(ComponentValue::Function(parser.parse()?))) } _ => { @@ -1568,9 +1524,7 @@ where tok!("number") | tok!("percentage") => { Ok(Some(ComponentValue::AlphaValue(parser.parse()?))) } - Token::Function(box FunctionToken { value, .. }) - if is_math_function(value) => - { + Token::Function { value, .. } if is_math_function(value) => { Ok(Some(ComponentValue::Function(parser.parse()?))) } tok!("ident") if !matches!(function_name, "device-cmyk") => { @@ -1718,7 +1672,7 @@ where } match cur!(self) { - Token::Function(box FunctionToken { value, .. }) + Token::Function { value, .. } if matches!(&*value.to_ascii_lowercase(), "var" | "env" | "constant") => { *has_before_variable = true; @@ -1790,12 +1744,12 @@ where let value = bump!(self); match value { - Token::Number(box NumberToken { + Token::Number { value, raw, type_flag, .. - }) => { + } => { if type_flag == NumberType::Number { return Err(Error::new(span, ErrorKind::Expected("integer type"))); } @@ -1827,7 +1781,7 @@ where let value = bump!(self); match value { - Token::Number(box NumberToken { value, raw, .. }) => Ok(Number { + Token::Number { value, raw, .. } => Ok(Number { span, value, raw: Some(raw), @@ -1851,7 +1805,7 @@ where } match bump!(self) { - Token::Ident(box IdentToken { value, raw, .. }) => { + Token::Ident { value, raw, .. } => { match &*value.to_ascii_lowercase() { "initial" | "inherit" | "unset" | "revert" | "default" => { return Err(Error::new(span, ErrorKind::InvalidCustomIdent(value))); @@ -1884,7 +1838,7 @@ where } match bump!(self) { - Token::Ident(box IdentToken { value, raw, .. }) => { + Token::Ident { value, raw, .. } => { if !value.starts_with("--") { return Err(Error::new( span, @@ -1924,7 +1878,7 @@ where } match bump!(self) { - Token::Ident(box IdentToken { value, raw, .. }) => { + Token::Ident { value, raw, .. } => { if !value.starts_with("--") { return Err(Error::new( span, @@ -1962,7 +1916,7 @@ where } match bump!(self) { - Token::Ident(box IdentToken { value, raw, .. }) => Ok(Ident { + Token::Ident { value, raw, .. } => Ok(Ident { span, value, raw: Some(raw), @@ -2317,16 +2271,14 @@ where match cur!(self) { // currentcolor | - Token::Ident(box IdentToken { value, .. }) + Token::Ident { value, .. } if value.as_ref().eq_ignore_ascii_case("currentcolor") || is_system_color(value) => { Ok(Color::CurrentColorOrSystemColor(self.parse()?)) } // - Token::Function(box FunctionToken { value, .. }) - if value.as_ref().eq_ignore_ascii_case("device-cmyk") => - { + Token::Function { value, .. } if value.as_ref().eq_ignore_ascii_case("device-cmyk") => { Ok(Color::Function(self.parse()?)) } // @@ -2355,7 +2307,7 @@ where match cur!(self) { tok!("#") => Ok(AbsoluteColorBase::HexColor(self.parse()?)), - Token::Ident(box IdentToken { value, .. }) => { + Token::Ident { value, .. } => { if !(is_named_color(value) || value.as_ref().eq_ignore_ascii_case("transparent")) { let span = self.input.cur_span(); @@ -2367,9 +2319,7 @@ where Ok(AbsoluteColorBase::NamedColorOrTransparent(self.parse()?)) } - Token::Function(box FunctionToken { value, .. }) - if is_absolute_color_base_function(value) => - { + Token::Function { value, .. } if is_absolute_color_base_function(value) => { Ok(AbsoluteColorBase::Function(self.parse()?)) } _ => { @@ -2397,7 +2347,7 @@ where } match bump!(self) { - Token::Hash(box HashToken { value, raw, .. }) => Ok(HexColor { + Token::Hash { value, raw, .. } => Ok(HexColor { span, value, raw: Some(raw), @@ -2474,7 +2424,7 @@ where match cur!(self) { tok!("number") => Ok(CmykComponent::Number(self.parse()?)), tok!("percentage") => Ok(CmykComponent::Percentage(self.parse()?)), - Token::Function(box FunctionToken { value, .. }) => { + Token::Function { value, .. } => { if !is_math_function(value) { let span = self.input.cur_span(); @@ -2502,7 +2452,7 @@ where } match bump!(self) { - Token::Percentage(box PercentageToken { value, raw }) => { + Token::Percentage { value, raw } => { let value = Number { span: Span::new(span.lo, span.hi - BytePos(1), Default::default()), value, @@ -2530,7 +2480,7 @@ where } match bump!(self) { - Token::String(box StringToken { value, raw }) => Ok(Str { + Token::String { value, raw } => Ok(Str { span, value, raw: Some(raw), @@ -2581,10 +2531,10 @@ where modifiers: None, }) } - Token::Function(box FunctionToken { + Token::Function { value: function_name, raw: raw_function_name, - }) => { + } => { if &*function_name.to_ascii_lowercase() != "url" && &*function_name.to_ascii_lowercase() != "src" { @@ -2666,9 +2616,9 @@ where // should start with `u` or `U` match cur!(self) { - Token::Ident(box IdentToken { value, .. }) if &*value.to_ascii_lowercase() == "u" => { + Token::Ident { value, .. } if &*value.to_ascii_lowercase() == "u" => { let ident = match bump!(self) { - Token::Ident(box IdentToken { value, .. }) => value, + Token::Ident { value, .. } => value, _ => { unreachable!(); } @@ -2684,9 +2634,9 @@ where match cur!(self) { // u '+' '?'* // u '+' '?'+ - Token::Delim(box DelimToken { value }) if *value == '+' => { + Token::Delim { value } if *value == '+' => { let plus = match bump!(self) { - Token::Delim(box DelimToken { value }) => value, + Token::Delim { value } => value, _ => { unreachable!(); } @@ -2696,7 +2646,7 @@ where if is!(self, Ident) { let ident = match bump!(self) { - Token::Ident(box IdentToken { value, .. }) => value, + Token::Ident { value, .. } => value, _ => { unreachable!(); } @@ -2710,7 +2660,7 @@ where } let question = match bump!(self) { - Token::Delim(box DelimToken { value }) => value, + Token::Delim { value } => value, _ => { unreachable!(); } @@ -2720,7 +2670,7 @@ where } } else { let question = match bump!(self) { - Token::Delim(box DelimToken { value }) if value == '?' => value, + Token::Delim { value } if value == '?' => value, _ => { return Err(Error::new(span, ErrorKind::Expected("'?' delim token"))); } @@ -2734,7 +2684,7 @@ where } let question = match bump!(self) { - Token::Delim(box DelimToken { value }) => value, + Token::Delim { value } => value, _ => { unreachable!(); } @@ -2749,7 +2699,7 @@ where // u tok!("number") => { let number = match bump!(self) { - Token::Number(box NumberToken { raw, .. }) => raw, + Token::Number { raw, .. } => raw, _ => { unreachable!(); } @@ -2761,7 +2711,7 @@ where match cur!(self) { tok!("?") => { let question = match bump!(self) { - Token::Delim(box DelimToken { value }) => value, + Token::Delim { value } => value, _ => { unreachable!(); } @@ -2775,7 +2725,7 @@ where } let question = match bump!(self) { - Token::Delim(box DelimToken { value }) => value, + Token::Delim { value } => value, _ => { unreachable!(); } @@ -2797,7 +2747,7 @@ where } tok!("number") => { let number = match bump!(self) { - Token::Number(box NumberToken { raw, .. }) => raw, + Token::Number { raw, .. } => raw, _ => { unreachable!(); } @@ -2827,7 +2777,7 @@ where } let question = match bump!(self) { - Token::Delim(box DelimToken { value }) => value, + Token::Delim { value } => value, _ => { unreachable!(); } @@ -3216,7 +3166,7 @@ where tok!("number") => Ok(CalcValue::Number(self.parse()?)), tok!("dimension") => Ok(CalcValue::Dimension(self.parse()?)), tok!("percentage") => Ok(CalcValue::Percentage(self.parse()?)), - Token::Ident(box IdentToken { value, .. }) => { + Token::Ident { value, .. } => { match &*value.to_ascii_lowercase() { "e" | "pi" | "infinity" | "-infinity" | "nan" => {} _ => { From 71a3f488761cc2b9a8f18a7b7e5d04b2acb3fb9b Mon Sep 17 00:00:00 2001 From: "alexander.akait" Date: Mon, 5 Dec 2022 04:42:39 +0300 Subject: [PATCH 37/42] test: fix --- .../fixture/at-rule/container/span.swc-stderr | 20 +- .../fixture/at-rule/media/span.swc-stderr | 28 +- .../fixture/at-rule/supports/span.swc-stderr | 76 ++--- .../fixture/at-rule/unknown/span.swc-stderr | 290 +++++++++--------- .../fixture/dashed-ident/span.swc-stderr | 6 +- .../fixture/function/calc/span.swc-stderr | 4 +- .../selector/pseudo-class/has/span.swc-stderr | 30 +- .../selector/pseudo-class/is/span.swc-stderr | 40 +-- .../pseudo-class/unknown/span.swc-stderr | 48 +-- .../pseudo-class/where/span.swc-stderr | 24 +- .../pseudo-element/unknown/span.swc-stderr | 48 +-- .../tests/fixture/style-block/span.swc-stderr | 20 +- .../styled-jsx/selector/1/span.swc-stderr | 8 +- .../styled-jsx/selector/2/span.swc-stderr | 8 +- .../value/custom-property/span.swc-stderr | 90 +++--- .../tests/fixture/value/url/span.swc-stderr | 2 +- .../vendor/csstree/basic/span.swc-stderr | 6 +- .../6s_VBuRPHbPiUrh1fWCR_Q/span.swc-stderr | 2 +- .../L0mEf41IMkWcP7NotllkAg/span.swc-stderr | 8 +- .../MvD7ThpMVIxU3dzF71Gpcg/span.swc-stderr | 2 +- .../SnMCumHJazvlgOXgmxJ9Jg/span.swc-stderr | 2 +- .../WQWdwW4B4hm60AQgxTU08Q/span.swc-stderr | 2 +- .../_d22bZcPKDgNEKSyJ2NRsQ/span.swc-stderr | 2 +- .../_e6qpZBWfowEh1P3Wn3orA/span.swc-stderr | 2 +- .../d1BWbOHfSbCE8-_qEz-luA/span.swc-stderr | 2 +- .../pLQn9swtbpZ-CVZMGw0EwA/span.swc-stderr | 2 +- .../rome/custom-properties/span.swc-stderr | 20 +- .../vendor/rome/selectors/span.swc-stderr | 4 +- .../recovery/at-rule/document/span.swc-stderr | 18 +- .../at-rule/extra-semi/span.swc-stderr | 4 +- .../at-rule/font-face/span.swc-stderr | 12 +- .../at-rule/import/indent/span.swc-stderr | 2 +- .../import/invalid-layer/span.swc-stderr | 6 +- .../import/invalid-supports/span.swc-stderr | 2 +- .../at-rule/import/no-semi/span.swc-stderr | 4 +- .../at-rule/import/no-url/span.swc-stderr | 4 +- .../at-rule/import/unknown/span.swc-stderr | 10 +- .../keyframes/custom-ident-1/span.swc-stderr | 2 +- .../keyframes/custom-ident-2/span.swc-stderr | 2 +- .../keyframes/custom-ident-3/span.swc-stderr | 2 +- .../keyframes/custom-ident-4/span.swc-stderr | 2 +- .../keyframes/custom-ident/span.swc-stderr | 2 +- .../keyframe-broke-and-normal/span.swc-stderr | 2 +- .../span.swc-stderr | 10 +- .../keyframe-keyword/span.swc-stderr | 4 +- .../keyframes/keyframe-number/span.swc-stderr | 2 +- .../at-rule/layer/block/span.swc-stderr | 6 +- .../layer/string-name-block/span.swc-stderr | 2 +- .../string-name-statement/span.swc-stderr | 2 +- .../at-rule/media/condition-1/span.swc-stderr | 16 +- .../media/condition-and-or/span.swc-stderr | 10 +- .../at-rule/media/condition/span.swc-stderr | 10 +- .../media/feature-name-2/span.swc-stderr | 2 +- .../media/feature-name/span.swc-stderr | 2 +- .../media/feature-range-2/span.swc-stderr | 6 +- .../media/feature-range-3/span.swc-stderr | 10 +- .../media/feature-range-4/span.swc-stderr | 8 +- .../media/feature-range-5/span.swc-stderr | 10 +- .../media/feature-range-6/span.swc-stderr | 10 +- .../at-rule/media/feature/span.swc-stderr | 4 +- .../media/invalid-nesting/span.swc-stderr | 2 +- .../at-rule/media/media-type/span.swc-stderr | 4 +- .../media/wrong-stylesheet/span.swc-stderr | 6 +- .../page/invalid-pseudo/span.swc-stderr | 2 +- .../at-rule/page/no-space/span.swc-stderr | 4 +- .../at-rule/page/without-page/span.swc-stderr | 8 +- .../supports/no-parens/span.swc-stderr | 4 +- .../non-standard-prelude/span.swc-stderr | 22 +- .../supports/wrong-or-and/span.swc-stderr | 14 +- .../double-quotes/span.swc-stderr | 2 +- .../bad-url-token/escaped/span.swc-stderr | 2 +- .../invalid-escape/span.swc-stderr | 2 +- .../left-parenthesis/span.swc-stderr | 2 +- .../single-quotes/span.swc-stderr | 2 +- .../whitespace-in-middle/span.swc-stderr | 2 +- .../bad-url-token/whitespace/span.swc-stderr | 2 +- .../recovery/cdo-and-cdc/span.swc-stderr | 20 +- .../comments/bad-comment-1/span.swc-stderr | 6 +- .../comments/declaration/span.swc-stderr | 2 +- .../declaration/bad-value/span.swc-stderr | 30 +- .../declaration/basic/span.swc-stderr | 6 +- .../declaration/important-1/span.swc-stderr | 6 +- .../declaration/important/span.swc-stderr | 58 ++-- .../declaration/wrong-name/span.swc-stderr | 4 +- .../delim-token/ampersand/span.swc-stderr | 2 +- .../delim-token/asterisk/span.swc-stderr | 2 +- .../delim-token/at-sign/span.swc-stderr | 4 +- .../recovery/delim-token/bang/span.swc-stderr | 4 +- .../recovery/delim-token/bar/span.swc-stderr | 2 +- .../delim-token/caret/span.swc-stderr | 2 +- .../delim-token/dollar/span.swc-stderr | 2 +- .../delim-token/equals/span.swc-stderr | 2 +- .../delim-token/greater-than/span.swc-stderr | 2 +- .../recovery/delim-token/hash/span.swc-stderr | 4 +- .../delim-token/less-than/span.swc-stderr | 2 +- .../delim-token/minus/span.swc-stderr | 14 +- .../delim-token/percent/span.swc-stderr | 2 +- .../recovery/delim-token/plus/span.swc-stderr | 14 +- .../delim-token/question-mark/span.swc-stderr | 2 +- .../recovery/delim-token/star/span.swc-stderr | 2 +- .../delim-token/tilde/span.swc-stderr | 2 +- .../escaped/declaration-value/span.swc-stderr | 4 +- .../escaped/id-selector/span.swc-stderr | 2 +- .../function/bad-comment-2/span.swc-stderr | 2 +- .../function/bad-comment/span.swc-stderr | 2 +- .../recovery/function/base/span.swc-stderr | 22 +- .../function/nested-unclosed/span.swc-stderr | 2 +- .../recovery/function/rgb/span.swc-stderr | 56 ++-- .../function/unclosed-2/span.swc-stderr | 4 +- .../tests/recovery/hacks/span.swc-stderr | 160 +++++----- .../tests/recovery/ie-progid/span.swc-stderr | 60 ++-- .../tests/recovery/number/span.swc-stderr | 10 +- .../qualified-rule/basic/span.swc-stderr | 8 +- .../double-slash-comment/span.swc-stderr | 8 +- .../rules/at-rule-in-middle/span.swc-stderr | 2 +- .../rules/at-rule-with-semi/span.swc-stderr | 2 +- .../rules/unclosed-brackets/span.swc-stderr | 24 +- .../rules/unclosed-curly/span.swc-stderr | 4 +- .../invalid-matcher-1/span.swc-stderr | 4 +- .../invalid-matcher-2/span.swc-stderr | 8 +- .../invalid-matcher-3/span.swc-stderr | 12 +- .../invalid-matcher-4/span.swc-stderr | 10 +- .../attribute/invalid-matcher/span.swc-stderr | 8 +- .../invalid-modifier/span.swc-stderr | 8 +- .../attribute/unclosed/span.swc-stderr | 8 +- .../selector/combinator/only/span.swc-stderr | 2 +- .../selector/combinator/two/span.swc-stderr | 6 +- .../selector/id/invalid/span.swc-stderr | 2 +- .../pseudo-class/an-plus-b/span.swc-stderr | 2 +- .../invalid-function/span.swc-stderr | 2 +- .../invalid-ident/span.swc-stderr | 2 +- .../pseudo-class/invalid/span.swc-stderr | 8 +- .../pseudo-element/after/span.swc-stderr | 2 +- .../pseudo-element/between/span.swc-stderr | 2 +- .../pseudo-element/invalid/span.swc-stderr | 4 +- .../basic/span.swc-stderr | 22 +- .../invalid-nested-1/span.swc-stderr | 4 +- .../invalid-nested-2/span.swc-stderr | 4 +- .../invalid-nested/span.swc-stderr | 4 +- .../recovery/styled-jsx/1/span.swc-stderr | 30 +- .../recovery/styled-jsx/2/span.swc-stderr | 10 +- .../recovery/unicode-range/span.swc-stderr | 4 +- .../value/at-keyword/1/span.swc-stderr | 2 +- .../value/at-keyword/2/span.swc-stderr | 2 +- .../value/at-keyword/3/span.swc-stderr | 2 +- .../value/at-keyword/4/span.swc-stderr | 2 +- .../value/at-keyword/5/span.swc-stderr | 2 +- .../value/at-keyword/6/span.swc-stderr | 2 +- .../value/at-keyword/7/span.swc-stderr | 2 +- .../exclamation/span.swc-stderr | 14 +- .../only-dashed/span.swc-stderr | 10 +- .../recovery/value/hash/eof/span.swc-stderr | 2 +- .../recovery/value/number/dot/span.swc-stderr | 4 +- .../value/number/minus-dot/span.swc-stderr | 4 +- .../value/number/plus-dot/span.swc-stderr | 4 +- .../value/percentage/dot/span.swc-stderr | 6 +- .../value/percentage/minus/span.swc-stderr | 6 +- .../value/percentage/plus/span.swc-stderr | 6 +- .../recovery/value/quotes/span.swc-stderr | 6 +- .../value/string/escaped/eof/span.swc-stderr | 2 +- .../value/string/newline/span.swc-stderr | 2 +- .../recovery/value/url/basic/span.swc-stderr | 10 +- .../value/url/parenthesis/span.swc-stderr | 2 +- .../tests/recovery/vercel/001/span.swc-stderr | 2 +- .../tests/recovery/vercel/002/span.swc-stderr | 6 +- .../tests/recovery/vercel/003/span.swc-stderr | 10 +- .../tests/recovery/vercel/004/span.swc-stderr | 8 +- .../tests/recovery/vercel/005/span.swc-stderr | 8 +- 168 files changed, 963 insertions(+), 963 deletions(-) diff --git a/crates/swc_css_parser/tests/fixture/at-rule/container/span.swc-stderr b/crates/swc_css_parser/tests/fixture/at-rule/container/span.swc-stderr index a8a2d0fd85fa..f8062d1e617a 100644 --- a/crates/swc_css_parser/tests/fixture/at-rule/container/span.swc-stderr +++ b/crates/swc_css_parser/tests/fixture/at-rule/container/span.swc-stderr @@ -2220,7 +2220,7 @@ 43 | .card { margin-block: 2em; } `---- - x Ident(IdentToken { value: Atom('--responsive' type=dynamic), raw: "--responsive" }) + x Ident { value: Atom('--responsive' type=dynamic), raw: "--responsive" } ,-[$DIR/tests/fixture/at-rule/container/input.css:41:1] 41 | 42 | @container card (inline-size > 30em) and style(--responsive: true) { @@ -2268,7 +2268,7 @@ 43 | .card { margin-block: 2em; } `---- - x Ident(IdentToken { value: Atom('true' type=static), raw: "true" }) + x Ident { value: Atom('true' type=static), raw: "true" } ,-[$DIR/tests/fixture/at-rule/container/input.css:41:1] 41 | 42 | @container card (inline-size > 30em) and style(--responsive: true) { @@ -2572,7 +2572,7 @@ 47 | .card { margin-block: 2em; } `---- - x Ident(IdentToken { value: Atom('--responsive' type=dynamic), raw: "--responsive" }) + x Ident { value: Atom('--responsive' type=dynamic), raw: "--responsive" } ,-[$DIR/tests/fixture/at-rule/container/input.css:45:1] 45 | 46 | @container card (inline-size > 30em) or style(--responsive: true) { @@ -2620,7 +2620,7 @@ 47 | .card { margin-block: 2em; } `---- - x Ident(IdentToken { value: Atom('true' type=static), raw: "true" }) + x Ident { value: Atom('true' type=static), raw: "true" } ,-[$DIR/tests/fixture/at-rule/container/input.css:45:1] 45 | 46 | @container card (inline-size > 30em) or style(--responsive: true) { @@ -7402,7 +7402,7 @@ 114 | #inner { `---- - x Ident(IdentToken { value: Atom('--responsive' type=dynamic), raw: "--responsive" }) + x Ident { value: Atom('--responsive' type=dynamic), raw: "--responsive" } ,-[$DIR/tests/fixture/at-rule/container/input.css:112:1] 112 | 113 | @container test style(--responsive: true) { @@ -7450,7 +7450,7 @@ 114 | #inner { `---- - x Ident(IdentToken { value: Atom('true' type=static), raw: "true" }) + x Ident { value: Atom('true' type=static), raw: "true" } ,-[$DIR/tests/fixture/at-rule/container/input.css:112:1] 112 | 113 | @container test style(--responsive: true) { @@ -7684,7 +7684,7 @@ 120 | #inner { `---- - x Ident(IdentToken { value: Atom('--responsive' type=dynamic), raw: "--responsive" }) + x Ident { value: Atom('--responsive' type=dynamic), raw: "--responsive" } ,-[$DIR/tests/fixture/at-rule/container/input.css:118:1] 118 | 119 | @container style(--responsive: true) { @@ -7732,7 +7732,7 @@ 120 | #inner { `---- - x Ident(IdentToken { value: Atom('true' type=static), raw: "true" }) + x Ident { value: Atom('true' type=static), raw: "true" } ,-[$DIR/tests/fixture/at-rule/container/input.css:118:1] 118 | 119 | @container style(--responsive: true) { @@ -8087,7 +8087,7 @@ 127 | #inner { `---- - x Ident(IdentToken { value: Atom('--responsive' type=dynamic), raw: "--responsive" }) + x Ident { value: Atom('--responsive' type=dynamic), raw: "--responsive" } ,-[$DIR/tests/fixture/at-rule/container/input.css:125:1] 125 | @container card (inline-size > 30em) { 126 | @container style(--responsive: true) { @@ -8135,7 +8135,7 @@ 127 | #inner { `---- - x Ident(IdentToken { value: Atom('true' type=static), raw: "true" }) + x Ident { value: Atom('true' type=static), raw: "true" } ,-[$DIR/tests/fixture/at-rule/container/input.css:125:1] 125 | @container card (inline-size > 30em) { 126 | @container style(--responsive: true) { diff --git a/crates/swc_css_parser/tests/fixture/at-rule/media/span.swc-stderr b/crates/swc_css_parser/tests/fixture/at-rule/media/span.swc-stderr index f6819022ba15..c8b39c2f0951 100644 --- a/crates/swc_css_parser/tests/fixture/at-rule/media/span.swc-stderr +++ b/crates/swc_css_parser/tests/fixture/at-rule/media/span.swc-stderr @@ -21363,7 +21363,7 @@ 143 | @media (height foo bar) {} `---- - x Ident(IdentToken { value: Atom('height' type=inline), raw: "height" }) + x Ident { value: Atom('height' type=inline), raw: "height" } ,-[$DIR/tests/fixture/at-rule/media/input.css:141:1] 141 | 142 | @media (height << 600px) {} @@ -21395,7 +21395,7 @@ 143 | @media (height foo bar) {} `---- - x Delim(DelimToken { value: '<' }) + x Delim { value: '<' } ,-[$DIR/tests/fixture/at-rule/media/input.css:141:1] 141 | 142 | @media (height << 600px) {} @@ -21411,7 +21411,7 @@ 143 | @media (height foo bar) {} `---- - x Delim(DelimToken { value: '<' }) + x Delim { value: '<' } ,-[$DIR/tests/fixture/at-rule/media/input.css:141:1] 141 | 142 | @media (height << 600px) {} @@ -21563,7 +21563,7 @@ 144 | @media (height foo("bar")) {} `---- - x Ident(IdentToken { value: Atom('height' type=inline), raw: "height" }) + x Ident { value: Atom('height' type=inline), raw: "height" } ,-[$DIR/tests/fixture/at-rule/media/input.css:142:1] 142 | @media (height << 600px) {} 143 | @media (height foo bar) {} @@ -21595,7 +21595,7 @@ 144 | @media (height foo("bar")) {} `---- - x Ident(IdentToken { value: Atom('foo' type=inline), raw: "foo" }) + x Ident { value: Atom('foo' type=inline), raw: "foo" } ,-[$DIR/tests/fixture/at-rule/media/input.css:142:1] 142 | @media (height << 600px) {} 143 | @media (height foo bar) {} @@ -21627,7 +21627,7 @@ 144 | @media (height foo("bar")) {} `---- - x Ident(IdentToken { value: Atom('bar' type=inline), raw: "bar" }) + x Ident { value: Atom('bar' type=inline), raw: "bar" } ,-[$DIR/tests/fixture/at-rule/media/input.css:142:1] 142 | @media (height << 600px) {} 143 | @media (height foo bar) {} @@ -21747,7 +21747,7 @@ 145 | @media (height + 600px) {} `---- - x Ident(IdentToken { value: Atom('height' type=inline), raw: "height" }) + x Ident { value: Atom('height' type=inline), raw: "height" } ,-[$DIR/tests/fixture/at-rule/media/input.css:143:1] 143 | @media (height foo bar) {} 144 | @media (height foo("bar")) {} @@ -21803,7 +21803,7 @@ 145 | @media (height + 600px) {} `---- - x String(StringToken { value: Atom('bar' type=inline), raw: "\"bar\"" }) + x String { value: Atom('bar' type=inline), raw: "\"bar\"" } ,-[$DIR/tests/fixture/at-rule/media/input.css:143:1] 143 | @media (height foo bar) {} 144 | @media (height foo("bar")) {} @@ -21923,7 +21923,7 @@ 146 | @media screen and (min-width: ) {} `---- - x Ident(IdentToken { value: Atom('height' type=inline), raw: "height" }) + x Ident { value: Atom('height' type=inline), raw: "height" } ,-[$DIR/tests/fixture/at-rule/media/input.css:144:1] 144 | @media (height foo("bar")) {} 145 | @media (height + 600px) {} @@ -21955,7 +21955,7 @@ 146 | @media screen and (min-width: ) {} `---- - x Delim(DelimToken { value: '+' }) + x Delim { value: '+' } ,-[$DIR/tests/fixture/at-rule/media/input.css:144:1] 144 | @media (height foo("bar")) {} 145 | @media (height + 600px) {} @@ -22131,7 +22131,7 @@ 147 | @media (aspect-ratio: 12/) {} `---- - x Ident(IdentToken { value: Atom('min-width' type=dynamic), raw: "min-width" }) + x Ident { value: Atom('min-width' type=dynamic), raw: "min-width" } ,-[$DIR/tests/fixture/at-rule/media/input.css:145:1] 145 | @media (height + 600px) {} 146 | @media screen and (min-width: ) {} @@ -22283,7 +22283,7 @@ 148 | @media func(100px) {} `---- - x Ident(IdentToken { value: Atom('aspect-ratio' type=dynamic), raw: "aspect-ratio" }) + x Ident { value: Atom('aspect-ratio' type=dynamic), raw: "aspect-ratio" } ,-[$DIR/tests/fixture/at-rule/media/input.css:146:1] 146 | @media screen and (min-width: ) {} 147 | @media (aspect-ratio: 12/) {} @@ -22331,7 +22331,7 @@ 148 | @media func(100px) {} `---- - x Number(NumberToken { value: 12.0, raw: "12", type_flag: Integer }) + x Number { value: 12.0, raw: "12", type_flag: Integer } ,-[$DIR/tests/fixture/at-rule/media/input.css:146:1] 146 | @media screen and (min-width: ) {} 147 | @media (aspect-ratio: 12/) {} @@ -22347,7 +22347,7 @@ 148 | @media func(100px) {} `---- - x Delim(DelimToken { value: '/' }) + x Delim { value: '/' } ,-[$DIR/tests/fixture/at-rule/media/input.css:146:1] 146 | @media screen and (min-width: ) {} 147 | @media (aspect-ratio: 12/) {} diff --git a/crates/swc_css_parser/tests/fixture/at-rule/supports/span.swc-stderr b/crates/swc_css_parser/tests/fixture/at-rule/supports/span.swc-stderr index 9451e3e3a211..bfc26c77f9b9 100644 --- a/crates/swc_css_parser/tests/fixture/at-rule/supports/span.swc-stderr +++ b/crates/swc_css_parser/tests/fixture/at-rule/supports/span.swc-stderr @@ -6442,7 +6442,7 @@ 52 | [--self] { `---- - x String(StringToken { value: Atom('.minwidth' type=dynamic), raw: "\".minwidth\"" }) + x String { value: Atom('.minwidth' type=dynamic), raw: "\".minwidth\"" } ,-[$DIR/tests/fixture/at-rule/supports/input.css:50:1] 50 | 51 | @supports (--element(".minwidth")) { @@ -7240,7 +7240,7 @@ 66 | * { background: red; } `---- - x Ident(IdentToken { value: Atom('ident' type=inline), raw: "ident" }) + x Ident { value: Atom('ident' type=inline), raw: "ident" } ,-[$DIR/tests/fixture/at-rule/supports/input.css:64:1] 64 | 65 | @supports (ident "str") { @@ -7272,7 +7272,7 @@ 66 | * { background: red; } `---- - x String(StringToken { value: Atom('str' type=inline), raw: "\"str\"" }) + x String { value: Atom('str' type=inline), raw: "\"str\"" } ,-[$DIR/tests/fixture/at-rule/supports/input.css:64:1] 64 | 65 | @supports (ident "str") { @@ -7520,7 +7520,7 @@ 70 | * { background: red; } `---- - x Ident(IdentToken { value: Atom('ident' type=inline), raw: "ident" }) + x Ident { value: Atom('ident' type=inline), raw: "ident" } ,-[$DIR/tests/fixture/at-rule/supports/input.css:68:1] 68 | 69 | @supports ((ident "str")) { @@ -7552,7 +7552,7 @@ 70 | * { background: red; } `---- - x String(StringToken { value: Atom('str' type=inline), raw: "\"str\"" }) + x String { value: Atom('str' type=inline), raw: "\"str\"" } ,-[$DIR/tests/fixture/at-rule/supports/input.css:68:1] 68 | 69 | @supports ((ident "str")) { @@ -7792,7 +7792,7 @@ 74 | * { background: red; } `---- - x Number(NumberToken { value: 10.0, raw: "10", type_flag: Integer }) + x Number { value: 10.0, raw: "10", type_flag: Integer } ,-[$DIR/tests/fixture/at-rule/supports/input.css:72:1] 72 | 73 | @supports func(10, 20, 40) { @@ -7840,7 +7840,7 @@ 74 | * { background: red; } `---- - x Number(NumberToken { value: 20.0, raw: "20", type_flag: Integer }) + x Number { value: 20.0, raw: "20", type_flag: Integer } ,-[$DIR/tests/fixture/at-rule/supports/input.css:72:1] 72 | 73 | @supports func(10, 20, 40) { @@ -7888,7 +7888,7 @@ 74 | * { background: red; } `---- - x Number(NumberToken { value: 40.0, raw: "40", type_flag: Integer }) + x Number { value: 40.0, raw: "40", type_flag: Integer } ,-[$DIR/tests/fixture/at-rule/supports/input.css:72:1] 72 | 73 | @supports func(10, 20, 40) { @@ -8136,7 +8136,7 @@ 78 | * { background: red; } `---- - x Number(NumberToken { value: 10.0, raw: "10", type_flag: Integer }) + x Number { value: 10.0, raw: "10", type_flag: Integer } ,-[$DIR/tests/fixture/at-rule/supports/input.css:76:1] 76 | 77 | @supports (func(10, 20, 40)) { @@ -8184,7 +8184,7 @@ 78 | * { background: red; } `---- - x Number(NumberToken { value: 20.0, raw: "20", type_flag: Integer }) + x Number { value: 20.0, raw: "20", type_flag: Integer } ,-[$DIR/tests/fixture/at-rule/supports/input.css:76:1] 76 | 77 | @supports (func(10, 20, 40)) { @@ -8232,7 +8232,7 @@ 78 | * { background: red; } `---- - x Number(NumberToken { value: 40.0, raw: "40", type_flag: Integer }) + x Number { value: 40.0, raw: "40", type_flag: Integer } ,-[$DIR/tests/fixture/at-rule/supports/input.css:76:1] 76 | 77 | @supports (func(10, 20, 40)) { @@ -8496,7 +8496,7 @@ 82 | * { background: red; } `---- - x Number(NumberToken { value: 10.0, raw: "10", type_flag: Integer }) + x Number { value: 10.0, raw: "10", type_flag: Integer } ,-[$DIR/tests/fixture/at-rule/supports/input.css:80:1] 80 | 81 | @supports ( func( 10 , 20 , 40 ) ) { @@ -8560,7 +8560,7 @@ 82 | * { background: red; } `---- - x Number(NumberToken { value: 20.0, raw: "20", type_flag: Integer }) + x Number { value: 20.0, raw: "20", type_flag: Integer } ,-[$DIR/tests/fixture/at-rule/supports/input.css:80:1] 80 | 81 | @supports ( func( 10 , 20 , 40 ) ) { @@ -8624,7 +8624,7 @@ 82 | * { background: red; } `---- - x Number(NumberToken { value: 40.0, raw: "40", type_flag: Integer }) + x Number { value: 40.0, raw: "40", type_flag: Integer } ,-[$DIR/tests/fixture/at-rule/supports/input.css:80:1] 80 | 81 | @supports ( func( 10 , 20 , 40 ) ) { @@ -9023,7 +9023,7 @@ 87 | from { `---- - x Ident(IdentToken { value: Atom('anim' type=inline), raw: "anim" }) + x Ident { value: Atom('anim' type=inline), raw: "anim" } ,-[$DIR/tests/fixture/at-rule/supports/input.css:85:1] 85 | @supports (animation-name: test) { 86 | @-custom-keyframe anim { @@ -9093,7 +9093,7 @@ 88 | color: black; `---- - x Ident(IdentToken { value: Atom('from' type=static), raw: "from" }) + x Ident { value: Atom('from' type=static), raw: "from" } ,-[$DIR/tests/fixture/at-rule/supports/input.css:86:1] 86 | @-custom-keyframe anim { 87 | from { @@ -9167,7 +9167,7 @@ 89 | } `---- - x Ident(IdentToken { value: Atom('color' type=static), raw: "color" }) + x Ident { value: Atom('color' type=static), raw: "color" } ,-[$DIR/tests/fixture/at-rule/supports/input.css:87:1] 87 | from { 88 | color: black; @@ -9215,7 +9215,7 @@ 89 | } `---- - x Ident(IdentToken { value: Atom('black' type=inline), raw: "black" }) + x Ident { value: Atom('black' type=inline), raw: "black" } ,-[$DIR/tests/fixture/at-rule/supports/input.css:87:1] 87 | from { 88 | color: black; @@ -9279,7 +9279,7 @@ 91 | color: white `---- - x Ident(IdentToken { value: Atom('to' type=static), raw: "to" }) + x Ident { value: Atom('to' type=static), raw: "to" } ,-[$DIR/tests/fixture/at-rule/supports/input.css:89:1] 89 | } 90 | to { @@ -9353,7 +9353,7 @@ 92 | } `---- - x Ident(IdentToken { value: Atom('color' type=static), raw: "color" }) + x Ident { value: Atom('color' type=static), raw: "color" } ,-[$DIR/tests/fixture/at-rule/supports/input.css:90:1] 90 | to { 91 | color: white @@ -9401,7 +9401,7 @@ 92 | } `---- - x Ident(IdentToken { value: Atom('white' type=inline), raw: "white" }) + x Ident { value: Atom('white' type=inline), raw: "white" } ,-[$DIR/tests/fixture/at-rule/supports/input.css:90:1] 90 | to { 91 | color: white @@ -9521,7 +9521,7 @@ 97 | * { background: red; } `---- - x Ident(IdentToken { value: Atom('--var' type=inline), raw: "--var" }) + x Ident { value: Atom('--var' type=inline), raw: "--var" } ,-[$DIR/tests/fixture/at-rule/supports/input.css:95:1] 95 | 96 | @supports (--var) { @@ -9781,7 +9781,7 @@ 101 | body { `---- - x Ident(IdentToken { value: Atom('green' type=inline), raw: "green" }) + x Ident { value: Atom('green' type=inline), raw: "green" } ,-[$DIR/tests/fixture/at-rule/supports/input.css:99:1] 99 | 100 | @supports (--foo: green) { @@ -11624,7 +11624,7 @@ 124 | from { `---- - x Ident(IdentToken { value: Atom('anim' type=inline), raw: "anim" }) + x Ident { value: Atom('anim' type=inline), raw: "anim" } ,-[$DIR/tests/fixture/at-rule/supports/input.css:122:1] 122 | @supports (animation-name: test) { 123 | @-custom-keyframe anim { @@ -11694,7 +11694,7 @@ 125 | color: black; `---- - x Ident(IdentToken { value: Atom('from' type=static), raw: "from" }) + x Ident { value: Atom('from' type=static), raw: "from" } ,-[$DIR/tests/fixture/at-rule/supports/input.css:123:1] 123 | @-custom-keyframe anim { 124 | from { @@ -11768,7 +11768,7 @@ 126 | } `---- - x Ident(IdentToken { value: Atom('color' type=static), raw: "color" }) + x Ident { value: Atom('color' type=static), raw: "color" } ,-[$DIR/tests/fixture/at-rule/supports/input.css:124:1] 124 | from { 125 | color: black; @@ -11816,7 +11816,7 @@ 126 | } `---- - x Ident(IdentToken { value: Atom('black' type=inline), raw: "black" }) + x Ident { value: Atom('black' type=inline), raw: "black" } ,-[$DIR/tests/fixture/at-rule/supports/input.css:124:1] 124 | from { 125 | color: black; @@ -11880,7 +11880,7 @@ 128 | color: white `---- - x Ident(IdentToken { value: Atom('to' type=static), raw: "to" }) + x Ident { value: Atom('to' type=static), raw: "to" } ,-[$DIR/tests/fixture/at-rule/supports/input.css:126:1] 126 | } 127 | to { @@ -11954,7 +11954,7 @@ 129 | } `---- - x Ident(IdentToken { value: Atom('color' type=static), raw: "color" }) + x Ident { value: Atom('color' type=static), raw: "color" } ,-[$DIR/tests/fixture/at-rule/supports/input.css:127:1] 127 | to { 128 | color: white @@ -12002,7 +12002,7 @@ 129 | } `---- - x Ident(IdentToken { value: Atom('white' type=inline), raw: "white" }) + x Ident { value: Atom('white' type=inline), raw: "white" } ,-[$DIR/tests/fixture/at-rule/supports/input.css:127:1] 127 | to { 128 | color: white @@ -12910,7 +12910,7 @@ 146 | * { background: red; } `---- - x String(StringToken { value: Atom('example' type=inline), raw: "\"example\"" }) + x String { value: Atom('example' type=inline), raw: "\"example\"" } ,-[$DIR/tests/fixture/at-rule/supports/input.css:144:1] 144 | 145 | @supports (func("example": 1)) { @@ -12958,7 +12958,7 @@ 146 | * { background: red; } `---- - x Number(NumberToken { value: 1.0, raw: "1", type_flag: Integer }) + x Number { value: 1.0, raw: "1", type_flag: Integer } ,-[$DIR/tests/fixture/at-rule/supports/input.css:144:1] 144 | 145 | @supports (func("example": 1)) { @@ -13198,7 +13198,7 @@ 150 | * { background: red; } `---- - x Ident(IdentToken { value: Atom('--var' type=inline), raw: "--var" }) + x Ident { value: Atom('--var' type=inline), raw: "--var" } ,-[$DIR/tests/fixture/at-rule/supports/input.css:148:1] 148 | 149 | @supports (--var) { @@ -13888,7 +13888,7 @@ 160 | * { background: red; } `---- - x String(StringToken { value: Atom('example' type=inline), raw: "\"example\"" }) + x String { value: Atom('example' type=inline), raw: "\"example\"" } ,-[$DIR/tests/fixture/at-rule/supports/input.css:158:1] 158 | 159 | @supports ( func("example": 1) ) { @@ -13936,7 +13936,7 @@ 160 | * { background: red; } `---- - x Number(NumberToken { value: 1.0, raw: "1", type_flag: Integer }) + x Number { value: 1.0, raw: "1", type_flag: Integer } ,-[$DIR/tests/fixture/at-rule/supports/input.css:158:1] 158 | 159 | @supports ( func("example": 1) ) { @@ -14192,7 +14192,7 @@ 164 | * { background: red; } `---- - x Ident(IdentToken { value: Atom('--var' type=inline), raw: "--var" }) + x Ident { value: Atom('--var' type=inline), raw: "--var" } ,-[$DIR/tests/fixture/at-rule/supports/input.css:162:1] 162 | 163 | @supports ( --var ) { @@ -14464,7 +14464,7 @@ 168 | * { background: red; } `---- - x Ident(IdentToken { value: Atom('--var' type=inline), raw: "--var" }) + x Ident { value: Atom('--var' type=inline), raw: "--var" } ,-[$DIR/tests/fixture/at-rule/supports/input.css:166:1] 166 | 167 | @supports ( --var "test" ) { @@ -14496,7 +14496,7 @@ 168 | * { background: red; } `---- - x String(StringToken { value: Atom('test' type=inline), raw: "\"test\"" }) + x String { value: Atom('test' type=inline), raw: "\"test\"" } ,-[$DIR/tests/fixture/at-rule/supports/input.css:166:1] 166 | 167 | @supports ( --var "test" ) { diff --git a/crates/swc_css_parser/tests/fixture/at-rule/unknown/span.swc-stderr b/crates/swc_css_parser/tests/fixture/at-rule/unknown/span.swc-stderr index 535183eaccfd..bf4c6699d98a 100644 --- a/crates/swc_css_parser/tests/fixture/at-rule/unknown/span.swc-stderr +++ b/crates/swc_css_parser/tests/fixture/at-rule/unknown/span.swc-stderr @@ -152,7 +152,7 @@ 3 | @unknown "blah"; `---- - x Ident(IdentToken { value: Atom('x' type=static), raw: "x" }) + x Ident { value: Atom('x' type=static), raw: "x" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:1:1] 1 | @unknown; 2 | @unknown x y; @@ -184,7 +184,7 @@ 3 | @unknown "blah"; `---- - x Ident(IdentToken { value: Atom('y' type=inline), raw: "y" }) + x Ident { value: Atom('y' type=inline), raw: "y" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:1:1] 1 | @unknown; 2 | @unknown x y; @@ -248,7 +248,7 @@ 4 | @unknown \"blah\"; `---- - x String(StringToken { value: Atom('blah' type=inline), raw: "\"blah\"" }) + x String { value: Atom('blah' type=inline), raw: "\"blah\"" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:2:1] 2 | @unknown x y; 3 | @unknown "blah"; @@ -312,7 +312,7 @@ 5 | @unknown /*test*/; `---- - x Ident(IdentToken { value: Atom('"blah"' type=inline), raw: "\\\"blah\\\"" }) + x Ident { value: Atom('"blah"' type=inline), raw: "\\\"blah\\\"" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:3:1] 3 | @unknown "blah"; 4 | @unknown \"blah\"; @@ -424,7 +424,7 @@ 7 | @unknown ; `---- - x Ident(IdentToken { value: Atom('x' type=static), raw: "x" }) + x Ident { value: Atom('x' type=static), raw: "x" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:5:1] 5 | @unknown /*test*/; 6 | @unknown /*test*/x/*test*/ y; @@ -456,7 +456,7 @@ 7 | @unknown ; `---- - x Ident(IdentToken { value: Atom('y' type=inline), raw: "y" }) + x Ident { value: Atom('y' type=inline), raw: "y" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:5:1] 5 | @unknown /*test*/; 6 | @unknown /*test*/x/*test*/ y; @@ -561,7 +561,7 @@ : ^ `---- - x Ident(IdentToken { value: Atom('x' type=static), raw: "x" }) + x Ident { value: Atom('x' type=static), raw: "x" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:7:1] 7 | @unknown ; 8 | @unknown x y; @@ -589,7 +589,7 @@ : ^ `---- - x Ident(IdentToken { value: Atom('y' type=inline), raw: "y" }) + x Ident { value: Atom('y' type=inline), raw: "y" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:7:1] 7 | @unknown ; 8 | @unknown x y; @@ -780,7 +780,7 @@ 13 | @unknown {p:v} `---- - x Ident(IdentToken { value: Atom('a' type=static), raw: "a" }) + x Ident { value: Atom('a' type=static), raw: "a" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:11:1] 11 | @\unknown {} 12 | @unknown a b {} @@ -812,7 +812,7 @@ 13 | @unknown {p:v} `---- - x Ident(IdentToken { value: Atom('b' type=static), raw: "b" }) + x Ident { value: Atom('b' type=static), raw: "b" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:11:1] 11 | @\unknown {} 12 | @unknown a b {} @@ -924,7 +924,7 @@ 14 | @unknown x y {p:v} `---- - x Ident(IdentToken { value: Atom('p' type=static), raw: "p" }) + x Ident { value: Atom('p' type=static), raw: "p" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:12:1] 12 | @unknown a b {} 13 | @unknown {p:v} @@ -956,7 +956,7 @@ 14 | @unknown x y {p:v} `---- - x Ident(IdentToken { value: Atom('v' type=inline), raw: "v" }) + x Ident { value: Atom('v' type=inline), raw: "v" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:12:1] 12 | @unknown a b {} 13 | @unknown {p:v} @@ -1020,7 +1020,7 @@ 15 | @unknown x, y x(1) {p:v} `---- - x Ident(IdentToken { value: Atom('x' type=static), raw: "x" }) + x Ident { value: Atom('x' type=static), raw: "x" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:13:1] 13 | @unknown {p:v} 14 | @unknown x y {p:v} @@ -1052,7 +1052,7 @@ 15 | @unknown x, y x(1) {p:v} `---- - x Ident(IdentToken { value: Atom('y' type=inline), raw: "y" }) + x Ident { value: Atom('y' type=inline), raw: "y" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:13:1] 13 | @unknown {p:v} 14 | @unknown x y {p:v} @@ -1100,7 +1100,7 @@ 15 | @unknown x, y x(1) {p:v} `---- - x Ident(IdentToken { value: Atom('p' type=static), raw: "p" }) + x Ident { value: Atom('p' type=static), raw: "p" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:13:1] 13 | @unknown {p:v} 14 | @unknown x y {p:v} @@ -1132,7 +1132,7 @@ 15 | @unknown x, y x(1) {p:v} `---- - x Ident(IdentToken { value: Atom('v' type=inline), raw: "v" }) + x Ident { value: Atom('v' type=inline), raw: "v" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:13:1] 13 | @unknown {p:v} 14 | @unknown x y {p:v} @@ -1196,7 +1196,7 @@ 16 | @unknown x, y x(1+2) {p:v} `---- - x Ident(IdentToken { value: Atom('x' type=static), raw: "x" }) + x Ident { value: Atom('x' type=static), raw: "x" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:14:1] 14 | @unknown x y {p:v} 15 | @unknown x, y x(1) {p:v} @@ -1244,7 +1244,7 @@ 16 | @unknown x, y x(1+2) {p:v} `---- - x Ident(IdentToken { value: Atom('y' type=inline), raw: "y" }) + x Ident { value: Atom('y' type=inline), raw: "y" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:14:1] 14 | @unknown x y {p:v} 15 | @unknown x, y x(1) {p:v} @@ -1300,7 +1300,7 @@ 16 | @unknown x, y x(1+2) {p:v} `---- - x Number(NumberToken { value: 1.0, raw: "1", type_flag: Integer }) + x Number { value: 1.0, raw: "1", type_flag: Integer } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:14:1] 14 | @unknown x y {p:v} 15 | @unknown x, y x(1) {p:v} @@ -1348,7 +1348,7 @@ 16 | @unknown x, y x(1+2) {p:v} `---- - x Ident(IdentToken { value: Atom('p' type=static), raw: "p" }) + x Ident { value: Atom('p' type=static), raw: "p" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:14:1] 14 | @unknown x y {p:v} 15 | @unknown x, y x(1) {p:v} @@ -1380,7 +1380,7 @@ 16 | @unknown x, y x(1+2) {p:v} `---- - x Ident(IdentToken { value: Atom('v' type=inline), raw: "v" }) + x Ident { value: Atom('v' type=inline), raw: "v" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:14:1] 14 | @unknown x y {p:v} 15 | @unknown x, y x(1) {p:v} @@ -1444,7 +1444,7 @@ 17 | @unknown/*test*/{/*test*/p/*test*/:/*test*/v/*test*/} `---- - x Ident(IdentToken { value: Atom('x' type=static), raw: "x" }) + x Ident { value: Atom('x' type=static), raw: "x" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:15:1] 15 | @unknown x, y x(1) {p:v} 16 | @unknown x, y x(1+2) {p:v} @@ -1492,7 +1492,7 @@ 17 | @unknown/*test*/{/*test*/p/*test*/:/*test*/v/*test*/} `---- - x Ident(IdentToken { value: Atom('y' type=inline), raw: "y" }) + x Ident { value: Atom('y' type=inline), raw: "y" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:15:1] 15 | @unknown x, y x(1) {p:v} 16 | @unknown x, y x(1+2) {p:v} @@ -1548,7 +1548,7 @@ 17 | @unknown/*test*/{/*test*/p/*test*/:/*test*/v/*test*/} `---- - x Number(NumberToken { value: 1.0, raw: "1", type_flag: Integer }) + x Number { value: 1.0, raw: "1", type_flag: Integer } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:15:1] 15 | @unknown x, y x(1) {p:v} 16 | @unknown x, y x(1+2) {p:v} @@ -1564,7 +1564,7 @@ 17 | @unknown/*test*/{/*test*/p/*test*/:/*test*/v/*test*/} `---- - x Number(NumberToken { value: 2.0, raw: "+2", type_flag: Integer }) + x Number { value: 2.0, raw: "+2", type_flag: Integer } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:15:1] 15 | @unknown x, y x(1) {p:v} 16 | @unknown x, y x(1+2) {p:v} @@ -1612,7 +1612,7 @@ 17 | @unknown/*test*/{/*test*/p/*test*/:/*test*/v/*test*/} `---- - x Ident(IdentToken { value: Atom('p' type=static), raw: "p" }) + x Ident { value: Atom('p' type=static), raw: "p" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:15:1] 15 | @unknown x, y x(1) {p:v} 16 | @unknown x, y x(1+2) {p:v} @@ -1644,7 +1644,7 @@ 17 | @unknown/*test*/{/*test*/p/*test*/:/*test*/v/*test*/} `---- - x Ident(IdentToken { value: Atom('v' type=inline), raw: "v" }) + x Ident { value: Atom('v' type=inline), raw: "v" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:15:1] 15 | @unknown x, y x(1) {p:v} 16 | @unknown x, y x(1+2) {p:v} @@ -1708,7 +1708,7 @@ 18 | @unknown /*test*/x/*test*/ y/*test*/{/*test*/p/*test*/:/*test*/v/*test*/} `---- - x Ident(IdentToken { value: Atom('p' type=static), raw: "p" }) + x Ident { value: Atom('p' type=static), raw: "p" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:16:1] 16 | @unknown x, y x(1+2) {p:v} 17 | @unknown/*test*/{/*test*/p/*test*/:/*test*/v/*test*/} @@ -1740,7 +1740,7 @@ 18 | @unknown /*test*/x/*test*/ y/*test*/{/*test*/p/*test*/:/*test*/v/*test*/} `---- - x Ident(IdentToken { value: Atom('v' type=inline), raw: "v" }) + x Ident { value: Atom('v' type=inline), raw: "v" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:16:1] 16 | @unknown x, y x(1+2) {p:v} 17 | @unknown/*test*/{/*test*/p/*test*/:/*test*/v/*test*/} @@ -1804,7 +1804,7 @@ 19 | /*@unknown !*test*!x!*test*!,!*test*!y!*test*! x(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}*/ `---- - x Ident(IdentToken { value: Atom('x' type=static), raw: "x" }) + x Ident { value: Atom('x' type=static), raw: "x" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:17:1] 17 | @unknown/*test*/{/*test*/p/*test*/:/*test*/v/*test*/} 18 | @unknown /*test*/x/*test*/ y/*test*/{/*test*/p/*test*/:/*test*/v/*test*/} @@ -1836,7 +1836,7 @@ 19 | /*@unknown !*test*!x!*test*!,!*test*!y!*test*! x(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}*/ `---- - x Ident(IdentToken { value: Atom('y' type=inline), raw: "y" }) + x Ident { value: Atom('y' type=inline), raw: "y" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:17:1] 17 | @unknown/*test*/{/*test*/p/*test*/:/*test*/v/*test*/} 18 | @unknown /*test*/x/*test*/ y/*test*/{/*test*/p/*test*/:/*test*/v/*test*/} @@ -1868,7 +1868,7 @@ 19 | /*@unknown !*test*!x!*test*!,!*test*!y!*test*! x(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}*/ `---- - x Ident(IdentToken { value: Atom('p' type=static), raw: "p" }) + x Ident { value: Atom('p' type=static), raw: "p" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:17:1] 17 | @unknown/*test*/{/*test*/p/*test*/:/*test*/v/*test*/} 18 | @unknown /*test*/x/*test*/ y/*test*/{/*test*/p/*test*/:/*test*/v/*test*/} @@ -1900,7 +1900,7 @@ 19 | /*@unknown !*test*!x!*test*!,!*test*!y!*test*! x(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}*/ `---- - x Ident(IdentToken { value: Atom('v' type=inline), raw: "v" }) + x Ident { value: Atom('v' type=inline), raw: "v" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:17:1] 17 | @unknown/*test*/{/*test*/p/*test*/:/*test*/v/*test*/} 18 | @unknown /*test*/x/*test*/ y/*test*/{/*test*/p/*test*/:/*test*/v/*test*/} @@ -1996,7 +1996,7 @@ 21 | @unknown x y { p : v } `---- - x Ident(IdentToken { value: Atom('p' type=static), raw: "p" }) + x Ident { value: Atom('p' type=static), raw: "p" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:19:1] 19 | /*@unknown !*test*!x!*test*!,!*test*!y!*test*! x(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}*/ 20 | @unknown { p : v } @@ -2060,7 +2060,7 @@ 21 | @unknown x y { p : v } `---- - x Ident(IdentToken { value: Atom('v' type=inline), raw: "v" }) + x Ident { value: Atom('v' type=inline), raw: "v" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:19:1] 19 | /*@unknown !*test*!x!*test*!,!*test*!y!*test*! x(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}*/ 20 | @unknown { p : v } @@ -2140,7 +2140,7 @@ 22 | @unknown x , y x( 1 + 2 ) { p : v } `---- - x Ident(IdentToken { value: Atom('x' type=static), raw: "x" }) + x Ident { value: Atom('x' type=static), raw: "x" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:20:1] 20 | @unknown { p : v } 21 | @unknown x y { p : v } @@ -2172,7 +2172,7 @@ 22 | @unknown x , y x( 1 + 2 ) { p : v } `---- - x Ident(IdentToken { value: Atom('y' type=inline), raw: "y" }) + x Ident { value: Atom('y' type=inline), raw: "y" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:20:1] 20 | @unknown { p : v } 21 | @unknown x y { p : v } @@ -2236,7 +2236,7 @@ 22 | @unknown x , y x( 1 + 2 ) { p : v } `---- - x Ident(IdentToken { value: Atom('p' type=static), raw: "p" }) + x Ident { value: Atom('p' type=static), raw: "p" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:20:1] 20 | @unknown { p : v } 21 | @unknown x y { p : v } @@ -2300,7 +2300,7 @@ 22 | @unknown x , y x( 1 + 2 ) { p : v } `---- - x Ident(IdentToken { value: Atom('v' type=inline), raw: "v" }) + x Ident { value: Atom('v' type=inline), raw: "v" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:20:1] 20 | @unknown { p : v } 21 | @unknown x y { p : v } @@ -2373,7 +2373,7 @@ : ^ `---- - x Ident(IdentToken { value: Atom('x' type=static), raw: "x" }) + x Ident { value: Atom('x' type=static), raw: "x" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:21:1] 21 | @unknown x y { p : v } 22 | @unknown x , y x( 1 + 2 ) { p : v } @@ -2429,7 +2429,7 @@ : ^ `---- - x Ident(IdentToken { value: Atom('y' type=inline), raw: "y" }) + x Ident { value: Atom('y' type=inline), raw: "y" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:21:1] 21 | @unknown x y { p : v } 22 | @unknown x , y x( 1 + 2 ) { p : v } @@ -2492,7 +2492,7 @@ : ^ `---- - x Number(NumberToken { value: 1.0, raw: "1", type_flag: Integer }) + x Number { value: 1.0, raw: "1", type_flag: Integer } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:21:1] 21 | @unknown x y { p : v } 22 | @unknown x , y x( 1 + 2 ) { p : v } @@ -2520,7 +2520,7 @@ : ^ `---- - x Delim(DelimToken { value: '+' }) + x Delim { value: '+' } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:21:1] 21 | @unknown x y { p : v } 22 | @unknown x , y x( 1 + 2 ) { p : v } @@ -2548,7 +2548,7 @@ : ^ `---- - x Number(NumberToken { value: 2.0, raw: "2", type_flag: Integer }) + x Number { value: 2.0, raw: "2", type_flag: Integer } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:21:1] 21 | @unknown x y { p : v } 22 | @unknown x , y x( 1 + 2 ) { p : v } @@ -2618,7 +2618,7 @@ : ^ `---- - x Ident(IdentToken { value: Atom('p' type=static), raw: "p" }) + x Ident { value: Atom('p' type=static), raw: "p" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:21:1] 21 | @unknown x y { p : v } 22 | @unknown x , y x( 1 + 2 ) { p : v } @@ -2674,7 +2674,7 @@ : ^ `---- - x Ident(IdentToken { value: Atom('v' type=inline), raw: "v" }) + x Ident { value: Atom('v' type=inline), raw: "v" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:21:1] 21 | @unknown x y { p : v } 22 | @unknown x , y x( 1 + 2 ) { p : v } @@ -2767,7 +2767,7 @@ 25 | @unknown x y {s{p:v}} `---- - x Ident(IdentToken { value: Atom('s' type=static), raw: "s" }) + x Ident { value: Atom('s' type=static), raw: "s" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:23:1] 23 | 24 | @unknown {s{p:v}} @@ -2807,7 +2807,7 @@ 25 | @unknown x y {s{p:v}} `---- - x Ident(IdentToken { value: Atom('p' type=static), raw: "p" }) + x Ident { value: Atom('p' type=static), raw: "p" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:23:1] 23 | 24 | @unknown {s{p:v}} @@ -2839,7 +2839,7 @@ 25 | @unknown x y {s{p:v}} `---- - x Ident(IdentToken { value: Atom('v' type=inline), raw: "v" }) + x Ident { value: Atom('v' type=inline), raw: "v" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:23:1] 23 | 24 | @unknown {s{p:v}} @@ -2903,7 +2903,7 @@ 26 | @unknown x, y f(1) {s{p:v}} `---- - x Ident(IdentToken { value: Atom('x' type=static), raw: "x" }) + x Ident { value: Atom('x' type=static), raw: "x" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:24:1] 24 | @unknown {s{p:v}} 25 | @unknown x y {s{p:v}} @@ -2935,7 +2935,7 @@ 26 | @unknown x, y f(1) {s{p:v}} `---- - x Ident(IdentToken { value: Atom('y' type=inline), raw: "y" }) + x Ident { value: Atom('y' type=inline), raw: "y" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:24:1] 24 | @unknown {s{p:v}} 25 | @unknown x y {s{p:v}} @@ -2983,7 +2983,7 @@ 26 | @unknown x, y f(1) {s{p:v}} `---- - x Ident(IdentToken { value: Atom('s' type=static), raw: "s" }) + x Ident { value: Atom('s' type=static), raw: "s" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:24:1] 24 | @unknown {s{p:v}} 25 | @unknown x y {s{p:v}} @@ -3023,7 +3023,7 @@ 26 | @unknown x, y f(1) {s{p:v}} `---- - x Ident(IdentToken { value: Atom('p' type=static), raw: "p" }) + x Ident { value: Atom('p' type=static), raw: "p" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:24:1] 24 | @unknown {s{p:v}} 25 | @unknown x y {s{p:v}} @@ -3055,7 +3055,7 @@ 26 | @unknown x, y f(1) {s{p:v}} `---- - x Ident(IdentToken { value: Atom('v' type=inline), raw: "v" }) + x Ident { value: Atom('v' type=inline), raw: "v" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:24:1] 24 | @unknown {s{p:v}} 25 | @unknown x y {s{p:v}} @@ -3119,7 +3119,7 @@ 27 | @unknown x, y f(1+2) {s{p:v}} `---- - x Ident(IdentToken { value: Atom('x' type=static), raw: "x" }) + x Ident { value: Atom('x' type=static), raw: "x" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:25:1] 25 | @unknown x y {s{p:v}} 26 | @unknown x, y f(1) {s{p:v}} @@ -3167,7 +3167,7 @@ 27 | @unknown x, y f(1+2) {s{p:v}} `---- - x Ident(IdentToken { value: Atom('y' type=inline), raw: "y" }) + x Ident { value: Atom('y' type=inline), raw: "y" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:25:1] 25 | @unknown x y {s{p:v}} 26 | @unknown x, y f(1) {s{p:v}} @@ -3223,7 +3223,7 @@ 27 | @unknown x, y f(1+2) {s{p:v}} `---- - x Number(NumberToken { value: 1.0, raw: "1", type_flag: Integer }) + x Number { value: 1.0, raw: "1", type_flag: Integer } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:25:1] 25 | @unknown x y {s{p:v}} 26 | @unknown x, y f(1) {s{p:v}} @@ -3271,7 +3271,7 @@ 27 | @unknown x, y f(1+2) {s{p:v}} `---- - x Ident(IdentToken { value: Atom('s' type=static), raw: "s" }) + x Ident { value: Atom('s' type=static), raw: "s" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:25:1] 25 | @unknown x y {s{p:v}} 26 | @unknown x, y f(1) {s{p:v}} @@ -3311,7 +3311,7 @@ 27 | @unknown x, y f(1+2) {s{p:v}} `---- - x Ident(IdentToken { value: Atom('p' type=static), raw: "p" }) + x Ident { value: Atom('p' type=static), raw: "p" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:25:1] 25 | @unknown x y {s{p:v}} 26 | @unknown x, y f(1) {s{p:v}} @@ -3343,7 +3343,7 @@ 27 | @unknown x, y f(1+2) {s{p:v}} `---- - x Ident(IdentToken { value: Atom('v' type=inline), raw: "v" }) + x Ident { value: Atom('v' type=inline), raw: "v" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:25:1] 25 | @unknown x y {s{p:v}} 26 | @unknown x, y f(1) {s{p:v}} @@ -3407,7 +3407,7 @@ 28 | @unknown { .a { p: v; } .b { p: v } } `---- - x Ident(IdentToken { value: Atom('x' type=static), raw: "x" }) + x Ident { value: Atom('x' type=static), raw: "x" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:26:1] 26 | @unknown x, y f(1) {s{p:v}} 27 | @unknown x, y f(1+2) {s{p:v}} @@ -3455,7 +3455,7 @@ 28 | @unknown { .a { p: v; } .b { p: v } } `---- - x Ident(IdentToken { value: Atom('y' type=inline), raw: "y" }) + x Ident { value: Atom('y' type=inline), raw: "y" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:26:1] 26 | @unknown x, y f(1) {s{p:v}} 27 | @unknown x, y f(1+2) {s{p:v}} @@ -3511,7 +3511,7 @@ 28 | @unknown { .a { p: v; } .b { p: v } } `---- - x Number(NumberToken { value: 1.0, raw: "1", type_flag: Integer }) + x Number { value: 1.0, raw: "1", type_flag: Integer } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:26:1] 26 | @unknown x, y f(1) {s{p:v}} 27 | @unknown x, y f(1+2) {s{p:v}} @@ -3527,7 +3527,7 @@ 28 | @unknown { .a { p: v; } .b { p: v } } `---- - x Number(NumberToken { value: 2.0, raw: "+2", type_flag: Integer }) + x Number { value: 2.0, raw: "+2", type_flag: Integer } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:26:1] 26 | @unknown x, y f(1) {s{p:v}} 27 | @unknown x, y f(1+2) {s{p:v}} @@ -3575,7 +3575,7 @@ 28 | @unknown { .a { p: v; } .b { p: v } } `---- - x Ident(IdentToken { value: Atom('s' type=static), raw: "s" }) + x Ident { value: Atom('s' type=static), raw: "s" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:26:1] 26 | @unknown x, y f(1) {s{p:v}} 27 | @unknown x, y f(1+2) {s{p:v}} @@ -3615,7 +3615,7 @@ 28 | @unknown { .a { p: v; } .b { p: v } } `---- - x Ident(IdentToken { value: Atom('p' type=static), raw: "p" }) + x Ident { value: Atom('p' type=static), raw: "p" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:26:1] 26 | @unknown x, y f(1) {s{p:v}} 27 | @unknown x, y f(1+2) {s{p:v}} @@ -3647,7 +3647,7 @@ 28 | @unknown { .a { p: v; } .b { p: v } } `---- - x Ident(IdentToken { value: Atom('v' type=inline), raw: "v" }) + x Ident { value: Atom('v' type=inline), raw: "v" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:26:1] 26 | @unknown x, y f(1) {s{p:v}} 27 | @unknown x, y f(1+2) {s{p:v}} @@ -3743,7 +3743,7 @@ 29 | @unknown/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} `---- - x Delim(DelimToken { value: '.' }) + x Delim { value: '.' } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:27:1] 27 | @unknown x, y f(1+2) {s{p:v}} 28 | @unknown { .a { p: v; } .b { p: v } } @@ -3759,7 +3759,7 @@ 29 | @unknown/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} `---- - x Ident(IdentToken { value: Atom('a' type=static), raw: "a" }) + x Ident { value: Atom('a' type=static), raw: "a" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:27:1] 27 | @unknown x, y f(1+2) {s{p:v}} 28 | @unknown { .a { p: v; } .b { p: v } } @@ -3831,7 +3831,7 @@ 29 | @unknown/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} `---- - x Ident(IdentToken { value: Atom('p' type=static), raw: "p" }) + x Ident { value: Atom('p' type=static), raw: "p" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:27:1] 27 | @unknown x, y f(1+2) {s{p:v}} 28 | @unknown { .a { p: v; } .b { p: v } } @@ -3879,7 +3879,7 @@ 29 | @unknown/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} `---- - x Ident(IdentToken { value: Atom('v' type=inline), raw: "v" }) + x Ident { value: Atom('v' type=inline), raw: "v" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:27:1] 27 | @unknown x, y f(1+2) {s{p:v}} 28 | @unknown { .a { p: v; } .b { p: v } } @@ -3943,7 +3943,7 @@ 29 | @unknown/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} `---- - x Delim(DelimToken { value: '.' }) + x Delim { value: '.' } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:27:1] 27 | @unknown x, y f(1+2) {s{p:v}} 28 | @unknown { .a { p: v; } .b { p: v } } @@ -3959,7 +3959,7 @@ 29 | @unknown/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} `---- - x Ident(IdentToken { value: Atom('b' type=static), raw: "b" }) + x Ident { value: Atom('b' type=static), raw: "b" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:27:1] 27 | @unknown x, y f(1+2) {s{p:v}} 28 | @unknown { .a { p: v; } .b { p: v } } @@ -4031,7 +4031,7 @@ 29 | @unknown/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} `---- - x Ident(IdentToken { value: Atom('p' type=static), raw: "p" }) + x Ident { value: Atom('p' type=static), raw: "p" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:27:1] 27 | @unknown x, y f(1+2) {s{p:v}} 28 | @unknown { .a { p: v; } .b { p: v } } @@ -4079,7 +4079,7 @@ 29 | @unknown/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} `---- - x Ident(IdentToken { value: Atom('v' type=inline), raw: "v" }) + x Ident { value: Atom('v' type=inline), raw: "v" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:27:1] 27 | @unknown x, y f(1+2) {s{p:v}} 28 | @unknown { .a { p: v; } .b { p: v } } @@ -4175,7 +4175,7 @@ 30 | @unknown /*test*/x/*test*/ y/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} `---- - x Ident(IdentToken { value: Atom('s' type=static), raw: "s" }) + x Ident { value: Atom('s' type=static), raw: "s" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:28:1] 28 | @unknown { .a { p: v; } .b { p: v } } 29 | @unknown/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} @@ -4215,7 +4215,7 @@ 30 | @unknown /*test*/x/*test*/ y/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} `---- - x Ident(IdentToken { value: Atom('p' type=static), raw: "p" }) + x Ident { value: Atom('p' type=static), raw: "p" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:28:1] 28 | @unknown { .a { p: v; } .b { p: v } } 29 | @unknown/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} @@ -4247,7 +4247,7 @@ 30 | @unknown /*test*/x/*test*/ y/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} `---- - x Ident(IdentToken { value: Atom('v' type=inline), raw: "v" }) + x Ident { value: Atom('v' type=inline), raw: "v" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:28:1] 28 | @unknown { .a { p: v; } .b { p: v } } 29 | @unknown/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} @@ -4311,7 +4311,7 @@ 31 | /*@unknown !*test*!x!*test*!,!*test*!y!*test*! f(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!s!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}!*test*!}*/ `---- - x Ident(IdentToken { value: Atom('x' type=static), raw: "x" }) + x Ident { value: Atom('x' type=static), raw: "x" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:29:1] 29 | @unknown/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} 30 | @unknown /*test*/x/*test*/ y/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} @@ -4343,7 +4343,7 @@ 31 | /*@unknown !*test*!x!*test*!,!*test*!y!*test*! f(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!s!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}!*test*!}*/ `---- - x Ident(IdentToken { value: Atom('y' type=inline), raw: "y" }) + x Ident { value: Atom('y' type=inline), raw: "y" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:29:1] 29 | @unknown/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} 30 | @unknown /*test*/x/*test*/ y/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} @@ -4375,7 +4375,7 @@ 31 | /*@unknown !*test*!x!*test*!,!*test*!y!*test*! f(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!s!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}!*test*!}*/ `---- - x Ident(IdentToken { value: Atom('s' type=static), raw: "s" }) + x Ident { value: Atom('s' type=static), raw: "s" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:29:1] 29 | @unknown/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} 30 | @unknown /*test*/x/*test*/ y/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} @@ -4415,7 +4415,7 @@ 31 | /*@unknown !*test*!x!*test*!,!*test*!y!*test*! f(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!s!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}!*test*!}*/ `---- - x Ident(IdentToken { value: Atom('p' type=static), raw: "p" }) + x Ident { value: Atom('p' type=static), raw: "p" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:29:1] 29 | @unknown/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} 30 | @unknown /*test*/x/*test*/ y/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} @@ -4447,7 +4447,7 @@ 31 | /*@unknown !*test*!x!*test*!,!*test*!y!*test*! f(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!s!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}!*test*!}*/ `---- - x Ident(IdentToken { value: Atom('v' type=inline), raw: "v" }) + x Ident { value: Atom('v' type=inline), raw: "v" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:29:1] 29 | @unknown/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} 30 | @unknown /*test*/x/*test*/ y/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/} @@ -4543,7 +4543,7 @@ 33 | @unknown x y { s { p : v } } `---- - x Ident(IdentToken { value: Atom('s' type=static), raw: "s" }) + x Ident { value: Atom('s' type=static), raw: "s" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:31:1] 31 | /*@unknown !*test*!x!*test*!,!*test*!y!*test*! f(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!s!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}!*test*!}*/ 32 | @unknown { s { p : v } } @@ -4615,7 +4615,7 @@ 33 | @unknown x y { s { p : v } } `---- - x Ident(IdentToken { value: Atom('p' type=static), raw: "p" }) + x Ident { value: Atom('p' type=static), raw: "p" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:31:1] 31 | /*@unknown !*test*!x!*test*!,!*test*!y!*test*! f(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!s!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}!*test*!}*/ 32 | @unknown { s { p : v } } @@ -4679,7 +4679,7 @@ 33 | @unknown x y { s { p : v } } `---- - x Ident(IdentToken { value: Atom('v' type=inline), raw: "v" }) + x Ident { value: Atom('v' type=inline), raw: "v" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:31:1] 31 | /*@unknown !*test*!x!*test*!,!*test*!y!*test*! f(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!s!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}!*test*!}*/ 32 | @unknown { s { p : v } } @@ -4775,7 +4775,7 @@ 34 | @unknown x , y f( 1 ) { s { p : v } } `---- - x Ident(IdentToken { value: Atom('x' type=static), raw: "x" }) + x Ident { value: Atom('x' type=static), raw: "x" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:32:1] 32 | @unknown { s { p : v } } 33 | @unknown x y { s { p : v } } @@ -4807,7 +4807,7 @@ 34 | @unknown x , y f( 1 ) { s { p : v } } `---- - x Ident(IdentToken { value: Atom('y' type=inline), raw: "y" }) + x Ident { value: Atom('y' type=inline), raw: "y" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:32:1] 32 | @unknown { s { p : v } } 33 | @unknown x y { s { p : v } } @@ -4871,7 +4871,7 @@ 34 | @unknown x , y f( 1 ) { s { p : v } } `---- - x Ident(IdentToken { value: Atom('s' type=static), raw: "s" }) + x Ident { value: Atom('s' type=static), raw: "s" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:32:1] 32 | @unknown { s { p : v } } 33 | @unknown x y { s { p : v } } @@ -4943,7 +4943,7 @@ 34 | @unknown x , y f( 1 ) { s { p : v } } `---- - x Ident(IdentToken { value: Atom('p' type=static), raw: "p" }) + x Ident { value: Atom('p' type=static), raw: "p" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:32:1] 32 | @unknown { s { p : v } } 33 | @unknown x y { s { p : v } } @@ -5007,7 +5007,7 @@ 34 | @unknown x , y f( 1 ) { s { p : v } } `---- - x Ident(IdentToken { value: Atom('v' type=inline), raw: "v" }) + x Ident { value: Atom('v' type=inline), raw: "v" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:32:1] 32 | @unknown { s { p : v } } 33 | @unknown x y { s { p : v } } @@ -5103,7 +5103,7 @@ 35 | @unknown x , y f( 1 2 ) { s { p : v } } `---- - x Ident(IdentToken { value: Atom('x' type=static), raw: "x" }) + x Ident { value: Atom('x' type=static), raw: "x" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:33:1] 33 | @unknown x y { s { p : v } } 34 | @unknown x , y f( 1 ) { s { p : v } } @@ -5167,7 +5167,7 @@ 35 | @unknown x , y f( 1 2 ) { s { p : v } } `---- - x Ident(IdentToken { value: Atom('y' type=inline), raw: "y" }) + x Ident { value: Atom('y' type=inline), raw: "y" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:33:1] 33 | @unknown x y { s { p : v } } 34 | @unknown x , y f( 1 ) { s { p : v } } @@ -5239,7 +5239,7 @@ 35 | @unknown x , y f( 1 2 ) { s { p : v } } `---- - x Number(NumberToken { value: 1.0, raw: "1", type_flag: Integer }) + x Number { value: 1.0, raw: "1", type_flag: Integer } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:33:1] 33 | @unknown x y { s { p : v } } 34 | @unknown x , y f( 1 ) { s { p : v } } @@ -5319,7 +5319,7 @@ 35 | @unknown x , y f( 1 2 ) { s { p : v } } `---- - x Ident(IdentToken { value: Atom('s' type=static), raw: "s" }) + x Ident { value: Atom('s' type=static), raw: "s" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:33:1] 33 | @unknown x y { s { p : v } } 34 | @unknown x , y f( 1 ) { s { p : v } } @@ -5391,7 +5391,7 @@ 35 | @unknown x , y f( 1 2 ) { s { p : v } } `---- - x Ident(IdentToken { value: Atom('p' type=static), raw: "p" }) + x Ident { value: Atom('p' type=static), raw: "p" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:33:1] 33 | @unknown x y { s { p : v } } 34 | @unknown x , y f( 1 ) { s { p : v } } @@ -5455,7 +5455,7 @@ 35 | @unknown x , y f( 1 2 ) { s { p : v } } `---- - x Ident(IdentToken { value: Atom('v' type=inline), raw: "v" }) + x Ident { value: Atom('v' type=inline), raw: "v" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:33:1] 33 | @unknown x y { s { p : v } } 34 | @unknown x , y f( 1 ) { s { p : v } } @@ -5544,7 +5544,7 @@ : ^ `---- - x Ident(IdentToken { value: Atom('x' type=static), raw: "x" }) + x Ident { value: Atom('x' type=static), raw: "x" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:34:1] 34 | @unknown x , y f( 1 ) { s { p : v } } 35 | @unknown x , y f( 1 2 ) { s { p : v } } @@ -5600,7 +5600,7 @@ : ^ `---- - x Ident(IdentToken { value: Atom('y' type=inline), raw: "y" }) + x Ident { value: Atom('y' type=inline), raw: "y" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:34:1] 34 | @unknown x , y f( 1 ) { s { p : v } } 35 | @unknown x , y f( 1 2 ) { s { p : v } } @@ -5663,7 +5663,7 @@ : ^ `---- - x Number(NumberToken { value: 1.0, raw: "1", type_flag: Integer }) + x Number { value: 1.0, raw: "1", type_flag: Integer } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:34:1] 34 | @unknown x , y f( 1 ) { s { p : v } } 35 | @unknown x , y f( 1 2 ) { s { p : v } } @@ -5691,7 +5691,7 @@ : ^ `---- - x Number(NumberToken { value: 2.0, raw: "2", type_flag: Integer }) + x Number { value: 2.0, raw: "2", type_flag: Integer } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:34:1] 34 | @unknown x , y f( 1 ) { s { p : v } } 35 | @unknown x , y f( 1 2 ) { s { p : v } } @@ -5761,7 +5761,7 @@ : ^ `---- - x Ident(IdentToken { value: Atom('s' type=static), raw: "s" }) + x Ident { value: Atom('s' type=static), raw: "s" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:34:1] 34 | @unknown x , y f( 1 ) { s { p : v } } 35 | @unknown x , y f( 1 2 ) { s { p : v } } @@ -5824,7 +5824,7 @@ : ^ `---- - x Ident(IdentToken { value: Atom('p' type=static), raw: "p" }) + x Ident { value: Atom('p' type=static), raw: "p" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:34:1] 34 | @unknown x , y f( 1 ) { s { p : v } } 35 | @unknown x , y f( 1 2 ) { s { p : v } } @@ -5880,7 +5880,7 @@ : ^ `---- - x Ident(IdentToken { value: Atom('v' type=inline), raw: "v" }) + x Ident { value: Atom('v' type=inline), raw: "v" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:34:1] 34 | @unknown x , y f( 1 ) { s { p : v } } 35 | @unknown x , y f( 1 2 ) { s { p : v } } @@ -6230,7 +6230,7 @@ 44 | } `---- - x AtKeyword(AtKeywordToken { value: Atom('unknown' type=static), raw: "unknown" }) + x AtKeyword { value: Atom('unknown' type=static), raw: "unknown" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:42:1] 42 | @unknown { 43 | @unknown {s{p:v}} @@ -6286,7 +6286,7 @@ 44 | } `---- - x Ident(IdentToken { value: Atom('s' type=static), raw: "s" }) + x Ident { value: Atom('s' type=static), raw: "s" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:42:1] 42 | @unknown { 43 | @unknown {s{p:v}} @@ -6326,7 +6326,7 @@ 44 | } `---- - x Ident(IdentToken { value: Atom('p' type=static), raw: "p" }) + x Ident { value: Atom('p' type=static), raw: "p" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:42:1] 42 | @unknown { 43 | @unknown {s{p:v}} @@ -6358,7 +6358,7 @@ 44 | } `---- - x Ident(IdentToken { value: Atom('v' type=inline), raw: "v" }) + x Ident { value: Atom('v' type=inline), raw: "v" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:42:1] 42 | @unknown { 43 | @unknown {s{p:v}} @@ -6476,7 +6476,7 @@ 48 | `---- - x AtKeyword(AtKeywordToken { value: Atom('unknown' type=static), raw: "unknown" }) + x AtKeyword { value: Atom('unknown' type=static), raw: "unknown" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:46:1] 46 | @unknown { 47 | @unknown {s{p:v}} @@ -6532,7 +6532,7 @@ 48 | `---- - x Ident(IdentToken { value: Atom('s' type=static), raw: "s" }) + x Ident { value: Atom('s' type=static), raw: "s" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:46:1] 46 | @unknown { 47 | @unknown {s{p:v}} @@ -6572,7 +6572,7 @@ 48 | `---- - x Ident(IdentToken { value: Atom('p' type=static), raw: "p" }) + x Ident { value: Atom('p' type=static), raw: "p" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:46:1] 46 | @unknown { 47 | @unknown {s{p:v}} @@ -6604,7 +6604,7 @@ 48 | `---- - x Ident(IdentToken { value: Atom('v' type=inline), raw: "v" }) + x Ident { value: Atom('v' type=inline), raw: "v" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:46:1] 46 | @unknown { 47 | @unknown {s{p:v}} @@ -6638,7 +6638,7 @@ 50 | } `---- - x Ident(IdentToken { value: Atom('color' type=static), raw: "color" }) + x Ident { value: Atom('color' type=static), raw: "color" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:48:1] 48 | 49 | color: red; @@ -6686,7 +6686,7 @@ 50 | } `---- - x Ident(IdentToken { value: Atom('red' type=inline), raw: "red" }) + x Ident { value: Atom('red' type=inline), raw: "red" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:48:1] 48 | 49 | color: red; @@ -6938,7 +6938,7 @@ : ^ `---- - x Ident(IdentToken { value: Atom('s' type=static), raw: "s" }) + x Ident { value: Atom('s' type=static), raw: "s" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:52:1] 52 | .foo { 53 | @unknown {s{p:v}} @@ -6973,7 +6973,7 @@ : ^ `---- - x Ident(IdentToken { value: Atom('p' type=static), raw: "p" }) + x Ident { value: Atom('p' type=static), raw: "p" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:52:1] 52 | .foo { 53 | @unknown {s{p:v}} @@ -7001,7 +7001,7 @@ : ^ `---- - x Ident(IdentToken { value: Atom('v' type=inline), raw: "v" }) + x Ident { value: Atom('v' type=inline), raw: "v" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:52:1] 52 | .foo { 53 | @unknown {s{p:v}} @@ -7064,7 +7064,7 @@ 59 | @unknown x ( a , b ) { foo: bar } `---- - x Ident(IdentToken { value: Atom('x' type=static), raw: "x" }) + x Ident { value: Atom('x' type=static), raw: "x" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:57:1] 57 | 58 | @unknown x ( a , b ) ; @@ -7136,7 +7136,7 @@ 59 | @unknown x ( a , b ) { foo: bar } `---- - x Ident(IdentToken { value: Atom('a' type=static), raw: "a" }) + x Ident { value: Atom('a' type=static), raw: "a" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:57:1] 57 | 58 | @unknown x ( a , b ) ; @@ -7200,7 +7200,7 @@ 59 | @unknown x ( a , b ) { foo: bar } `---- - x Ident(IdentToken { value: Atom('b' type=static), raw: "b" }) + x Ident { value: Atom('b' type=static), raw: "b" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:57:1] 57 | 58 | @unknown x ( a , b ) ; @@ -7296,7 +7296,7 @@ 60 | @unknown x( a, b ) { foo: bar } `---- - x Ident(IdentToken { value: Atom('x' type=static), raw: "x" }) + x Ident { value: Atom('x' type=static), raw: "x" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:58:1] 58 | @unknown x ( a , b ) ; 59 | @unknown x ( a , b ) { foo: bar } @@ -7368,7 +7368,7 @@ 60 | @unknown x( a, b ) { foo: bar } `---- - x Ident(IdentToken { value: Atom('a' type=static), raw: "a" }) + x Ident { value: Atom('a' type=static), raw: "a" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:58:1] 58 | @unknown x ( a , b ) ; 59 | @unknown x ( a , b ) { foo: bar } @@ -7432,7 +7432,7 @@ 60 | @unknown x( a, b ) { foo: bar } `---- - x Ident(IdentToken { value: Atom('b' type=static), raw: "b" }) + x Ident { value: Atom('b' type=static), raw: "b" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:58:1] 58 | @unknown x ( a , b ) ; 59 | @unknown x ( a , b ) { foo: bar } @@ -7512,7 +7512,7 @@ 60 | @unknown x( a, b ) { foo: bar } `---- - x Ident(IdentToken { value: Atom('foo' type=inline), raw: "foo" }) + x Ident { value: Atom('foo' type=inline), raw: "foo" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:58:1] 58 | @unknown x ( a , b ) ; 59 | @unknown x ( a , b ) { foo: bar } @@ -7560,7 +7560,7 @@ 60 | @unknown x( a, b ) { foo: bar } `---- - x Ident(IdentToken { value: Atom('bar' type=inline), raw: "bar" }) + x Ident { value: Atom('bar' type=inline), raw: "bar" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:58:1] 58 | @unknown x ( a , b ) ; 59 | @unknown x ( a , b ) { foo: bar } @@ -7680,7 +7680,7 @@ 61 | @unknown x ( a + b ) ; `---- - x Ident(IdentToken { value: Atom('a' type=static), raw: "a" }) + x Ident { value: Atom('a' type=static), raw: "a" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:59:1] 59 | @unknown x ( a , b ) { foo: bar } 60 | @unknown x( a, b ) { foo: bar } @@ -7728,7 +7728,7 @@ 61 | @unknown x ( a + b ) ; `---- - x Ident(IdentToken { value: Atom('b' type=static), raw: "b" }) + x Ident { value: Atom('b' type=static), raw: "b" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:59:1] 59 | @unknown x ( a , b ) { foo: bar } 60 | @unknown x( a, b ) { foo: bar } @@ -7808,7 +7808,7 @@ 61 | @unknown x ( a + b ) ; `---- - x Ident(IdentToken { value: Atom('foo' type=inline), raw: "foo" }) + x Ident { value: Atom('foo' type=inline), raw: "foo" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:59:1] 59 | @unknown x ( a , b ) { foo: bar } 60 | @unknown x( a, b ) { foo: bar } @@ -7856,7 +7856,7 @@ 61 | @unknown x ( a + b ) ; `---- - x Ident(IdentToken { value: Atom('bar' type=inline), raw: "bar" }) + x Ident { value: Atom('bar' type=inline), raw: "bar" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:59:1] 59 | @unknown x ( a , b ) { foo: bar } 60 | @unknown x( a, b ) { foo: bar } @@ -7936,7 +7936,7 @@ 62 | @unknown x ( a - b ) ; `---- - x Ident(IdentToken { value: Atom('x' type=static), raw: "x" }) + x Ident { value: Atom('x' type=static), raw: "x" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:60:1] 60 | @unknown x( a, b ) { foo: bar } 61 | @unknown x ( a + b ) ; @@ -8008,7 +8008,7 @@ 62 | @unknown x ( a - b ) ; `---- - x Ident(IdentToken { value: Atom('a' type=static), raw: "a" }) + x Ident { value: Atom('a' type=static), raw: "a" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:60:1] 60 | @unknown x( a, b ) { foo: bar } 61 | @unknown x ( a + b ) ; @@ -8040,7 +8040,7 @@ 62 | @unknown x ( a - b ) ; `---- - x Delim(DelimToken { value: '+' }) + x Delim { value: '+' } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:60:1] 60 | @unknown x( a, b ) { foo: bar } 61 | @unknown x ( a + b ) ; @@ -8072,7 +8072,7 @@ 62 | @unknown x ( a - b ) ; `---- - x Ident(IdentToken { value: Atom('b' type=static), raw: "b" }) + x Ident { value: Atom('b' type=static), raw: "b" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:60:1] 60 | @unknown x( a, b ) { foo: bar } 61 | @unknown x ( a + b ) ; @@ -8168,7 +8168,7 @@ 63 | @unknown x ( a * b ) ; `---- - x Ident(IdentToken { value: Atom('x' type=static), raw: "x" }) + x Ident { value: Atom('x' type=static), raw: "x" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:61:1] 61 | @unknown x ( a + b ) ; 62 | @unknown x ( a - b ) ; @@ -8240,7 +8240,7 @@ 63 | @unknown x ( a * b ) ; `---- - x Ident(IdentToken { value: Atom('a' type=static), raw: "a" }) + x Ident { value: Atom('a' type=static), raw: "a" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:61:1] 61 | @unknown x ( a + b ) ; 62 | @unknown x ( a - b ) ; @@ -8272,7 +8272,7 @@ 63 | @unknown x ( a * b ) ; `---- - x Delim(DelimToken { value: '-' }) + x Delim { value: '-' } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:61:1] 61 | @unknown x ( a + b ) ; 62 | @unknown x ( a - b ) ; @@ -8304,7 +8304,7 @@ 63 | @unknown x ( a * b ) ; `---- - x Ident(IdentToken { value: Atom('b' type=static), raw: "b" }) + x Ident { value: Atom('b' type=static), raw: "b" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:61:1] 61 | @unknown x ( a + b ) ; 62 | @unknown x ( a - b ) ; @@ -8400,7 +8400,7 @@ 64 | @unknown x ( a / b ) ; `---- - x Ident(IdentToken { value: Atom('x' type=static), raw: "x" }) + x Ident { value: Atom('x' type=static), raw: "x" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:62:1] 62 | @unknown x ( a - b ) ; 63 | @unknown x ( a * b ) ; @@ -8472,7 +8472,7 @@ 64 | @unknown x ( a / b ) ; `---- - x Ident(IdentToken { value: Atom('a' type=static), raw: "a" }) + x Ident { value: Atom('a' type=static), raw: "a" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:62:1] 62 | @unknown x ( a - b ) ; 63 | @unknown x ( a * b ) ; @@ -8504,7 +8504,7 @@ 64 | @unknown x ( a / b ) ; `---- - x Delim(DelimToken { value: '*' }) + x Delim { value: '*' } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:62:1] 62 | @unknown x ( a - b ) ; 63 | @unknown x ( a * b ) ; @@ -8536,7 +8536,7 @@ 64 | @unknown x ( a / b ) ; `---- - x Ident(IdentToken { value: Atom('b' type=static), raw: "b" }) + x Ident { value: Atom('b' type=static), raw: "b" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:62:1] 62 | @unknown x ( a - b ) ; 63 | @unknown x ( a * b ) ; @@ -8632,7 +8632,7 @@ 65 | @unknown{} `---- - x Ident(IdentToken { value: Atom('x' type=static), raw: "x" }) + x Ident { value: Atom('x' type=static), raw: "x" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:63:1] 63 | @unknown x ( a * b ) ; 64 | @unknown x ( a / b ) ; @@ -8704,7 +8704,7 @@ 65 | @unknown{} `---- - x Ident(IdentToken { value: Atom('a' type=static), raw: "a" }) + x Ident { value: Atom('a' type=static), raw: "a" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:63:1] 63 | @unknown x ( a * b ) ; 64 | @unknown x ( a / b ) ; @@ -8736,7 +8736,7 @@ 65 | @unknown{} `---- - x Delim(DelimToken { value: '/' }) + x Delim { value: '/' } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:63:1] 63 | @unknown x ( a * b ) ; 64 | @unknown x ( a / b ) ; @@ -8768,7 +8768,7 @@ 65 | @unknown{} `---- - x Ident(IdentToken { value: Atom('b' type=static), raw: "b" }) + x Ident { value: Atom('b' type=static), raw: "b" } ,-[$DIR/tests/fixture/at-rule/unknown/input.css:63:1] 63 | @unknown x ( a * b ) ; 64 | @unknown x ( a / b ) ; diff --git a/crates/swc_css_parser/tests/fixture/dashed-ident/span.swc-stderr b/crates/swc_css_parser/tests/fixture/dashed-ident/span.swc-stderr index fb57081644a4..ab8b01c746c6 100644 --- a/crates/swc_css_parser/tests/fixture/dashed-ident/span.swc-stderr +++ b/crates/swc_css_parser/tests/fixture/dashed-ident/span.swc-stderr @@ -139,7 +139,7 @@ 3 | --accent-color: #006; `---- - x Hash(HashToken { is_id: false, value: Atom('06c' type=inline), raw: "06c" }) + x Hash { is_id: false, value: Atom('06c' type=inline), raw: "06c" } ,-[$DIR/tests/fixture/dashed-ident/input.css:1:1] 1 | :root { 2 | --main-color: #06c; @@ -195,7 +195,7 @@ 4 | } `---- - x Hash(HashToken { is_id: false, value: Atom('006' type=inline), raw: "006" }) + x Hash { is_id: false, value: Atom('006' type=inline), raw: "006" } ,-[$DIR/tests/fixture/dashed-ident/input.css:2:1] 2 | --main-color: #06c; 3 | --accent-color: #006; @@ -331,7 +331,7 @@ 8 | } `---- - x Ident(IdentToken { value: Atom('blue' type=inline), raw: "blue" }) + x Ident { value: Atom('blue' type=inline), raw: "blue" } ,-[$DIR/tests/fixture/dashed-ident/input.css:6:1] 6 | .foo { 7 | --fg-color: blue; diff --git a/crates/swc_css_parser/tests/fixture/function/calc/span.swc-stderr b/crates/swc_css_parser/tests/fixture/function/calc/span.swc-stderr index f01a7b5a1f72..3dddf0b67c04 100644 --- a/crates/swc_css_parser/tests/fixture/function/calc/span.swc-stderr +++ b/crates/swc_css_parser/tests/fixture/function/calc/span.swc-stderr @@ -629,7 +629,7 @@ : ^^^ `---- - x Percentage(PercentageToken { value: 10.0, raw: "10" }) + x Percentage { value: 10.0, raw: "10" } ,-[$DIR/tests/fixture/function/calc/input.css:5:1] 5 | div { 6 | --width: calc(10% + 30px); @@ -657,7 +657,7 @@ : ^ `---- - x Delim(DelimToken { value: '+' }) + x Delim { value: '+' } ,-[$DIR/tests/fixture/function/calc/input.css:5:1] 5 | div { 6 | --width: calc(10% + 30px); diff --git a/crates/swc_css_parser/tests/fixture/selector/pseudo-class/has/span.swc-stderr b/crates/swc_css_parser/tests/fixture/selector/pseudo-class/has/span.swc-stderr index d0519d640771..90d5095e6da5 100644 --- a/crates/swc_css_parser/tests/fixture/selector/pseudo-class/has/span.swc-stderr +++ b/crates/swc_css_parser/tests/fixture/selector/pseudo-class/has/span.swc-stderr @@ -2782,7 +2782,7 @@ 14 | a:has( <> img, > img) {} `---- - x Delim(DelimToken { value: '<' }) + x Delim { value: '<' } ,-[$DIR/tests/fixture/selector/pseudo-class/has/input.css:12:1] 12 | /* Forgiving */ 13 | a:has(<> img, > img) {} @@ -2798,7 +2798,7 @@ 14 | a:has( <> img, > img) {} `---- - x Delim(DelimToken { value: '>' }) + x Delim { value: '>' } ,-[$DIR/tests/fixture/selector/pseudo-class/has/input.css:12:1] 12 | /* Forgiving */ 13 | a:has(<> img, > img) {} @@ -2830,7 +2830,7 @@ 14 | a:has( <> img, > img) {} `---- - x Ident(IdentToken { value: Atom('img' type=static), raw: "img" }) + x Ident { value: Atom('img' type=static), raw: "img" } ,-[$DIR/tests/fixture/selector/pseudo-class/has/input.css:12:1] 12 | /* Forgiving */ 13 | a:has(<> img, > img) {} @@ -3054,7 +3054,7 @@ 15 | a:has(> img, <> img) {} `---- - x Delim(DelimToken { value: '<' }) + x Delim { value: '<' } ,-[$DIR/tests/fixture/selector/pseudo-class/has/input.css:13:1] 13 | a:has(<> img, > img) {} 14 | a:has( <> img, > img) {} @@ -3070,7 +3070,7 @@ 15 | a:has(> img, <> img) {} `---- - x Delim(DelimToken { value: '>' }) + x Delim { value: '>' } ,-[$DIR/tests/fixture/selector/pseudo-class/has/input.css:13:1] 13 | a:has(<> img, > img) {} 14 | a:has( <> img, > img) {} @@ -3102,7 +3102,7 @@ 15 | a:has(> img, <> img) {} `---- - x Ident(IdentToken { value: Atom('img' type=static), raw: "img" }) + x Ident { value: Atom('img' type=static), raw: "img" } ,-[$DIR/tests/fixture/selector/pseudo-class/has/input.css:13:1] 13 | a:has(<> img, > img) {} 14 | a:has( <> img, > img) {} @@ -3390,7 +3390,7 @@ 16 | a:has(> img, <> img ) {} `---- - x Delim(DelimToken { value: '<' }) + x Delim { value: '<' } ,-[$DIR/tests/fixture/selector/pseudo-class/has/input.css:14:1] 14 | a:has( <> img, > img) {} 15 | a:has(> img, <> img) {} @@ -3406,7 +3406,7 @@ 16 | a:has(> img, <> img ) {} `---- - x Delim(DelimToken { value: '>' }) + x Delim { value: '>' } ,-[$DIR/tests/fixture/selector/pseudo-class/has/input.css:14:1] 14 | a:has( <> img, > img) {} 15 | a:has(> img, <> img) {} @@ -3438,7 +3438,7 @@ 16 | a:has(> img, <> img ) {} `---- - x Ident(IdentToken { value: Atom('img' type=static), raw: "img" }) + x Ident { value: Atom('img' type=static), raw: "img" } ,-[$DIR/tests/fixture/selector/pseudo-class/has/input.css:14:1] 14 | a:has( <> img, > img) {} 15 | a:has(> img, <> img) {} @@ -3637,7 +3637,7 @@ : ^ `---- - x Delim(DelimToken { value: '<' }) + x Delim { value: '<' } ,-[$DIR/tests/fixture/selector/pseudo-class/has/input.css:15:1] 15 | a:has(> img, <> img) {} 16 | a:has(> img, <> img ) {} @@ -3651,7 +3651,7 @@ : ^ `---- - x Delim(DelimToken { value: '>' }) + x Delim { value: '>' } ,-[$DIR/tests/fixture/selector/pseudo-class/has/input.css:15:1] 15 | a:has(> img, <> img) {} 16 | a:has(> img, <> img ) {} @@ -3679,7 +3679,7 @@ : ^^^ `---- - x Ident(IdentToken { value: Atom('img' type=static), raw: "img" }) + x Ident { value: Atom('img' type=static), raw: "img" } ,-[$DIR/tests/fixture/selector/pseudo-class/has/input.css:15:1] 15 | a:has(> img, <> img) {} 16 | a:has(> img, <> img ) {} @@ -3889,7 +3889,7 @@ : ^ `---- - x Delim(DelimToken { value: '<' }) + x Delim { value: '<' } ,-[$DIR/tests/fixture/selector/pseudo-class/has/input.css:17:1] 17 | 18 | a:has(> img, <> img , > img) {} @@ -3903,7 +3903,7 @@ : ^ `---- - x Delim(DelimToken { value: '>' }) + x Delim { value: '>' } ,-[$DIR/tests/fixture/selector/pseudo-class/has/input.css:17:1] 17 | 18 | a:has(> img, <> img , > img) {} @@ -3931,7 +3931,7 @@ : ^^^ `---- - x Ident(IdentToken { value: Atom('img' type=static), raw: "img" }) + x Ident { value: Atom('img' type=static), raw: "img" } ,-[$DIR/tests/fixture/selector/pseudo-class/has/input.css:17:1] 17 | 18 | a:has(> img, <> img , > img) {} diff --git a/crates/swc_css_parser/tests/fixture/selector/pseudo-class/is/span.swc-stderr b/crates/swc_css_parser/tests/fixture/selector/pseudo-class/is/span.swc-stderr index 9ee335abcccd..aa01d8fc41aa 100644 --- a/crates/swc_css_parser/tests/fixture/selector/pseudo-class/is/span.swc-stderr +++ b/crates/swc_css_parser/tests/fixture/selector/pseudo-class/is/span.swc-stderr @@ -5307,7 +5307,7 @@ 26 | :is( a >< b, a > b, d > c) {} `---- - x Ident(IdentToken { value: Atom('a' type=static), raw: "a" }) + x Ident { value: Atom('a' type=static), raw: "a" } ,-[$DIR/tests/fixture/selector/pseudo-class/is/input.css:24:1] 24 | /* Forgiving */ 25 | :is(a >< b, a > b, d > c) {} @@ -5339,7 +5339,7 @@ 26 | :is( a >< b, a > b, d > c) {} `---- - x Delim(DelimToken { value: '>' }) + x Delim { value: '>' } ,-[$DIR/tests/fixture/selector/pseudo-class/is/input.css:24:1] 24 | /* Forgiving */ 25 | :is(a >< b, a > b, d > c) {} @@ -5355,7 +5355,7 @@ 26 | :is( a >< b, a > b, d > c) {} `---- - x Delim(DelimToken { value: '<' }) + x Delim { value: '<' } ,-[$DIR/tests/fixture/selector/pseudo-class/is/input.css:24:1] 24 | /* Forgiving */ 25 | :is(a >< b, a > b, d > c) {} @@ -5387,7 +5387,7 @@ 26 | :is( a >< b, a > b, d > c) {} `---- - x Ident(IdentToken { value: Atom('b' type=static), raw: "b" }) + x Ident { value: Atom('b' type=static), raw: "b" } ,-[$DIR/tests/fixture/selector/pseudo-class/is/input.css:24:1] 24 | /* Forgiving */ 25 | :is(a >< b, a > b, d > c) {} @@ -5707,7 +5707,7 @@ 27 | :is(a > b, d > c, a >< b) {} `---- - x Ident(IdentToken { value: Atom('a' type=static), raw: "a" }) + x Ident { value: Atom('a' type=static), raw: "a" } ,-[$DIR/tests/fixture/selector/pseudo-class/is/input.css:25:1] 25 | :is(a >< b, a > b, d > c) {} 26 | :is( a >< b, a > b, d > c) {} @@ -5739,7 +5739,7 @@ 27 | :is(a > b, d > c, a >< b) {} `---- - x Delim(DelimToken { value: '>' }) + x Delim { value: '>' } ,-[$DIR/tests/fixture/selector/pseudo-class/is/input.css:25:1] 25 | :is(a >< b, a > b, d > c) {} 26 | :is( a >< b, a > b, d > c) {} @@ -5755,7 +5755,7 @@ 27 | :is(a > b, d > c, a >< b) {} `---- - x Delim(DelimToken { value: '<' }) + x Delim { value: '<' } ,-[$DIR/tests/fixture/selector/pseudo-class/is/input.css:25:1] 25 | :is(a >< b, a > b, d > c) {} 26 | :is( a >< b, a > b, d > c) {} @@ -5787,7 +5787,7 @@ 27 | :is(a > b, d > c, a >< b) {} `---- - x Ident(IdentToken { value: Atom('b' type=static), raw: "b" }) + x Ident { value: Atom('b' type=static), raw: "b" } ,-[$DIR/tests/fixture/selector/pseudo-class/is/input.css:25:1] 25 | :is(a >< b, a > b, d > c) {} 26 | :is( a >< b, a > b, d > c) {} @@ -6299,7 +6299,7 @@ 28 | :is(a > b, d > c, a >< b ) {} `---- - x Ident(IdentToken { value: Atom('a' type=static), raw: "a" }) + x Ident { value: Atom('a' type=static), raw: "a" } ,-[$DIR/tests/fixture/selector/pseudo-class/is/input.css:26:1] 26 | :is( a >< b, a > b, d > c) {} 27 | :is(a > b, d > c, a >< b) {} @@ -6331,7 +6331,7 @@ 28 | :is(a > b, d > c, a >< b ) {} `---- - x Delim(DelimToken { value: '>' }) + x Delim { value: '>' } ,-[$DIR/tests/fixture/selector/pseudo-class/is/input.css:26:1] 26 | :is( a >< b, a > b, d > c) {} 27 | :is(a > b, d > c, a >< b) {} @@ -6347,7 +6347,7 @@ 28 | :is(a > b, d > c, a >< b ) {} `---- - x Delim(DelimToken { value: '<' }) + x Delim { value: '<' } ,-[$DIR/tests/fixture/selector/pseudo-class/is/input.css:26:1] 26 | :is( a >< b, a > b, d > c) {} 27 | :is(a > b, d > c, a >< b) {} @@ -6379,7 +6379,7 @@ 28 | :is(a > b, d > c, a >< b ) {} `---- - x Ident(IdentToken { value: Atom('b' type=static), raw: "b" }) + x Ident { value: Atom('b' type=static), raw: "b" } ,-[$DIR/tests/fixture/selector/pseudo-class/is/input.css:26:1] 26 | :is( a >< b, a > b, d > c) {} 27 | :is(a > b, d > c, a >< b) {} @@ -6699,7 +6699,7 @@ 29 | :is(a > b, a >< b , d > c) {} `---- - x Ident(IdentToken { value: Atom('a' type=static), raw: "a" }) + x Ident { value: Atom('a' type=static), raw: "a" } ,-[$DIR/tests/fixture/selector/pseudo-class/is/input.css:27:1] 27 | :is(a > b, d > c, a >< b) {} 28 | :is(a > b, d > c, a >< b ) {} @@ -6731,7 +6731,7 @@ 29 | :is(a > b, a >< b , d > c) {} `---- - x Delim(DelimToken { value: '>' }) + x Delim { value: '>' } ,-[$DIR/tests/fixture/selector/pseudo-class/is/input.css:27:1] 27 | :is(a > b, d > c, a >< b) {} 28 | :is(a > b, d > c, a >< b ) {} @@ -6747,7 +6747,7 @@ 29 | :is(a > b, a >< b , d > c) {} `---- - x Delim(DelimToken { value: '<' }) + x Delim { value: '<' } ,-[$DIR/tests/fixture/selector/pseudo-class/is/input.css:27:1] 27 | :is(a > b, d > c, a >< b) {} 28 | :is(a > b, d > c, a >< b ) {} @@ -6779,7 +6779,7 @@ 29 | :is(a > b, a >< b , d > c) {} `---- - x Ident(IdentToken { value: Atom('b' type=static), raw: "b" }) + x Ident { value: Atom('b' type=static), raw: "b" } ,-[$DIR/tests/fixture/selector/pseudo-class/is/input.css:27:1] 27 | :is(a > b, d > c, a >< b) {} 28 | :is(a > b, d > c, a >< b ) {} @@ -6994,7 +6994,7 @@ : ^ `---- - x Ident(IdentToken { value: Atom('a' type=static), raw: "a" }) + x Ident { value: Atom('a' type=static), raw: "a" } ,-[$DIR/tests/fixture/selector/pseudo-class/is/input.css:28:1] 28 | :is(a > b, d > c, a >< b ) {} 29 | :is(a > b, a >< b , d > c) {} @@ -7022,7 +7022,7 @@ : ^ `---- - x Delim(DelimToken { value: '>' }) + x Delim { value: '>' } ,-[$DIR/tests/fixture/selector/pseudo-class/is/input.css:28:1] 28 | :is(a > b, d > c, a >< b ) {} 29 | :is(a > b, a >< b , d > c) {} @@ -7036,7 +7036,7 @@ : ^ `---- - x Delim(DelimToken { value: '<' }) + x Delim { value: '<' } ,-[$DIR/tests/fixture/selector/pseudo-class/is/input.css:28:1] 28 | :is(a > b, d > c, a >< b ) {} 29 | :is(a > b, a >< b , d > c) {} @@ -7064,7 +7064,7 @@ : ^ `---- - x Ident(IdentToken { value: Atom('b' type=static), raw: "b" }) + x Ident { value: Atom('b' type=static), raw: "b" } ,-[$DIR/tests/fixture/selector/pseudo-class/is/input.css:28:1] 28 | :is(a > b, d > c, a >< b ) {} 29 | :is(a > b, a >< b , d > c) {} diff --git a/crates/swc_css_parser/tests/fixture/selector/pseudo-class/unknown/span.swc-stderr b/crates/swc_css_parser/tests/fixture/selector/pseudo-class/unknown/span.swc-stderr index 8a19d77f37e2..5715583945f7 100644 --- a/crates/swc_css_parser/tests/fixture/selector/pseudo-class/unknown/span.swc-stderr +++ b/crates/swc_css_parser/tests/fixture/selector/pseudo-class/unknown/span.swc-stderr @@ -245,7 +245,7 @@ 4 | :unknown(foo bar) {} `---- - x Ident(IdentToken { value: Atom('foo' type=inline), raw: "foo" }) + x Ident { value: Atom('foo' type=inline), raw: "foo" } ,-[$DIR/tests/fixture/selector/pseudo-class/unknown/input.css:2:1] 2 | :unknown() {} 3 | :unknown(foo) {} @@ -341,7 +341,7 @@ 5 | :unknown(foo, bar) {} `---- - x Ident(IdentToken { value: Atom('foo' type=inline), raw: "foo" }) + x Ident { value: Atom('foo' type=inline), raw: "foo" } ,-[$DIR/tests/fixture/selector/pseudo-class/unknown/input.css:3:1] 3 | :unknown(foo) {} 4 | :unknown(foo bar) {} @@ -373,7 +373,7 @@ 5 | :unknown(foo, bar) {} `---- - x Ident(IdentToken { value: Atom('bar' type=inline), raw: "bar" }) + x Ident { value: Atom('bar' type=inline), raw: "bar" } ,-[$DIR/tests/fixture/selector/pseudo-class/unknown/input.css:3:1] 3 | :unknown(foo) {} 4 | :unknown(foo bar) {} @@ -469,7 +469,7 @@ 6 | :unknown([foo]) {} `---- - x Ident(IdentToken { value: Atom('foo' type=inline), raw: "foo" }) + x Ident { value: Atom('foo' type=inline), raw: "foo" } ,-[$DIR/tests/fixture/selector/pseudo-class/unknown/input.css:4:1] 4 | :unknown(foo bar) {} 5 | :unknown(foo, bar) {} @@ -517,7 +517,7 @@ 6 | :unknown([foo]) {} `---- - x Ident(IdentToken { value: Atom('bar' type=inline), raw: "bar" }) + x Ident { value: Atom('bar' type=inline), raw: "bar" } ,-[$DIR/tests/fixture/selector/pseudo-class/unknown/input.css:4:1] 4 | :unknown(foo bar) {} 5 | :unknown(foo, bar) {} @@ -629,7 +629,7 @@ 7 | :unknown((foo bar)) {} `---- - x Ident(IdentToken { value: Atom('foo' type=inline), raw: "foo" }) + x Ident { value: Atom('foo' type=inline), raw: "foo" } ,-[$DIR/tests/fixture/selector/pseudo-class/unknown/input.css:5:1] 5 | :unknown(foo, bar) {} 6 | :unknown([foo]) {} @@ -757,7 +757,7 @@ 8 | :unknown(((foo bar))) {} `---- - x Ident(IdentToken { value: Atom('foo' type=inline), raw: "foo" }) + x Ident { value: Atom('foo' type=inline), raw: "foo" } ,-[$DIR/tests/fixture/selector/pseudo-class/unknown/input.css:6:1] 6 | :unknown([foo]) {} 7 | :unknown((foo bar)) {} @@ -789,7 +789,7 @@ 8 | :unknown(((foo bar))) {} `---- - x Ident(IdentToken { value: Atom('bar' type=inline), raw: "bar" }) + x Ident { value: Atom('bar' type=inline), raw: "bar" } ,-[$DIR/tests/fixture/selector/pseudo-class/unknown/input.css:6:1] 6 | :unknown([foo]) {} 7 | :unknown((foo bar)) {} @@ -933,7 +933,7 @@ 9 | :unknown({foo: bar}) {} `---- - x Ident(IdentToken { value: Atom('foo' type=inline), raw: "foo" }) + x Ident { value: Atom('foo' type=inline), raw: "foo" } ,-[$DIR/tests/fixture/selector/pseudo-class/unknown/input.css:7:1] 7 | :unknown((foo bar)) {} 8 | :unknown(((foo bar))) {} @@ -965,7 +965,7 @@ 9 | :unknown({foo: bar}) {} `---- - x Ident(IdentToken { value: Atom('bar' type=inline), raw: "bar" }) + x Ident { value: Atom('bar' type=inline), raw: "bar" } ,-[$DIR/tests/fixture/selector/pseudo-class/unknown/input.css:7:1] 7 | :unknown((foo bar)) {} 8 | :unknown(((foo bar))) {} @@ -1109,7 +1109,7 @@ 10 | :unknown({{foo: bar}}) {} `---- - x Ident(IdentToken { value: Atom('foo' type=inline), raw: "foo" }) + x Ident { value: Atom('foo' type=inline), raw: "foo" } ,-[$DIR/tests/fixture/selector/pseudo-class/unknown/input.css:8:1] 8 | :unknown(((foo bar))) {} 9 | :unknown({foo: bar}) {} @@ -1157,7 +1157,7 @@ 10 | :unknown({{foo: bar}}) {} `---- - x Ident(IdentToken { value: Atom('bar' type=inline), raw: "bar" }) + x Ident { value: Atom('bar' type=inline), raw: "bar" } ,-[$DIR/tests/fixture/selector/pseudo-class/unknown/input.css:8:1] 8 | :unknown(((foo bar))) {} 9 | :unknown({foo: bar}) {} @@ -1301,7 +1301,7 @@ 11 | :unknown({foo: bar !important}) {} `---- - x Ident(IdentToken { value: Atom('foo' type=inline), raw: "foo" }) + x Ident { value: Atom('foo' type=inline), raw: "foo" } ,-[$DIR/tests/fixture/selector/pseudo-class/unknown/input.css:9:1] 9 | :unknown({foo: bar}) {} 10 | :unknown({{foo: bar}}) {} @@ -1349,7 +1349,7 @@ 11 | :unknown({foo: bar !important}) {} `---- - x Ident(IdentToken { value: Atom('bar' type=inline), raw: "bar" }) + x Ident { value: Atom('bar' type=inline), raw: "bar" } ,-[$DIR/tests/fixture/selector/pseudo-class/unknown/input.css:9:1] 9 | :unknown({foo: bar}) {} 10 | :unknown({{foo: bar}}) {} @@ -1493,7 +1493,7 @@ 12 | :unknown("string") {} `---- - x Ident(IdentToken { value: Atom('foo' type=inline), raw: "foo" }) + x Ident { value: Atom('foo' type=inline), raw: "foo" } ,-[$DIR/tests/fixture/selector/pseudo-class/unknown/input.css:10:1] 10 | :unknown({{foo: bar}}) {} 11 | :unknown({foo: bar !important}) {} @@ -1541,7 +1541,7 @@ 12 | :unknown("string") {} `---- - x Ident(IdentToken { value: Atom('bar' type=inline), raw: "bar" }) + x Ident { value: Atom('bar' type=inline), raw: "bar" } ,-[$DIR/tests/fixture/selector/pseudo-class/unknown/input.css:10:1] 10 | :unknown({{foo: bar}}) {} 11 | :unknown({foo: bar !important}) {} @@ -1573,7 +1573,7 @@ 12 | :unknown("string") {} `---- - x Delim(DelimToken { value: '!' }) + x Delim { value: '!' } ,-[$DIR/tests/fixture/selector/pseudo-class/unknown/input.css:10:1] 10 | :unknown({{foo: bar}}) {} 11 | :unknown({foo: bar !important}) {} @@ -1589,7 +1589,7 @@ 12 | :unknown("string") {} `---- - x Ident(IdentToken { value: Atom('important' type=static), raw: "important" }) + x Ident { value: Atom('important' type=static), raw: "important" } ,-[$DIR/tests/fixture/selector/pseudo-class/unknown/input.css:10:1] 10 | :unknown({{foo: bar}}) {} 11 | :unknown({foo: bar !important}) {} @@ -1701,7 +1701,7 @@ 13 | :unknown("string", foo) {} `---- - x String(StringToken { value: Atom('string' type=static), raw: "\"string\"" }) + x String { value: Atom('string' type=static), raw: "\"string\"" } ,-[$DIR/tests/fixture/selector/pseudo-class/unknown/input.css:11:1] 11 | :unknown({foo: bar !important}) {} 12 | :unknown("string") {} @@ -1797,7 +1797,7 @@ 14 | :unknown('string') {} `---- - x String(StringToken { value: Atom('string' type=static), raw: "\"string\"" }) + x String { value: Atom('string' type=static), raw: "\"string\"" } ,-[$DIR/tests/fixture/selector/pseudo-class/unknown/input.css:12:1] 12 | :unknown("string") {} 13 | :unknown("string", foo) {} @@ -1845,7 +1845,7 @@ 14 | :unknown('string') {} `---- - x Ident(IdentToken { value: Atom('foo' type=inline), raw: "foo" }) + x Ident { value: Atom('foo' type=inline), raw: "foo" } ,-[$DIR/tests/fixture/selector/pseudo-class/unknown/input.css:12:1] 12 | :unknown("string") {} 13 | :unknown("string", foo) {} @@ -1941,7 +1941,7 @@ 15 | :unknown(url(foo.png)) {} `---- - x String(StringToken { value: Atom('string' type=static), raw: "'string'" }) + x String { value: Atom('string' type=static), raw: "'string'" } ,-[$DIR/tests/fixture/selector/pseudo-class/unknown/input.css:13:1] 13 | :unknown("string", foo) {} 14 | :unknown('string') {} @@ -2149,7 +2149,7 @@ 17 | :unknown(!) {} `---- - x Delim(DelimToken { value: '!' }) + x Delim { value: '!' } ,-[$DIR/tests/fixture/selector/pseudo-class/unknown/input.css:15:1] 15 | :unknown(url(foo.png)) {} 16 | :unknown({!}) {} @@ -2261,7 +2261,7 @@ 18 | :unknown({;}) {} `---- - x Delim(DelimToken { value: '!' }) + x Delim { value: '!' } ,-[$DIR/tests/fixture/selector/pseudo-class/unknown/input.css:16:1] 16 | :unknown({!}) {} 17 | :unknown(!) {} diff --git a/crates/swc_css_parser/tests/fixture/selector/pseudo-class/where/span.swc-stderr b/crates/swc_css_parser/tests/fixture/selector/pseudo-class/where/span.swc-stderr index 6331c340140f..685d7cda67cf 100644 --- a/crates/swc_css_parser/tests/fixture/selector/pseudo-class/where/span.swc-stderr +++ b/crates/swc_css_parser/tests/fixture/selector/pseudo-class/where/span.swc-stderr @@ -5106,7 +5106,7 @@ 27 | h1:where(a, <> p) {} `---- - x Delim(DelimToken { value: '<' }) + x Delim { value: '<' } ,-[$DIR/tests/fixture/selector/pseudo-class/where/input.css:25:1] 25 | /* Forgiving */ 26 | h1:where(<> p) {} @@ -5122,7 +5122,7 @@ 27 | h1:where(a, <> p) {} `---- - x Delim(DelimToken { value: '>' }) + x Delim { value: '>' } ,-[$DIR/tests/fixture/selector/pseudo-class/where/input.css:25:1] 25 | /* Forgiving */ 26 | h1:where(<> p) {} @@ -5154,7 +5154,7 @@ 27 | h1:where(a, <> p) {} `---- - x Ident(IdentToken { value: Atom('p' type=static), raw: "p" }) + x Ident { value: Atom('p' type=static), raw: "p" } ,-[$DIR/tests/fixture/selector/pseudo-class/where/input.css:25:1] 25 | /* Forgiving */ 26 | h1:where(<> p) {} @@ -5362,7 +5362,7 @@ 28 | h1:where(<> p,a) {} `---- - x Delim(DelimToken { value: '<' }) + x Delim { value: '<' } ,-[$DIR/tests/fixture/selector/pseudo-class/where/input.css:26:1] 26 | h1:where(<> p) {} 27 | h1:where(a, <> p) {} @@ -5378,7 +5378,7 @@ 28 | h1:where(<> p,a) {} `---- - x Delim(DelimToken { value: '>' }) + x Delim { value: '>' } ,-[$DIR/tests/fixture/selector/pseudo-class/where/input.css:26:1] 26 | h1:where(<> p) {} 27 | h1:where(a, <> p) {} @@ -5410,7 +5410,7 @@ 28 | h1:where(<> p,a) {} `---- - x Ident(IdentToken { value: Atom('p' type=static), raw: "p" }) + x Ident { value: Atom('p' type=static), raw: "p" } ,-[$DIR/tests/fixture/selector/pseudo-class/where/input.css:26:1] 26 | h1:where(<> p) {} 27 | h1:where(a, <> p) {} @@ -5554,7 +5554,7 @@ 29 | h1:where(a, <> p,a) {} `---- - x Delim(DelimToken { value: '<' }) + x Delim { value: '<' } ,-[$DIR/tests/fixture/selector/pseudo-class/where/input.css:27:1] 27 | h1:where(a, <> p) {} 28 | h1:where(<> p,a) {} @@ -5570,7 +5570,7 @@ 29 | h1:where(a, <> p,a) {} `---- - x Delim(DelimToken { value: '>' }) + x Delim { value: '>' } ,-[$DIR/tests/fixture/selector/pseudo-class/where/input.css:27:1] 27 | h1:where(a, <> p) {} 28 | h1:where(<> p,a) {} @@ -5602,7 +5602,7 @@ 29 | h1:where(a, <> p,a) {} `---- - x Ident(IdentToken { value: Atom('p' type=static), raw: "p" }) + x Ident { value: Atom('p' type=static), raw: "p" } ,-[$DIR/tests/fixture/selector/pseudo-class/where/input.css:27:1] 27 | h1:where(a, <> p) {} 28 | h1:where(<> p,a) {} @@ -5835,7 +5835,7 @@ : ^ `---- - x Delim(DelimToken { value: '<' }) + x Delim { value: '<' } ,-[$DIR/tests/fixture/selector/pseudo-class/where/input.css:28:1] 28 | h1:where(<> p,a) {} 29 | h1:where(a, <> p,a) {} @@ -5849,7 +5849,7 @@ : ^ `---- - x Delim(DelimToken { value: '>' }) + x Delim { value: '>' } ,-[$DIR/tests/fixture/selector/pseudo-class/where/input.css:28:1] 28 | h1:where(<> p,a) {} 29 | h1:where(a, <> p,a) {} @@ -5877,7 +5877,7 @@ : ^ `---- - x Ident(IdentToken { value: Atom('p' type=static), raw: "p" }) + x Ident { value: Atom('p' type=static), raw: "p" } ,-[$DIR/tests/fixture/selector/pseudo-class/where/input.css:28:1] 28 | h1:where(<> p,a) {} 29 | h1:where(a, <> p,a) {} diff --git a/crates/swc_css_parser/tests/fixture/selector/pseudo-element/unknown/span.swc-stderr b/crates/swc_css_parser/tests/fixture/selector/pseudo-element/unknown/span.swc-stderr index 6afcd613ad30..d47a045e8e96 100644 --- a/crates/swc_css_parser/tests/fixture/selector/pseudo-element/unknown/span.swc-stderr +++ b/crates/swc_css_parser/tests/fixture/selector/pseudo-element/unknown/span.swc-stderr @@ -244,7 +244,7 @@ 4 | ::unknown(foo bar) {} `---- - x Ident(IdentToken { value: Atom('foo' type=inline), raw: "foo" }) + x Ident { value: Atom('foo' type=inline), raw: "foo" } ,-[$DIR/tests/fixture/selector/pseudo-element/unknown/input.css:2:1] 2 | ::unknown() {} 3 | ::unknown(foo) {} @@ -340,7 +340,7 @@ 5 | ::unknown(foo, bar) {} `---- - x Ident(IdentToken { value: Atom('foo' type=inline), raw: "foo" }) + x Ident { value: Atom('foo' type=inline), raw: "foo" } ,-[$DIR/tests/fixture/selector/pseudo-element/unknown/input.css:3:1] 3 | ::unknown(foo) {} 4 | ::unknown(foo bar) {} @@ -372,7 +372,7 @@ 5 | ::unknown(foo, bar) {} `---- - x Ident(IdentToken { value: Atom('bar' type=inline), raw: "bar" }) + x Ident { value: Atom('bar' type=inline), raw: "bar" } ,-[$DIR/tests/fixture/selector/pseudo-element/unknown/input.css:3:1] 3 | ::unknown(foo) {} 4 | ::unknown(foo bar) {} @@ -468,7 +468,7 @@ 6 | ::unknown([foo]) {} `---- - x Ident(IdentToken { value: Atom('foo' type=inline), raw: "foo" }) + x Ident { value: Atom('foo' type=inline), raw: "foo" } ,-[$DIR/tests/fixture/selector/pseudo-element/unknown/input.css:4:1] 4 | ::unknown(foo bar) {} 5 | ::unknown(foo, bar) {} @@ -516,7 +516,7 @@ 6 | ::unknown([foo]) {} `---- - x Ident(IdentToken { value: Atom('bar' type=inline), raw: "bar" }) + x Ident { value: Atom('bar' type=inline), raw: "bar" } ,-[$DIR/tests/fixture/selector/pseudo-element/unknown/input.css:4:1] 4 | ::unknown(foo bar) {} 5 | ::unknown(foo, bar) {} @@ -628,7 +628,7 @@ 7 | ::unknown((foo bar)) {} `---- - x Ident(IdentToken { value: Atom('foo' type=inline), raw: "foo" }) + x Ident { value: Atom('foo' type=inline), raw: "foo" } ,-[$DIR/tests/fixture/selector/pseudo-element/unknown/input.css:5:1] 5 | ::unknown(foo, bar) {} 6 | ::unknown([foo]) {} @@ -756,7 +756,7 @@ 8 | ::unknown(((foo bar))) {} `---- - x Ident(IdentToken { value: Atom('foo' type=inline), raw: "foo" }) + x Ident { value: Atom('foo' type=inline), raw: "foo" } ,-[$DIR/tests/fixture/selector/pseudo-element/unknown/input.css:6:1] 6 | ::unknown([foo]) {} 7 | ::unknown((foo bar)) {} @@ -788,7 +788,7 @@ 8 | ::unknown(((foo bar))) {} `---- - x Ident(IdentToken { value: Atom('bar' type=inline), raw: "bar" }) + x Ident { value: Atom('bar' type=inline), raw: "bar" } ,-[$DIR/tests/fixture/selector/pseudo-element/unknown/input.css:6:1] 6 | ::unknown([foo]) {} 7 | ::unknown((foo bar)) {} @@ -932,7 +932,7 @@ 9 | ::unknown({foo: bar}) {} `---- - x Ident(IdentToken { value: Atom('foo' type=inline), raw: "foo" }) + x Ident { value: Atom('foo' type=inline), raw: "foo" } ,-[$DIR/tests/fixture/selector/pseudo-element/unknown/input.css:7:1] 7 | ::unknown((foo bar)) {} 8 | ::unknown(((foo bar))) {} @@ -964,7 +964,7 @@ 9 | ::unknown({foo: bar}) {} `---- - x Ident(IdentToken { value: Atom('bar' type=inline), raw: "bar" }) + x Ident { value: Atom('bar' type=inline), raw: "bar" } ,-[$DIR/tests/fixture/selector/pseudo-element/unknown/input.css:7:1] 7 | ::unknown((foo bar)) {} 8 | ::unknown(((foo bar))) {} @@ -1108,7 +1108,7 @@ 10 | ::unknown({{foo: bar}}) {} `---- - x Ident(IdentToken { value: Atom('foo' type=inline), raw: "foo" }) + x Ident { value: Atom('foo' type=inline), raw: "foo" } ,-[$DIR/tests/fixture/selector/pseudo-element/unknown/input.css:8:1] 8 | ::unknown(((foo bar))) {} 9 | ::unknown({foo: bar}) {} @@ -1156,7 +1156,7 @@ 10 | ::unknown({{foo: bar}}) {} `---- - x Ident(IdentToken { value: Atom('bar' type=inline), raw: "bar" }) + x Ident { value: Atom('bar' type=inline), raw: "bar" } ,-[$DIR/tests/fixture/selector/pseudo-element/unknown/input.css:8:1] 8 | ::unknown(((foo bar))) {} 9 | ::unknown({foo: bar}) {} @@ -1300,7 +1300,7 @@ 11 | ::unknown({foo: bar !important}) {} `---- - x Ident(IdentToken { value: Atom('foo' type=inline), raw: "foo" }) + x Ident { value: Atom('foo' type=inline), raw: "foo" } ,-[$DIR/tests/fixture/selector/pseudo-element/unknown/input.css:9:1] 9 | ::unknown({foo: bar}) {} 10 | ::unknown({{foo: bar}}) {} @@ -1348,7 +1348,7 @@ 11 | ::unknown({foo: bar !important}) {} `---- - x Ident(IdentToken { value: Atom('bar' type=inline), raw: "bar" }) + x Ident { value: Atom('bar' type=inline), raw: "bar" } ,-[$DIR/tests/fixture/selector/pseudo-element/unknown/input.css:9:1] 9 | ::unknown({foo: bar}) {} 10 | ::unknown({{foo: bar}}) {} @@ -1492,7 +1492,7 @@ 12 | ::unknown("string") {} `---- - x Ident(IdentToken { value: Atom('foo' type=inline), raw: "foo" }) + x Ident { value: Atom('foo' type=inline), raw: "foo" } ,-[$DIR/tests/fixture/selector/pseudo-element/unknown/input.css:10:1] 10 | ::unknown({{foo: bar}}) {} 11 | ::unknown({foo: bar !important}) {} @@ -1540,7 +1540,7 @@ 12 | ::unknown("string") {} `---- - x Ident(IdentToken { value: Atom('bar' type=inline), raw: "bar" }) + x Ident { value: Atom('bar' type=inline), raw: "bar" } ,-[$DIR/tests/fixture/selector/pseudo-element/unknown/input.css:10:1] 10 | ::unknown({{foo: bar}}) {} 11 | ::unknown({foo: bar !important}) {} @@ -1572,7 +1572,7 @@ 12 | ::unknown("string") {} `---- - x Delim(DelimToken { value: '!' }) + x Delim { value: '!' } ,-[$DIR/tests/fixture/selector/pseudo-element/unknown/input.css:10:1] 10 | ::unknown({{foo: bar}}) {} 11 | ::unknown({foo: bar !important}) {} @@ -1588,7 +1588,7 @@ 12 | ::unknown("string") {} `---- - x Ident(IdentToken { value: Atom('important' type=static), raw: "important" }) + x Ident { value: Atom('important' type=static), raw: "important" } ,-[$DIR/tests/fixture/selector/pseudo-element/unknown/input.css:10:1] 10 | ::unknown({{foo: bar}}) {} 11 | ::unknown({foo: bar !important}) {} @@ -1700,7 +1700,7 @@ 13 | ::unknown("string", foo) {} `---- - x String(StringToken { value: Atom('string' type=static), raw: "\"string\"" }) + x String { value: Atom('string' type=static), raw: "\"string\"" } ,-[$DIR/tests/fixture/selector/pseudo-element/unknown/input.css:11:1] 11 | ::unknown({foo: bar !important}) {} 12 | ::unknown("string") {} @@ -1796,7 +1796,7 @@ 14 | ::unknown('string') {} `---- - x String(StringToken { value: Atom('string' type=static), raw: "\"string\"" }) + x String { value: Atom('string' type=static), raw: "\"string\"" } ,-[$DIR/tests/fixture/selector/pseudo-element/unknown/input.css:12:1] 12 | ::unknown("string") {} 13 | ::unknown("string", foo) {} @@ -1844,7 +1844,7 @@ 14 | ::unknown('string') {} `---- - x Ident(IdentToken { value: Atom('foo' type=inline), raw: "foo" }) + x Ident { value: Atom('foo' type=inline), raw: "foo" } ,-[$DIR/tests/fixture/selector/pseudo-element/unknown/input.css:12:1] 12 | ::unknown("string") {} 13 | ::unknown("string", foo) {} @@ -1940,7 +1940,7 @@ 15 | ::unknown(url(foo.png)) {} `---- - x String(StringToken { value: Atom('string' type=static), raw: "'string'" }) + x String { value: Atom('string' type=static), raw: "'string'" } ,-[$DIR/tests/fixture/selector/pseudo-element/unknown/input.css:13:1] 13 | ::unknown("string", foo) {} 14 | ::unknown('string') {} @@ -2148,7 +2148,7 @@ 17 | ::unknown(!) {} `---- - x Delim(DelimToken { value: '!' }) + x Delim { value: '!' } ,-[$DIR/tests/fixture/selector/pseudo-element/unknown/input.css:15:1] 15 | ::unknown(url(foo.png)) {} 16 | ::unknown({!}) {} @@ -2260,7 +2260,7 @@ 18 | ::unknown({;}) {} `---- - x Delim(DelimToken { value: '!' }) + x Delim { value: '!' } ,-[$DIR/tests/fixture/selector/pseudo-element/unknown/input.css:16:1] 16 | ::unknown({!}) {} 17 | ::unknown(!) {} diff --git a/crates/swc_css_parser/tests/fixture/style-block/span.swc-stderr b/crates/swc_css_parser/tests/fixture/style-block/span.swc-stderr index 826843c000f4..60ae7d4a02c5 100644 --- a/crates/swc_css_parser/tests/fixture/style-block/span.swc-stderr +++ b/crates/swc_css_parser/tests/fixture/style-block/span.swc-stderr @@ -4730,7 +4730,7 @@ 92 | height: 100px; `---- - x Ident(IdentToken { value: Atom('mobile' type=inline), raw: "mobile" }) + x Ident { value: Atom('mobile' type=inline), raw: "mobile" } ,-[$DIR/tests/fixture/style-block/input.css:90:1] 90 | width: 10px; 91 | @mixin mobile { @@ -4795,7 +4795,7 @@ 93 | } `---- - x Ident(IdentToken { value: Atom('height' type=inline), raw: "height" }) + x Ident { value: Atom('height' type=inline), raw: "height" } ,-[$DIR/tests/fixture/style-block/input.css:91:1] 91 | @mixin mobile { 92 | height: 100px; @@ -5156,7 +5156,7 @@ : ^^^^^^^ `---- - x String(StringToken { value: Atom('a.css' type=inline), raw: "\"a.css\"" }) + x String { value: Atom('a.css' type=inline), raw: "\"a.css\"" } ,-[$DIR/tests/fixture/style-block/input.css:97:1] 97 | 98 | a { @unknown "a.css"; } @@ -5296,7 +5296,7 @@ : ^^^ `---- - x Ident(IdentToken { value: Atom('foo' type=inline), raw: "foo" }) + x Ident { value: Atom('foo' type=inline), raw: "foo" } ,-[$DIR/tests/fixture/style-block/input.css:99:1] 99 | 100 | a { @unknown foo {} } @@ -5617,7 +5617,7 @@ 108 | height: 0; `---- - x Ident(IdentToken { value: Atom('width' type=inline), raw: "width" }) + x Ident { value: Atom('width' type=inline), raw: "width" } ,-[$DIR/tests/fixture/style-block/input.css:106:1] 106 | --zero-size: { 107 | width: 0; @@ -5665,7 +5665,7 @@ 108 | height: 0; `---- - x Number(NumberToken { value: 0.0, raw: "0", type_flag: Integer }) + x Number { value: 0.0, raw: "0", type_flag: Integer } ,-[$DIR/tests/fixture/style-block/input.css:106:1] 106 | --zero-size: { 107 | width: 0; @@ -5713,7 +5713,7 @@ 109 | }; `---- - x Ident(IdentToken { value: Atom('height' type=inline), raw: "height" }) + x Ident { value: Atom('height' type=inline), raw: "height" } ,-[$DIR/tests/fixture/style-block/input.css:107:1] 107 | width: 0; 108 | height: 0; @@ -5761,7 +5761,7 @@ 109 | }; `---- - x Number(NumberToken { value: 0.0, raw: "0", type_flag: Integer }) + x Number { value: 0.0, raw: "0", type_flag: Integer } ,-[$DIR/tests/fixture/style-block/input.css:107:1] 107 | width: 0; 108 | height: 0; @@ -5902,7 +5902,7 @@ 112 | height: 16px; `---- - x Ident(IdentToken { value: Atom('width' type=inline), raw: "width" }) + x Ident { value: Atom('width' type=inline), raw: "width" } ,-[$DIR/tests/fixture/style-block/input.css:110:1] 110 | --small-icon: { 111 | width: 16px; @@ -5998,7 +5998,7 @@ 113 | } `---- - x Ident(IdentToken { value: Atom('height' type=inline), raw: "height" }) + x Ident { value: Atom('height' type=inline), raw: "height" } ,-[$DIR/tests/fixture/style-block/input.css:111:1] 111 | width: 16px; 112 | height: 16px; diff --git a/crates/swc_css_parser/tests/fixture/styled-jsx/selector/1/span.swc-stderr b/crates/swc_css_parser/tests/fixture/styled-jsx/selector/1/span.swc-stderr index d3fc1bf0975d..57b681a53b0d 100644 --- a/crates/swc_css_parser/tests/fixture/styled-jsx/selector/1/span.swc-stderr +++ b/crates/swc_css_parser/tests/fixture/styled-jsx/selector/1/span.swc-stderr @@ -69,7 +69,7 @@ 2 | color: red; `---- - x Delim(DelimToken { value: '.' }) + x Delim { value: '.' } ,-[$DIR/tests/fixture/styled-jsx/selector/1/input.css:1:1] 1 | :global(.foo + a) { : ^ @@ -83,7 +83,7 @@ 2 | color: red; `---- - x Ident(IdentToken { value: Atom('foo' type=inline), raw: "foo" }) + x Ident { value: Atom('foo' type=inline), raw: "foo" } ,-[$DIR/tests/fixture/styled-jsx/selector/1/input.css:1:1] 1 | :global(.foo + a) { : ^^^ @@ -111,7 +111,7 @@ 2 | color: red; `---- - x Delim(DelimToken { value: '+' }) + x Delim { value: '+' } ,-[$DIR/tests/fixture/styled-jsx/selector/1/input.css:1:1] 1 | :global(.foo + a) { : ^ @@ -139,7 +139,7 @@ 2 | color: red; `---- - x Ident(IdentToken { value: Atom('a' type=static), raw: "a" }) + x Ident { value: Atom('a' type=static), raw: "a" } ,-[$DIR/tests/fixture/styled-jsx/selector/1/input.css:1:1] 1 | :global(.foo + a) { : ^ diff --git a/crates/swc_css_parser/tests/fixture/styled-jsx/selector/2/span.swc-stderr b/crates/swc_css_parser/tests/fixture/styled-jsx/selector/2/span.swc-stderr index 41368ff6afd9..6b9c4bded8fa 100644 --- a/crates/swc_css_parser/tests/fixture/styled-jsx/selector/2/span.swc-stderr +++ b/crates/swc_css_parser/tests/fixture/styled-jsx/selector/2/span.swc-stderr @@ -111,7 +111,7 @@ 2 | color: green; `---- - x Ident(IdentToken { value: Atom('span' type=static), raw: "span" }) + x Ident { value: Atom('span' type=static), raw: "span" } ,-[$DIR/tests/fixture/styled-jsx/selector/2/input.css:1:1] 1 | p :global(span:not(.test)) { : ^^^^ @@ -139,7 +139,7 @@ 2 | color: green; `---- - x Function(FunctionToken { value: Atom('not' type=static), raw: "not" }) + x Function { value: Atom('not' type=static), raw: "not" } ,-[$DIR/tests/fixture/styled-jsx/selector/2/input.css:1:1] 1 | p :global(span:not(.test)) { : ^^^^ @@ -153,7 +153,7 @@ 2 | color: green; `---- - x Delim(DelimToken { value: '.' }) + x Delim { value: '.' } ,-[$DIR/tests/fixture/styled-jsx/selector/2/input.css:1:1] 1 | p :global(span:not(.test)) { : ^ @@ -167,7 +167,7 @@ 2 | color: green; `---- - x Ident(IdentToken { value: Atom('test' type=inline), raw: "test" }) + x Ident { value: Atom('test' type=inline), raw: "test" } ,-[$DIR/tests/fixture/styled-jsx/selector/2/input.css:1:1] 1 | p :global(span:not(.test)) { : ^^^^ diff --git a/crates/swc_css_parser/tests/fixture/value/custom-property/span.swc-stderr b/crates/swc_css_parser/tests/fixture/value/custom-property/span.swc-stderr index 6506871b02b8..0ecc4c307f19 100644 --- a/crates/swc_css_parser/tests/fixture/value/custom-property/span.swc-stderr +++ b/crates/swc_css_parser/tests/fixture/value/custom-property/span.swc-stderr @@ -344,7 +344,7 @@ : ^^^^^ `---- - x Ident(IdentToken { value: Atom('value' type=inline), raw: "value" }) + x Ident { value: Atom('value' type=inline), raw: "value" } ,-[$DIR/tests/fixture/value/custom-property/input.css:1:1] 1 | :root { 2 | ---:value; @@ -399,7 +399,7 @@ 5 | --important1: value!important; `---- - x Ident(IdentToken { value: Atom('value' type=inline), raw: "value" }) + x Ident { value: Atom('value' type=inline), raw: "value" } ,-[$DIR/tests/fixture/value/custom-property/input.css:3:1] 3 | 4 | --important:value!important; @@ -471,7 +471,7 @@ 6 | --important2: value !important; `---- - x Ident(IdentToken { value: Atom('value' type=inline), raw: "value" }) + x Ident { value: Atom('value' type=inline), raw: "value" } ,-[$DIR/tests/fixture/value/custom-property/input.css:4:1] 4 | --important:value!important; 5 | --important1: value!important; @@ -543,7 +543,7 @@ 7 | --important3:value !important; `---- - x Ident(IdentToken { value: Atom('value' type=inline), raw: "value" }) + x Ident { value: Atom('value' type=inline), raw: "value" } ,-[$DIR/tests/fixture/value/custom-property/input.css:5:1] 5 | --important1: value!important; 6 | --important2: value !important; @@ -615,7 +615,7 @@ 8 | --important4: calc(1)!important; `---- - x Ident(IdentToken { value: Atom('value' type=inline), raw: "value" }) + x Ident { value: Atom('value' type=inline), raw: "value" } ,-[$DIR/tests/fixture/value/custom-property/input.css:6:1] 6 | --important2: value !important; 7 | --important3:value !important; @@ -702,7 +702,7 @@ : ^ `---- - x Number(NumberToken { value: 1.0, raw: "1", type_flag: Integer }) + x Number { value: 1.0, raw: "1", type_flag: Integer } ,-[$DIR/tests/fixture/value/custom-property/input.css:7:1] 7 | --important3:value !important; 8 | --important4: calc(1)!important; @@ -998,7 +998,7 @@ 17 | --number: 1; `---- - x Ident(IdentToken { value: Atom('ident' type=inline), raw: "ident" }) + x Ident { value: Atom('ident' type=inline), raw: "ident" } ,-[$DIR/tests/fixture/value/custom-property/input.css:15:1] 15 | 16 | --no-whitespace:ident; @@ -1054,7 +1054,7 @@ 18 | --unit: 100vw; `---- - x Number(NumberToken { value: 1.0, raw: "1", type_flag: Integer }) + x Number { value: 1.0, raw: "1", type_flag: Integer } ,-[$DIR/tests/fixture/value/custom-property/input.css:16:1] 16 | --no-whitespace:ident; 17 | --number: 1; @@ -1160,7 +1160,7 @@ : ^^^^ `---- - x Hash(HashToken { is_id: false, value: Atom('06c' type=inline), raw: "06c" }) + x Hash { is_id: false, value: Atom('06c' type=inline), raw: "06c" } ,-[$DIR/tests/fixture/value/custom-property/input.css:18:1] 18 | --unit: 100vw; 19 | --color: #06c; @@ -1239,7 +1239,7 @@ 22 | --variable: var(--unit); `---- - x Number(NumberToken { value: 1.0, raw: "1", type_flag: Integer }) + x Number { value: 1.0, raw: "1", type_flag: Integer } ,-[$DIR/tests/fixture/value/custom-property/input.css:20:1] 20 | 21 | --function: calc(1 + 1); @@ -1271,7 +1271,7 @@ 22 | --variable: var(--unit); `---- - x Delim(DelimToken { value: '+' }) + x Delim { value: '+' } ,-[$DIR/tests/fixture/value/custom-property/input.css:20:1] 20 | 21 | --function: calc(1 + 1); @@ -1303,7 +1303,7 @@ 22 | --variable: var(--unit); `---- - x Number(NumberToken { value: 1.0, raw: "1", type_flag: Integer }) + x Number { value: 1.0, raw: "1", type_flag: Integer } ,-[$DIR/tests/fixture/value/custom-property/input.css:20:1] 20 | 21 | --function: calc(1 + 1); @@ -1374,7 +1374,7 @@ : ^^^^^^ `---- - x Ident(IdentToken { value: Atom('--unit' type=inline), raw: "--unit" }) + x Ident { value: Atom('--unit' type=inline), raw: "--unit" } ,-[$DIR/tests/fixture/value/custom-property/input.css:21:1] 21 | --function: calc(1 + 1); 22 | --variable: var(--unit); @@ -1429,7 +1429,7 @@ 25 | --string: "double quoted string"; `---- - x String(StringToken { value: Atom('single quoted string' type=dynamic), raw: "'single quoted string'" }) + x String { value: Atom('single quoted string' type=dynamic), raw: "'single quoted string'" } ,-[$DIR/tests/fixture/value/custom-property/input.css:23:1] 23 | 24 | --string: 'single quoted string'; @@ -1479,7 +1479,7 @@ : ^^^^^^^^^^^^^^^^^^^^^^ `---- - x String(StringToken { value: Atom('double quoted string' type=dynamic), raw: "\"double quoted string\"" }) + x String { value: Atom('double quoted string' type=dynamic), raw: "\"double quoted string\"" } ,-[$DIR/tests/fixture/value/custom-property/input.css:24:1] 24 | --string: 'single quoted string'; 25 | --string: "double quoted string"; @@ -1558,7 +1558,7 @@ 28 | --square-block1: []; `---- - x Number(NumberToken { value: 1.0, raw: "1", type_flag: Integer }) + x Number { value: 1.0, raw: "1", type_flag: Integer } ,-[$DIR/tests/fixture/value/custom-property/input.css:26:1] 26 | 27 | --square-block: [1, 2, 3]; @@ -1606,7 +1606,7 @@ 28 | --square-block1: []; `---- - x Number(NumberToken { value: 2.0, raw: "2", type_flag: Integer }) + x Number { value: 2.0, raw: "2", type_flag: Integer } ,-[$DIR/tests/fixture/value/custom-property/input.css:26:1] 26 | 27 | --square-block: [1, 2, 3]; @@ -1654,7 +1654,7 @@ 28 | --square-block1: []; `---- - x Number(NumberToken { value: 3.0, raw: "3", type_flag: Integer }) + x Number { value: 3.0, raw: "3", type_flag: Integer } ,-[$DIR/tests/fixture/value/custom-property/input.css:26:1] 26 | 27 | --square-block: [1, 2, 3]; @@ -1862,7 +1862,7 @@ 31 | --round-block1: (); `---- - x Number(NumberToken { value: 1.0, raw: "1", type_flag: Integer }) + x Number { value: 1.0, raw: "1", type_flag: Integer } ,-[$DIR/tests/fixture/value/custom-property/input.css:29:1] 29 | --square-block2:[]; 30 | --round-block: (1, 2, 3); @@ -1910,7 +1910,7 @@ 31 | --round-block1: (); `---- - x Number(NumberToken { value: 2.0, raw: "2", type_flag: Integer }) + x Number { value: 2.0, raw: "2", type_flag: Integer } ,-[$DIR/tests/fixture/value/custom-property/input.css:29:1] 29 | --square-block2:[]; 30 | --round-block: (1, 2, 3); @@ -1958,7 +1958,7 @@ 31 | --round-block1: (); `---- - x Number(NumberToken { value: 3.0, raw: "3", type_flag: Integer }) + x Number { value: 3.0, raw: "3", type_flag: Integer } ,-[$DIR/tests/fixture/value/custom-property/input.css:29:1] 29 | --square-block2:[]; 30 | --round-block: (1, 2, 3); @@ -2166,7 +2166,7 @@ 34 | --bracket-block1: {}; `---- - x Number(NumberToken { value: 1.0, raw: "1", type_flag: Integer }) + x Number { value: 1.0, raw: "1", type_flag: Integer } ,-[$DIR/tests/fixture/value/custom-property/input.css:32:1] 32 | --round-block2:(); 33 | --bracket-block: {1, 2, 3}; @@ -2214,7 +2214,7 @@ 34 | --bracket-block1: {}; `---- - x Number(NumberToken { value: 2.0, raw: "2", type_flag: Integer }) + x Number { value: 2.0, raw: "2", type_flag: Integer } ,-[$DIR/tests/fixture/value/custom-property/input.css:32:1] 32 | --round-block2:(); 33 | --bracket-block: {1, 2, 3}; @@ -2262,7 +2262,7 @@ 34 | --bracket-block1: {}; `---- - x Number(NumberToken { value: 3.0, raw: "3", type_flag: Integer }) + x Number { value: 3.0, raw: "3", type_flag: Integer } ,-[$DIR/tests/fixture/value/custom-property/input.css:32:1] 32 | --round-block2:(); 33 | --bracket-block: {1, 2, 3}; @@ -2462,7 +2462,7 @@ 39 | --javascript: function(rule) { console.log(rule) }; `---- - x Number(NumberToken { value: 1.0, raw: "1", type_flag: Integer }) + x Number { value: 1.0, raw: "1", type_flag: Integer } ,-[$DIR/tests/fixture/value/custom-property/input.css:37:1] 37 | 38 | --JSON: [1, "2", {"three": {"a":1}}, [4]]; @@ -2510,7 +2510,7 @@ 39 | --javascript: function(rule) { console.log(rule) }; `---- - x String(StringToken { value: Atom('2' type=inline), raw: "\"2\"" }) + x String { value: Atom('2' type=inline), raw: "\"2\"" } ,-[$DIR/tests/fixture/value/custom-property/input.css:37:1] 37 | 38 | --JSON: [1, "2", {"three": {"a":1}}, [4]]; @@ -2582,7 +2582,7 @@ 39 | --javascript: function(rule) { console.log(rule) }; `---- - x String(StringToken { value: Atom('three' type=inline), raw: "\"three\"" }) + x String { value: Atom('three' type=inline), raw: "\"three\"" } ,-[$DIR/tests/fixture/value/custom-property/input.css:37:1] 37 | 38 | --JSON: [1, "2", {"three": {"a":1}}, [4]]; @@ -2654,7 +2654,7 @@ 39 | --javascript: function(rule) { console.log(rule) }; `---- - x String(StringToken { value: Atom('a' type=static), raw: "\"a\"" }) + x String { value: Atom('a' type=static), raw: "\"a\"" } ,-[$DIR/tests/fixture/value/custom-property/input.css:37:1] 37 | 38 | --JSON: [1, "2", {"three": {"a":1}}, [4]]; @@ -2686,7 +2686,7 @@ 39 | --javascript: function(rule) { console.log(rule) }; `---- - x Number(NumberToken { value: 1.0, raw: "1", type_flag: Integer }) + x Number { value: 1.0, raw: "1", type_flag: Integer } ,-[$DIR/tests/fixture/value/custom-property/input.css:37:1] 37 | 38 | --JSON: [1, "2", {"three": {"a":1}}, [4]]; @@ -2758,7 +2758,7 @@ 39 | --javascript: function(rule) { console.log(rule) }; `---- - x Number(NumberToken { value: 4.0, raw: "4", type_flag: Integer }) + x Number { value: 4.0, raw: "4", type_flag: Integer } ,-[$DIR/tests/fixture/value/custom-property/input.css:37:1] 37 | 38 | --JSON: [1, "2", {"three": {"a":1}}, [4]]; @@ -2829,7 +2829,7 @@ : ^^^^ `---- - x Ident(IdentToken { value: Atom('rule' type=inline), raw: "rule" }) + x Ident { value: Atom('rule' type=inline), raw: "rule" } ,-[$DIR/tests/fixture/value/custom-property/input.css:38:1] 38 | --JSON: [1, "2", {"three": {"a":1}}, [4]]; 39 | --javascript: function(rule) { console.log(rule) }; @@ -2892,7 +2892,7 @@ : ^^^^^^^ `---- - x Ident(IdentToken { value: Atom('console' type=inline), raw: "console" }) + x Ident { value: Atom('console' type=inline), raw: "console" } ,-[$DIR/tests/fixture/value/custom-property/input.css:38:1] 38 | --JSON: [1, "2", {"three": {"a":1}}, [4]]; 39 | --javascript: function(rule) { console.log(rule) }; @@ -2906,7 +2906,7 @@ : ^ `---- - x Delim(DelimToken { value: '.' }) + x Delim { value: '.' } ,-[$DIR/tests/fixture/value/custom-property/input.css:38:1] 38 | --JSON: [1, "2", {"three": {"a":1}}, [4]]; 39 | --javascript: function(rule) { console.log(rule) }; @@ -2941,7 +2941,7 @@ : ^^^^ `---- - x Ident(IdentToken { value: Atom('rule' type=inline), raw: "rule" }) + x Ident { value: Atom('rule' type=inline), raw: "rule" } ,-[$DIR/tests/fixture/value/custom-property/input.css:38:1] 38 | --JSON: [1, "2", {"three": {"a":1}}, [4]]; 39 | --javascript: function(rule) { console.log(rule) }; @@ -3539,7 +3539,7 @@ 46 | --semicolon-not-top-level: (;); `---- - x Delim(DelimToken { value: '!' }) + x Delim { value: '!' } ,-[$DIR/tests/fixture/value/custom-property/input.css:44:1] 44 | --complex-balanced:{[({()})()()[({})]]}[{()}]([]); 45 | --fake-important:{!important}; @@ -3555,7 +3555,7 @@ 46 | --semicolon-not-top-level: (;); `---- - x Ident(IdentToken { value: Atom('important' type=static), raw: "important" }) + x Ident { value: Atom('important' type=static), raw: "important" } ,-[$DIR/tests/fixture/value/custom-property/input.css:44:1] 44 | --complex-balanced:{[({()})()()[({})]]}[{()}]([]); 45 | --fake-important:{!important}; @@ -3715,7 +3715,7 @@ 48 | --zero-size: { `---- - x Delim(DelimToken { value: '!' }) + x Delim { value: '!' } ,-[$DIR/tests/fixture/value/custom-property/input.css:46:1] 46 | --semicolon-not-top-level: (;); 47 | --delim-not-top-level: (!); @@ -3821,7 +3821,7 @@ 50 | height: 0; `---- - x Ident(IdentToken { value: Atom('width' type=inline), raw: "width" }) + x Ident { value: Atom('width' type=inline), raw: "width" } ,-[$DIR/tests/fixture/value/custom-property/input.css:48:1] 48 | --zero-size: { 49 | width: 0; @@ -3869,7 +3869,7 @@ 50 | height: 0; `---- - x Number(NumberToken { value: 0.0, raw: "0", type_flag: Integer }) + x Number { value: 0.0, raw: "0", type_flag: Integer } ,-[$DIR/tests/fixture/value/custom-property/input.css:48:1] 48 | --zero-size: { 49 | width: 0; @@ -3917,7 +3917,7 @@ 51 | }; `---- - x Ident(IdentToken { value: Atom('height' type=inline), raw: "height" }) + x Ident { value: Atom('height' type=inline), raw: "height" } ,-[$DIR/tests/fixture/value/custom-property/input.css:49:1] 49 | width: 0; 50 | height: 0; @@ -3965,7 +3965,7 @@ 51 | }; `---- - x Number(NumberToken { value: 0.0, raw: "0", type_flag: Integer }) + x Number { value: 0.0, raw: "0", type_flag: Integer } ,-[$DIR/tests/fixture/value/custom-property/input.css:49:1] 49 | width: 0; 50 | height: 0; @@ -4106,7 +4106,7 @@ 54 | height: 16px; `---- - x Ident(IdentToken { value: Atom('width' type=inline), raw: "width" }) + x Ident { value: Atom('width' type=inline), raw: "width" } ,-[$DIR/tests/fixture/value/custom-property/input.css:52:1] 52 | --small-icon: { 53 | width: 16px; @@ -4202,7 +4202,7 @@ 55 | } `---- - x Ident(IdentToken { value: Atom('height' type=inline), raw: "height" }) + x Ident { value: Atom('height' type=inline), raw: "height" } ,-[$DIR/tests/fixture/value/custom-property/input.css:53:1] 53 | width: 16px; 54 | height: 16px; @@ -4418,7 +4418,7 @@ 60 | :root {--foo: } `---- - x Number(NumberToken { value: 1.0, raw: "1", type_flag: Integer }) + x Number { value: 1.0, raw: "1", type_flag: Integer } ,-[$DIR/tests/fixture/value/custom-property/input.css:58:1] 58 | 59 | :root{--a:1} @@ -4794,7 +4794,7 @@ 67 | } `---- - x Ident(IdentToken { value: Atom('value' type=inline), raw: "value" }) + x Ident { value: Atom('value' type=inline), raw: "value" } ,-[$DIR/tests/fixture/value/custom-property/input.css:65:1] 65 | :root { 66 | --var: value; diff --git a/crates/swc_css_parser/tests/fixture/value/url/span.swc-stderr b/crates/swc_css_parser/tests/fixture/value/url/span.swc-stderr index c13dc417265b..003ea4adab25 100644 --- a/crates/swc_css_parser/tests/fixture/value/url/span.swc-stderr +++ b/crates/swc_css_parser/tests/fixture/value/url/span.swc-stderr @@ -1613,7 +1613,7 @@ : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `---- - x String(StringToken { value: Atom('http://www.example.com/pinkish.gif' type=dynamic), raw: "\"http://www.example.com/pinkish.gif\"" }) + x String { value: Atom('http://www.example.com/pinkish.gif' type=dynamic), raw: "\"http://www.example.com/pinkish.gif\"" } ,-[$DIR/tests/fixture/value/url/input.css:20:1] 20 | 21 | --foo: "http://www.example.com/pinkish.gif"; diff --git a/crates/swc_css_parser/tests/fixture/vendor/csstree/basic/span.swc-stderr b/crates/swc_css_parser/tests/fixture/vendor/csstree/basic/span.swc-stderr index c9026805b806..cdd86861ef2b 100644 --- a/crates/swc_css_parser/tests/fixture/vendor/csstree/basic/span.swc-stderr +++ b/crates/swc_css_parser/tests/fixture/vendor/csstree/basic/span.swc-stderr @@ -3234,7 +3234,7 @@ 28 | --custom2: ([]) !important; `---- - x Ident(IdentToken { value: Atom('something' type=dynamic), raw: "something" }) + x Ident { value: Atom('something' type=dynamic), raw: "something" } ,-[$DIR/tests/fixture/vendor/csstree/basic/input.css:26:1] 26 | *|span:before { 27 | --custom1: { something !important }; @@ -3266,7 +3266,7 @@ 28 | --custom2: ([]) !important; `---- - x Delim(DelimToken { value: '!' }) + x Delim { value: '!' } ,-[$DIR/tests/fixture/vendor/csstree/basic/input.css:26:1] 26 | *|span:before { 27 | --custom1: { something !important }; @@ -3282,7 +3282,7 @@ 28 | --custom2: ([]) !important; `---- - x Ident(IdentToken { value: Atom('important' type=static), raw: "important" }) + x Ident { value: Atom('important' type=static), raw: "important" } ,-[$DIR/tests/fixture/vendor/csstree/basic/input.css:26:1] 26 | *|span:before { 27 | --custom1: { something !important }; diff --git a/crates/swc_css_parser/tests/fixture/vendor/esbuild/misc/6s_VBuRPHbPiUrh1fWCR_Q/span.swc-stderr b/crates/swc_css_parser/tests/fixture/vendor/esbuild/misc/6s_VBuRPHbPiUrh1fWCR_Q/span.swc-stderr index 07d0db9ffea4..cea3fa281b43 100644 --- a/crates/swc_css_parser/tests/fixture/vendor/esbuild/misc/6s_VBuRPHbPiUrh1fWCR_Q/span.swc-stderr +++ b/crates/swc_css_parser/tests/fixture/vendor/esbuild/misc/6s_VBuRPHbPiUrh1fWCR_Q/span.swc-stderr @@ -59,7 +59,7 @@ : ^^^^^^ `---- - x Ident(IdentToken { value: Atom('cl,ss' type=inline), raw: "cl\\,ss" }) + x Ident { value: Atom('cl,ss' type=inline), raw: "cl\\,ss" } ,-[$DIR/tests/fixture/vendor/esbuild/misc/6s_VBuRPHbPiUrh1fWCR_Q/input.css:1:1] 1 | :pseudo(cl\,ss) {} : ^^^^^^ diff --git a/crates/swc_css_parser/tests/fixture/vendor/esbuild/misc/L0mEf41IMkWcP7NotllkAg/span.swc-stderr b/crates/swc_css_parser/tests/fixture/vendor/esbuild/misc/L0mEf41IMkWcP7NotllkAg/span.swc-stderr index 55d66bdfce14..923e7f5c239c 100644 --- a/crates/swc_css_parser/tests/fixture/vendor/esbuild/misc/L0mEf41IMkWcP7NotllkAg/span.swc-stderr +++ b/crates/swc_css_parser/tests/fixture/vendor/esbuild/misc/L0mEf41IMkWcP7NotllkAg/span.swc-stderr @@ -76,7 +76,7 @@ 3 | c: d; `---- - x Ident(IdentToken { value: Atom('a' type=static), raw: "a" }) + x Ident { value: Atom('a' type=static), raw: "a" } ,-[$DIR/tests/fixture/vendor/esbuild/misc/L0mEf41IMkWcP7NotllkAg/input.css:1:1] 1 | @unknown{ 2 | a: b; @@ -124,7 +124,7 @@ 3 | c: d; `---- - x Ident(IdentToken { value: Atom('b' type=static), raw: "b" }) + x Ident { value: Atom('b' type=static), raw: "b" } ,-[$DIR/tests/fixture/vendor/esbuild/misc/L0mEf41IMkWcP7NotllkAg/input.css:1:1] 1 | @unknown{ 2 | a: b; @@ -174,7 +174,7 @@ 4 | } `---- - x Ident(IdentToken { value: Atom('c' type=inline), raw: "c" }) + x Ident { value: Atom('c' type=inline), raw: "c" } ,-[$DIR/tests/fixture/vendor/esbuild/misc/L0mEf41IMkWcP7NotllkAg/input.css:2:1] 2 | a: b; 3 | c: d; @@ -222,7 +222,7 @@ 4 | } `---- - x Ident(IdentToken { value: Atom('d' type=inline), raw: "d" }) + x Ident { value: Atom('d' type=inline), raw: "d" } ,-[$DIR/tests/fixture/vendor/esbuild/misc/L0mEf41IMkWcP7NotllkAg/input.css:2:1] 2 | a: b; 3 | c: d; diff --git a/crates/swc_css_parser/tests/fixture/vendor/esbuild/misc/MvD7ThpMVIxU3dzF71Gpcg/span.swc-stderr b/crates/swc_css_parser/tests/fixture/vendor/esbuild/misc/MvD7ThpMVIxU3dzF71Gpcg/span.swc-stderr index b6e5061d2d6d..26d01a091526 100644 --- a/crates/swc_css_parser/tests/fixture/vendor/esbuild/misc/MvD7ThpMVIxU3dzF71Gpcg/span.swc-stderr +++ b/crates/swc_css_parser/tests/fixture/vendor/esbuild/misc/MvD7ThpMVIxU3dzF71Gpcg/span.swc-stderr @@ -59,7 +59,7 @@ : ^ `---- - x Ident(IdentToken { value: Atom('c' type=inline), raw: "c" }) + x Ident { value: Atom('c' type=inline), raw: "c" } ,-[$DIR/tests/fixture/vendor/esbuild/misc/MvD7ThpMVIxU3dzF71Gpcg/input.css:1:1] 1 | ::b(c) {} : ^ diff --git a/crates/swc_css_parser/tests/fixture/vendor/esbuild/misc/SnMCumHJazvlgOXgmxJ9Jg/span.swc-stderr b/crates/swc_css_parser/tests/fixture/vendor/esbuild/misc/SnMCumHJazvlgOXgmxJ9Jg/span.swc-stderr index b24319721e87..6b28e66d0c76 100644 --- a/crates/swc_css_parser/tests/fixture/vendor/esbuild/misc/SnMCumHJazvlgOXgmxJ9Jg/span.swc-stderr +++ b/crates/swc_css_parser/tests/fixture/vendor/esbuild/misc/SnMCumHJazvlgOXgmxJ9Jg/span.swc-stderr @@ -47,7 +47,7 @@ : ^ `---- - x Ident(IdentToken { value: Atom('x' type=static), raw: "x" }) + x Ident { value: Atom('x' type=static), raw: "x" } ,-[$DIR/tests/fixture/vendor/esbuild/misc/SnMCumHJazvlgOXgmxJ9Jg/input.css:1:1] 1 | @unknown x; : ^ diff --git a/crates/swc_css_parser/tests/fixture/vendor/esbuild/misc/WQWdwW4B4hm60AQgxTU08Q/span.swc-stderr b/crates/swc_css_parser/tests/fixture/vendor/esbuild/misc/WQWdwW4B4hm60AQgxTU08Q/span.swc-stderr index 49a93b4b39bd..4c3fe04d1999 100644 --- a/crates/swc_css_parser/tests/fixture/vendor/esbuild/misc/WQWdwW4B4hm60AQgxTU08Q/span.swc-stderr +++ b/crates/swc_css_parser/tests/fixture/vendor/esbuild/misc/WQWdwW4B4hm60AQgxTU08Q/span.swc-stderr @@ -83,7 +83,7 @@ : ^ `---- - x Ident(IdentToken { value: Atom('c' type=inline), raw: "c" }) + x Ident { value: Atom('c' type=inline), raw: "c" } ,-[$DIR/tests/fixture/vendor/esbuild/misc/WQWdwW4B4hm60AQgxTU08Q/input.css:1:1] 1 | a::b(c) {} : ^ diff --git a/crates/swc_css_parser/tests/fixture/vendor/esbuild/misc/_d22bZcPKDgNEKSyJ2NRsQ/span.swc-stderr b/crates/swc_css_parser/tests/fixture/vendor/esbuild/misc/_d22bZcPKDgNEKSyJ2NRsQ/span.swc-stderr index 8a475cf19c10..acb74ed02cff 100644 --- a/crates/swc_css_parser/tests/fixture/vendor/esbuild/misc/_d22bZcPKDgNEKSyJ2NRsQ/span.swc-stderr +++ b/crates/swc_css_parser/tests/fixture/vendor/esbuild/misc/_d22bZcPKDgNEKSyJ2NRsQ/span.swc-stderr @@ -71,7 +71,7 @@ : ^ `---- - x Ident(IdentToken { value: Atom('c' type=inline), raw: "c" }) + x Ident { value: Atom('c' type=inline), raw: "c" } ,-[$DIR/tests/fixture/vendor/esbuild/misc/_d22bZcPKDgNEKSyJ2NRsQ/input.css:1:1] 1 | *::b(c) {} : ^ diff --git a/crates/swc_css_parser/tests/fixture/vendor/esbuild/misc/_e6qpZBWfowEh1P3Wn3orA/span.swc-stderr b/crates/swc_css_parser/tests/fixture/vendor/esbuild/misc/_e6qpZBWfowEh1P3Wn3orA/span.swc-stderr index 7beed948cadd..a205f5f47a98 100644 --- a/crates/swc_css_parser/tests/fixture/vendor/esbuild/misc/_e6qpZBWfowEh1P3Wn3orA/span.swc-stderr +++ b/crates/swc_css_parser/tests/fixture/vendor/esbuild/misc/_e6qpZBWfowEh1P3Wn3orA/span.swc-stderr @@ -59,7 +59,7 @@ : ^^^^^^^ `---- - x Ident(IdentToken { value: Atom('class' type=static), raw: "cl\\61ss" }) + x Ident { value: Atom('class' type=static), raw: "cl\\61ss" } ,-[$DIR/tests/fixture/vendor/esbuild/misc/_e6qpZBWfowEh1P3Wn3orA/input.css:1:1] 1 | :pseudo(cl\61ss) {} : ^^^^^^^ diff --git a/crates/swc_css_parser/tests/fixture/vendor/esbuild/misc/d1BWbOHfSbCE8-_qEz-luA/span.swc-stderr b/crates/swc_css_parser/tests/fixture/vendor/esbuild/misc/d1BWbOHfSbCE8-_qEz-luA/span.swc-stderr index 46fcbcbd176d..7486ce6a636c 100644 --- a/crates/swc_css_parser/tests/fixture/vendor/esbuild/misc/d1BWbOHfSbCE8-_qEz-luA/span.swc-stderr +++ b/crates/swc_css_parser/tests/fixture/vendor/esbuild/misc/d1BWbOHfSbCE8-_qEz-luA/span.swc-stderr @@ -95,7 +95,7 @@ : ^ `---- - x Ident(IdentToken { value: Atom('c' type=inline), raw: "c" }) + x Ident { value: Atom('c' type=inline), raw: "c" } ,-[$DIR/tests/fixture/vendor/esbuild/misc/d1BWbOHfSbCE8-_qEz-luA/input.css:1:1] 1 | a:b(:c) {} : ^ diff --git a/crates/swc_css_parser/tests/fixture/vendor/esbuild/misc/pLQn9swtbpZ-CVZMGw0EwA/span.swc-stderr b/crates/swc_css_parser/tests/fixture/vendor/esbuild/misc/pLQn9swtbpZ-CVZMGw0EwA/span.swc-stderr index a9da74256b2c..696ddae7369b 100644 --- a/crates/swc_css_parser/tests/fixture/vendor/esbuild/misc/pLQn9swtbpZ-CVZMGw0EwA/span.swc-stderr +++ b/crates/swc_css_parser/tests/fixture/vendor/esbuild/misc/pLQn9swtbpZ-CVZMGw0EwA/span.swc-stderr @@ -59,7 +59,7 @@ : ^^^^^^^ `---- - x Ident(IdentToken { value: Atom('cl,ss' type=inline), raw: "cl\\2css" }) + x Ident { value: Atom('cl,ss' type=inline), raw: "cl\\2css" } ,-[$DIR/tests/fixture/vendor/esbuild/misc/pLQn9swtbpZ-CVZMGw0EwA/input.css:1:1] 1 | :pseudo(cl\2css) {} : ^^^^^^^ diff --git a/crates/swc_css_parser/tests/fixture/vendor/rome/custom-properties/span.swc-stderr b/crates/swc_css_parser/tests/fixture/vendor/rome/custom-properties/span.swc-stderr index 21d6c4fe80b9..8d197e5f7634 100644 --- a/crates/swc_css_parser/tests/fixture/vendor/rome/custom-properties/span.swc-stderr +++ b/crates/swc_css_parser/tests/fixture/vendor/rome/custom-properties/span.swc-stderr @@ -204,7 +204,7 @@ 3 | --lore-ipsum: "foo"; `---- - x String(StringToken { value: Atom('bar' type=inline), raw: "'bar'" }) + x String { value: Atom('bar' type=inline), raw: "'bar'" } ,-[$DIR/tests/fixture/vendor/rome/custom-properties/input.css:1:1] 1 | .style { 2 | --foo: 'bar'; @@ -260,7 +260,7 @@ 4 | --FANCY: "abort"; `---- - x String(StringToken { value: Atom('foo' type=inline), raw: "\"foo\"" }) + x String { value: Atom('foo' type=inline), raw: "\"foo\"" } ,-[$DIR/tests/fixture/vendor/rome/custom-properties/input.css:2:1] 2 | --foo: 'bar'; 3 | --lore-ipsum: "foo"; @@ -316,7 +316,7 @@ 5 | --test: 1987; `---- - x String(StringToken { value: Atom('abort' type=inline), raw: "\"abort\"" }) + x String { value: Atom('abort' type=inline), raw: "\"abort\"" } ,-[$DIR/tests/fixture/vendor/rome/custom-properties/input.css:3:1] 3 | --lore-ipsum: "foo"; 4 | --FANCY: "abort"; @@ -372,7 +372,7 @@ 6 | --percentage: 25%; `---- - x Number(NumberToken { value: 1987.0, raw: "1987", type_flag: Integer }) + x Number { value: 1987.0, raw: "1987", type_flag: Integer } ,-[$DIR/tests/fixture/vendor/rome/custom-properties/input.css:4:1] 4 | --FANCY: "abort"; 5 | --test: 1987; @@ -428,7 +428,7 @@ 7 | --number: 37; `---- - x Percentage(PercentageToken { value: 25.0, raw: "25" }) + x Percentage { value: 25.0, raw: "25" } ,-[$DIR/tests/fixture/vendor/rome/custom-properties/input.css:5:1] 5 | --test: 1987; 6 | --percentage: 25%; @@ -484,7 +484,7 @@ 8 | --length: 12em; `---- - x Number(NumberToken { value: 37.0, raw: "37", type_flag: Integer }) + x Number { value: 37.0, raw: "37", type_flag: Integer } ,-[$DIR/tests/fixture/vendor/rome/custom-properties/input.css:6:1] 6 | --percentage: 25%; 7 | --number: 37; @@ -1044,7 +1044,7 @@ 16 | --at-keyword-known: @media; `---- - x AtKeyword(AtKeywordToken { value: Atom('foobar' type=inline), raw: "foobar" }) + x AtKeyword { value: Atom('foobar' type=inline), raw: "foobar" } ,-[$DIR/tests/fixture/vendor/rome/custom-properties/input.css:14:1] 14 | --brackets: [ ]; 15 | --at-keyword-unknown: @foobar; @@ -1100,7 +1100,7 @@ 17 | --at-keyword-unknown-block: @foobar {}; `---- - x AtKeyword(AtKeywordToken { value: Atom('media' type=static), raw: "media" }) + x AtKeyword { value: Atom('media' type=static), raw: "media" } ,-[$DIR/tests/fixture/vendor/rome/custom-properties/input.css:15:1] 15 | --at-keyword-unknown: @foobar; 16 | --at-keyword-known: @media; @@ -1156,7 +1156,7 @@ 18 | --at-keyword-known-block: @media {}; `---- - x AtKeyword(AtKeywordToken { value: Atom('foobar' type=inline), raw: "foobar" }) + x AtKeyword { value: Atom('foobar' type=inline), raw: "foobar" } ,-[$DIR/tests/fixture/vendor/rome/custom-properties/input.css:16:1] 16 | --at-keyword-known: @media; 17 | --at-keyword-unknown-block: @foobar {}; @@ -1252,7 +1252,7 @@ 19 | --cdo-at-top-level: : ^^^ @@ -135,7 +135,7 @@ 4 | color: red; `---- - x Ident(IdentToken { value: Atom('div' type=static), raw: "div" }) + x Ident { value: Atom('div' type=static), raw: "div" } ,-[$DIR/tests/recovery/cdo-and-cdc/input.css:2:1] 2 | 3 | div { @@ -295,7 +295,7 @@ : ^^^^ `---- - x Ident(IdentToken { value: Atom('test' type=inline), raw: "test" }) + x Ident { value: Atom('test' type=inline), raw: "test" } ,-[$DIR/tests/recovery/cdo-and-cdc/input.css:6:1] 6 | 7 | test @@ -580,7 +580,7 @@ : ^^^^ `---- - x Ident(IdentToken { value: Atom('test' type=inline), raw: "test" }) + x Ident { value: Atom('test' type=inline), raw: "test" } ,-[$DIR/tests/recovery/cdo-and-cdc/input.css:15:1] 15 | 16 | test @@ -643,7 +643,7 @@ 21 | } `---- - x Ident(IdentToken { value: Atom('color' type=static), raw: "color" }) + x Ident { value: Atom('color' type=static), raw: "color" } ,-[$DIR/tests/recovery/cdo-and-cdc/input.css:19:1] 19 | 20 | color: blue; @@ -691,7 +691,7 @@ 21 | } `---- - x Ident(IdentToken { value: Atom('blue' type=inline), raw: "blue" }) + x Ident { value: Atom('blue' type=inline), raw: "blue" } ,-[$DIR/tests/recovery/cdo-and-cdc/input.css:19:1] 19 | 20 | color: blue; @@ -937,7 +937,7 @@ : ^^^^ `---- - x Ident(IdentToken { value: Atom('test' type=inline), raw: "test" }) + x Ident { value: Atom('test' type=inline), raw: "test" } ,-[$DIR/tests/recovery/cdo-and-cdc/input.css:26:1] 26 | 27 | test @@ -1205,7 +1205,7 @@ 36 | color: red; `---- - x Delim(DelimToken { value: '.' }) + x Delim { value: '.' } ,-[$DIR/tests/recovery/cdo-and-cdc/input.css:34:1] 34 | a { 35 | 42 | 50% { left: 0; } diff --git a/crates/swc_css_parser/tests/recovery/comments/bad-comment-1/span.swc-stderr b/crates/swc_css_parser/tests/recovery/comments/bad-comment-1/span.swc-stderr index 1d21d91bd920..052ad78b351c 100644 --- a/crates/swc_css_parser/tests/recovery/comments/bad-comment-1/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/comments/bad-comment-1/span.swc-stderr @@ -17,7 +17,7 @@ : ^ `---- - x Delim(DelimToken { value: '/' }) + x Delim { value: '/' } ,-[$DIR/tests/recovery/comments/bad-comment-1/input.css:1:1] 1 | // comment : ^ @@ -29,7 +29,7 @@ : ^ `---- - x Delim(DelimToken { value: '/' }) + x Delim { value: '/' } ,-[$DIR/tests/recovery/comments/bad-comment-1/input.css:1:1] 1 | // comment : ^ @@ -53,7 +53,7 @@ : ^^^^^^^ `---- - x Ident(IdentToken { value: Atom('comment' type=inline), raw: "comment" }) + x Ident { value: Atom('comment' type=inline), raw: "comment" } ,-[$DIR/tests/recovery/comments/bad-comment-1/input.css:1:1] 1 | // comment : ^^^^^^^ diff --git a/crates/swc_css_parser/tests/recovery/comments/declaration/span.swc-stderr b/crates/swc_css_parser/tests/recovery/comments/declaration/span.swc-stderr index 55bcffbe754f..54035356b409 100644 --- a/crates/swc_css_parser/tests/recovery/comments/declaration/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/comments/declaration/span.swc-stderr @@ -159,7 +159,7 @@ 3 | /* comment */: `---- - x String(StringToken { value: Atom('test' type=inline), raw: "\"test\"" }) + x String { value: Atom('test' type=inline), raw: "\"test\"" } ,-[$DIR/tests/recovery/comments/declaration/input.css:1:1] 1 | a { 2 | prop: url("test") /* comment */ /* comment */ diff --git a/crates/swc_css_parser/tests/recovery/declaration/bad-value/span.swc-stderr b/crates/swc_css_parser/tests/recovery/declaration/bad-value/span.swc-stderr index c269fda3b4fc..15e5f454ac22 100644 --- a/crates/swc_css_parser/tests/recovery/declaration/bad-value/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/declaration/bad-value/span.swc-stderr @@ -287,7 +287,7 @@ 5 | --foo: !; `---- - x BadUrl(BadUrlToken { raw: ("url", "test test") }) + x BadUrl { raw: ("url", "test test") } ,-[$DIR/tests/recovery/declaration/bad-value/input.css:3:1] 3 | value: ]; 4 | value: url(test test); @@ -343,7 +343,7 @@ 6 | --foo: ); `---- - x Delim(DelimToken { value: '!' }) + x Delim { value: '!' } ,-[$DIR/tests/recovery/declaration/bad-value/input.css:4:1] 4 | value: url(test test); 5 | --foo: !; @@ -511,7 +511,7 @@ 9 | value: !!; `---- - x Delim(DelimToken { value: '!' }) + x Delim { value: '!' } ,-[$DIR/tests/recovery/declaration/bad-value/input.css:7:1] 7 | --foo: ]; 8 | --foo: !; @@ -567,7 +567,7 @@ 10 | value: ! !important; `---- - x Delim(DelimToken { value: '!' }) + x Delim { value: '!' } ,-[$DIR/tests/recovery/declaration/bad-value/input.css:8:1] 8 | --foo: !; 9 | value: !!; @@ -583,7 +583,7 @@ 10 | value: ! !important; `---- - x Delim(DelimToken { value: '!' }) + x Delim { value: '!' } ,-[$DIR/tests/recovery/declaration/bad-value/input.css:8:1] 8 | --foo: !; 9 | value: !!; @@ -639,7 +639,7 @@ 11 | value: ! !important unknown; `---- - x Delim(DelimToken { value: '!' }) + x Delim { value: '!' } ,-[$DIR/tests/recovery/declaration/bad-value/input.css:9:1] 9 | value: !!; 10 | value: ! !important; @@ -727,7 +727,7 @@ 12 | value: ! unknown; `---- - x Delim(DelimToken { value: '!' }) + x Delim { value: '!' } ,-[$DIR/tests/recovery/declaration/bad-value/input.css:10:1] 10 | value: ! !important; 11 | value: ! !important unknown; @@ -759,7 +759,7 @@ 12 | value: ! unknown; `---- - x Delim(DelimToken { value: '!' }) + x Delim { value: '!' } ,-[$DIR/tests/recovery/declaration/bad-value/input.css:10:1] 10 | value: ! !important; 11 | value: ! !important unknown; @@ -775,7 +775,7 @@ 12 | value: ! unknown; `---- - x Ident(IdentToken { value: Atom('important' type=static), raw: "important" }) + x Ident { value: Atom('important' type=static), raw: "important" } ,-[$DIR/tests/recovery/declaration/bad-value/input.css:10:1] 10 | value: ! !important; 11 | value: ! !important unknown; @@ -807,7 +807,7 @@ 12 | value: ! unknown; `---- - x Ident(IdentToken { value: Atom('unknown' type=static), raw: "unknown" }) + x Ident { value: Atom('unknown' type=static), raw: "unknown" } ,-[$DIR/tests/recovery/declaration/bad-value/input.css:10:1] 10 | value: ! !important; 11 | value: ! !important unknown; @@ -863,7 +863,7 @@ 13 | value: ! ! !; `---- - x Delim(DelimToken { value: '!' }) + x Delim { value: '!' } ,-[$DIR/tests/recovery/declaration/bad-value/input.css:11:1] 11 | value: ! !important unknown; 12 | value: ! unknown; @@ -895,7 +895,7 @@ 13 | value: ! ! !; `---- - x Ident(IdentToken { value: Atom('unknown' type=static), raw: "unknown" }) + x Ident { value: Atom('unknown' type=static), raw: "unknown" } ,-[$DIR/tests/recovery/declaration/bad-value/input.css:11:1] 11 | value: ! !important unknown; 12 | value: ! unknown; @@ -951,7 +951,7 @@ 14 | } `---- - x Delim(DelimToken { value: '!' }) + x Delim { value: '!' } ,-[$DIR/tests/recovery/declaration/bad-value/input.css:12:1] 12 | value: ! unknown; 13 | value: ! ! !; @@ -983,7 +983,7 @@ 14 | } `---- - x Delim(DelimToken { value: '!' }) + x Delim { value: '!' } ,-[$DIR/tests/recovery/declaration/bad-value/input.css:12:1] 12 | value: ! unknown; 13 | value: ! ! !; @@ -1015,7 +1015,7 @@ 14 | } `---- - x Delim(DelimToken { value: '!' }) + x Delim { value: '!' } ,-[$DIR/tests/recovery/declaration/bad-value/input.css:12:1] 12 | value: ! unknown; 13 | value: ! ! !; diff --git a/crates/swc_css_parser/tests/recovery/declaration/basic/span.swc-stderr b/crates/swc_css_parser/tests/recovery/declaration/basic/span.swc-stderr index 59eecb104e32..73f9651b93ac 100644 --- a/crates/swc_css_parser/tests/recovery/declaration/basic/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/declaration/basic/span.swc-stderr @@ -317,7 +317,7 @@ 8 | color: red; `---- - x Delim(DelimToken { value: '!' }) + x Delim { value: '!' } ,-[$DIR/tests/recovery/declaration/basic/input.css:6:1] 6 | .class { 7 | prop: !!; @@ -333,7 +333,7 @@ 8 | color: red; `---- - x Delim(DelimToken { value: '!' }) + x Delim { value: '!' } ,-[$DIR/tests/recovery/declaration/basic/input.css:6:1] 6 | .class { 7 | prop: !!; @@ -512,7 +512,7 @@ 13 | color: red; `---- - x Ident(IdentToken { value: Atom('test' type=inline), raw: "test" }) + x Ident { value: Atom('test' type=inline), raw: "test" } ,-[$DIR/tests/recovery/declaration/basic/input.css:11:1] 11 | a { 12 | test; diff --git a/crates/swc_css_parser/tests/recovery/declaration/important-1/span.swc-stderr b/crates/swc_css_parser/tests/recovery/declaration/important-1/span.swc-stderr index 0f40dc403d6b..5ec7ae64149b 100644 --- a/crates/swc_css_parser/tests/recovery/declaration/important-1/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/declaration/important-1/span.swc-stderr @@ -131,7 +131,7 @@ 3 | } `---- - x Ident(IdentToken { value: Atom('red' type=inline), raw: "red" }) + x Ident { value: Atom('red' type=inline), raw: "red" } ,-[$DIR/tests/recovery/declaration/important-1/input.css:1:1] 1 | a { 2 | color: red !importan; @@ -163,7 +163,7 @@ 3 | } `---- - x Delim(DelimToken { value: '!' }) + x Delim { value: '!' } ,-[$DIR/tests/recovery/declaration/important-1/input.css:1:1] 1 | a { 2 | color: red !importan; @@ -179,7 +179,7 @@ 3 | } `---- - x Ident(IdentToken { value: Atom('importan' type=dynamic), raw: "importan" }) + x Ident { value: Atom('importan' type=dynamic), raw: "importan" } ,-[$DIR/tests/recovery/declaration/important-1/input.css:1:1] 1 | a { 2 | color: red !importan; diff --git a/crates/swc_css_parser/tests/recovery/declaration/important/span.swc-stderr b/crates/swc_css_parser/tests/recovery/declaration/important/span.swc-stderr index 158b669d4af0..1ce40ab94d45 100644 --- a/crates/swc_css_parser/tests/recovery/declaration/important/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/declaration/important/span.swc-stderr @@ -144,7 +144,7 @@ 3 | } `---- - x Ident(IdentToken { value: Atom('white' type=inline), raw: "white" }) + x Ident { value: Atom('white' type=inline), raw: "white" } ,-[$DIR/tests/recovery/declaration/important/input.css:1:1] 1 | .a { 2 | color: white !!important; @@ -176,7 +176,7 @@ 3 | } `---- - x Delim(DelimToken { value: '!' }) + x Delim { value: '!' } ,-[$DIR/tests/recovery/declaration/important/input.css:1:1] 1 | .a { 2 | color: white !!important; @@ -328,7 +328,7 @@ 7 | } `---- - x Ident(IdentToken { value: Atom('red' type=inline), raw: "red" }) + x Ident { value: Atom('red' type=inline), raw: "red" } ,-[$DIR/tests/recovery/declaration/important/input.css:5:1] 5 | .class { 6 | color: red red red !important !important; @@ -360,7 +360,7 @@ 7 | } `---- - x Ident(IdentToken { value: Atom('red' type=inline), raw: "red" }) + x Ident { value: Atom('red' type=inline), raw: "red" } ,-[$DIR/tests/recovery/declaration/important/input.css:5:1] 5 | .class { 6 | color: red red red !important !important; @@ -392,7 +392,7 @@ 7 | } `---- - x Ident(IdentToken { value: Atom('red' type=inline), raw: "red" }) + x Ident { value: Atom('red' type=inline), raw: "red" } ,-[$DIR/tests/recovery/declaration/important/input.css:5:1] 5 | .class { 6 | color: red red red !important !important; @@ -424,7 +424,7 @@ 7 | } `---- - x Delim(DelimToken { value: '!' }) + x Delim { value: '!' } ,-[$DIR/tests/recovery/declaration/important/input.css:5:1] 5 | .class { 6 | color: red red red !important !important; @@ -440,7 +440,7 @@ 7 | } `---- - x Ident(IdentToken { value: Atom('important' type=static), raw: "important" }) + x Ident { value: Atom('important' type=static), raw: "important" } ,-[$DIR/tests/recovery/declaration/important/input.css:5:1] 5 | .class { 6 | color: red red red !important !important; @@ -592,7 +592,7 @@ 11 | } `---- - x Ident(IdentToken { value: Atom('red' type=inline), raw: "red" }) + x Ident { value: Atom('red' type=inline), raw: "red" } ,-[$DIR/tests/recovery/declaration/important/input.css:9:1] 9 | .class { 10 | color: red red red !important!important ; @@ -624,7 +624,7 @@ 11 | } `---- - x Ident(IdentToken { value: Atom('red' type=inline), raw: "red" }) + x Ident { value: Atom('red' type=inline), raw: "red" } ,-[$DIR/tests/recovery/declaration/important/input.css:9:1] 9 | .class { 10 | color: red red red !important!important ; @@ -656,7 +656,7 @@ 11 | } `---- - x Ident(IdentToken { value: Atom('red' type=inline), raw: "red" }) + x Ident { value: Atom('red' type=inline), raw: "red" } ,-[$DIR/tests/recovery/declaration/important/input.css:9:1] 9 | .class { 10 | color: red red red !important!important ; @@ -688,7 +688,7 @@ 11 | } `---- - x Delim(DelimToken { value: '!' }) + x Delim { value: '!' } ,-[$DIR/tests/recovery/declaration/important/input.css:9:1] 9 | .class { 10 | color: red red red !important!important ; @@ -704,7 +704,7 @@ 11 | } `---- - x Ident(IdentToken { value: Atom('important' type=static), raw: "important" }) + x Ident { value: Atom('important' type=static), raw: "important" } ,-[$DIR/tests/recovery/declaration/important/input.css:9:1] 9 | .class { 10 | color: red red red !important!important ; @@ -856,7 +856,7 @@ 15 | } `---- - x Ident(IdentToken { value: Atom('red' type=inline), raw: "red" }) + x Ident { value: Atom('red' type=inline), raw: "red" } ,-[$DIR/tests/recovery/declaration/important/input.css:13:1] 13 | .class { 14 | color: red red red /* test*/ !important /*test*/ !important /*test*/ ; @@ -888,7 +888,7 @@ 15 | } `---- - x Ident(IdentToken { value: Atom('red' type=inline), raw: "red" }) + x Ident { value: Atom('red' type=inline), raw: "red" } ,-[$DIR/tests/recovery/declaration/important/input.css:13:1] 13 | .class { 14 | color: red red red /* test*/ !important /*test*/ !important /*test*/ ; @@ -920,7 +920,7 @@ 15 | } `---- - x Ident(IdentToken { value: Atom('red' type=inline), raw: "red" }) + x Ident { value: Atom('red' type=inline), raw: "red" } ,-[$DIR/tests/recovery/declaration/important/input.css:13:1] 13 | .class { 14 | color: red red red /* test*/ !important /*test*/ !important /*test*/ ; @@ -968,7 +968,7 @@ 15 | } `---- - x Delim(DelimToken { value: '!' }) + x Delim { value: '!' } ,-[$DIR/tests/recovery/declaration/important/input.css:13:1] 13 | .class { 14 | color: red red red /* test*/ !important /*test*/ !important /*test*/ ; @@ -984,7 +984,7 @@ 15 | } `---- - x Ident(IdentToken { value: Atom('important' type=static), raw: "important" }) + x Ident { value: Atom('important' type=static), raw: "important" } ,-[$DIR/tests/recovery/declaration/important/input.css:13:1] 13 | .class { 14 | color: red red red /* test*/ !important /*test*/ !important /*test*/ ; @@ -1136,7 +1136,7 @@ 19 | } `---- - x Ident(IdentToken { value: Atom('red' type=inline), raw: "red" }) + x Ident { value: Atom('red' type=inline), raw: "red" } ,-[$DIR/tests/recovery/declaration/important/input.css:17:1] 17 | .class { 18 | color: red red red !important !important!important; @@ -1168,7 +1168,7 @@ 19 | } `---- - x Ident(IdentToken { value: Atom('red' type=inline), raw: "red" }) + x Ident { value: Atom('red' type=inline), raw: "red" } ,-[$DIR/tests/recovery/declaration/important/input.css:17:1] 17 | .class { 18 | color: red red red !important !important!important; @@ -1200,7 +1200,7 @@ 19 | } `---- - x Ident(IdentToken { value: Atom('red' type=inline), raw: "red" }) + x Ident { value: Atom('red' type=inline), raw: "red" } ,-[$DIR/tests/recovery/declaration/important/input.css:17:1] 17 | .class { 18 | color: red red red !important !important!important; @@ -1232,7 +1232,7 @@ 19 | } `---- - x Delim(DelimToken { value: '!' }) + x Delim { value: '!' } ,-[$DIR/tests/recovery/declaration/important/input.css:17:1] 17 | .class { 18 | color: red red red !important !important!important; @@ -1248,7 +1248,7 @@ 19 | } `---- - x Ident(IdentToken { value: Atom('important' type=static), raw: "important" }) + x Ident { value: Atom('important' type=static), raw: "important" } ,-[$DIR/tests/recovery/declaration/important/input.css:17:1] 17 | .class { 18 | color: red red red !important !important!important; @@ -1280,7 +1280,7 @@ 19 | } `---- - x Delim(DelimToken { value: '!' }) + x Delim { value: '!' } ,-[$DIR/tests/recovery/declaration/important/input.css:17:1] 17 | .class { 18 | color: red red red !important !important!important; @@ -1296,7 +1296,7 @@ 19 | } `---- - x Ident(IdentToken { value: Atom('important' type=static), raw: "important" }) + x Ident { value: Atom('important' type=static), raw: "important" } ,-[$DIR/tests/recovery/declaration/important/input.css:17:1] 17 | .class { 18 | color: red red red !important !important!important; @@ -1448,7 +1448,7 @@ 23 | } `---- - x Ident(IdentToken { value: Atom('red' type=inline), raw: "red" }) + x Ident { value: Atom('red' type=inline), raw: "red" } ,-[$DIR/tests/recovery/declaration/important/input.css:21:1] 21 | .class { 22 | color: red red red /* test */ ! /*test */ important /* test */ ! /* test */ important /* test */; @@ -1480,7 +1480,7 @@ 23 | } `---- - x Ident(IdentToken { value: Atom('red' type=inline), raw: "red" }) + x Ident { value: Atom('red' type=inline), raw: "red" } ,-[$DIR/tests/recovery/declaration/important/input.css:21:1] 21 | .class { 22 | color: red red red /* test */ ! /*test */ important /* test */ ! /* test */ important /* test */; @@ -1512,7 +1512,7 @@ 23 | } `---- - x Ident(IdentToken { value: Atom('red' type=inline), raw: "red" }) + x Ident { value: Atom('red' type=inline), raw: "red" } ,-[$DIR/tests/recovery/declaration/important/input.css:21:1] 21 | .class { 22 | color: red red red /* test */ ! /*test */ important /* test */ ! /* test */ important /* test */; @@ -1560,7 +1560,7 @@ 23 | } `---- - x Delim(DelimToken { value: '!' }) + x Delim { value: '!' } ,-[$DIR/tests/recovery/declaration/important/input.css:21:1] 21 | .class { 22 | color: red red red /* test */ ! /*test */ important /* test */ ! /* test */ important /* test */; @@ -1608,7 +1608,7 @@ 23 | } `---- - x Ident(IdentToken { value: Atom('important' type=static), raw: "important" }) + x Ident { value: Atom('important' type=static), raw: "important" } ,-[$DIR/tests/recovery/declaration/important/input.css:21:1] 21 | .class { 22 | color: red red red /* test */ ! /*test */ important /* test */ ! /* test */ important /* test */; diff --git a/crates/swc_css_parser/tests/recovery/declaration/wrong-name/span.swc-stderr b/crates/swc_css_parser/tests/recovery/declaration/wrong-name/span.swc-stderr index 5a82152a10c2..7cc2ce7c63d2 100644 --- a/crates/swc_css_parser/tests/recovery/declaration/wrong-name/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/declaration/wrong-name/span.swc-stderr @@ -107,7 +107,7 @@ 3 | } `---- - x Number(NumberToken { value: 20.0, raw: "20", type_flag: Integer }) + x Number { value: 20.0, raw: "20", type_flag: Integer } ,-[$DIR/tests/recovery/declaration/wrong-name/input.css:1:1] 1 | a { 2 | 20: red; @@ -155,7 +155,7 @@ 3 | } `---- - x Ident(IdentToken { value: Atom('red' type=inline), raw: "red" }) + x Ident { value: Atom('red' type=inline), raw: "red" } ,-[$DIR/tests/recovery/declaration/wrong-name/input.css:1:1] 1 | a { 2 | 20: red; diff --git a/crates/swc_css_parser/tests/recovery/delim-token/ampersand/span.swc-stderr b/crates/swc_css_parser/tests/recovery/delim-token/ampersand/span.swc-stderr index 201737098d4f..fb4ac21a02ab 100644 --- a/crates/swc_css_parser/tests/recovery/delim-token/ampersand/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/delim-token/ampersand/span.swc-stderr @@ -131,7 +131,7 @@ 3 | } `---- - x Delim(DelimToken { value: '&' }) + x Delim { value: '&' } ,-[$DIR/tests/recovery/delim-token/ampersand/input.css:1:1] 1 | a { 2 | prop: &; diff --git a/crates/swc_css_parser/tests/recovery/delim-token/asterisk/span.swc-stderr b/crates/swc_css_parser/tests/recovery/delim-token/asterisk/span.swc-stderr index fdb02ded2550..618b61893932 100644 --- a/crates/swc_css_parser/tests/recovery/delim-token/asterisk/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/delim-token/asterisk/span.swc-stderr @@ -131,7 +131,7 @@ 3 | } `---- - x Delim(DelimToken { value: '*' }) + x Delim { value: '*' } ,-[$DIR/tests/recovery/delim-token/asterisk/input.css:1:1] 1 | a { 2 | color: *; diff --git a/crates/swc_css_parser/tests/recovery/delim-token/at-sign/span.swc-stderr b/crates/swc_css_parser/tests/recovery/delim-token/at-sign/span.swc-stderr index bb6f8418b825..cc2ebaf35761 100644 --- a/crates/swc_css_parser/tests/recovery/delim-token/at-sign/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/delim-token/at-sign/span.swc-stderr @@ -131,7 +131,7 @@ 3 | } `---- - x Delim(DelimToken { value: '@' }) + x Delim { value: '@' } ,-[$DIR/tests/recovery/delim-token/at-sign/input.css:1:1] 1 | a { 2 | color: @ red; @@ -163,7 +163,7 @@ 3 | } `---- - x Ident(IdentToken { value: Atom('red' type=inline), raw: "red" }) + x Ident { value: Atom('red' type=inline), raw: "red" } ,-[$DIR/tests/recovery/delim-token/at-sign/input.css:1:1] 1 | a { 2 | color: @ red; diff --git a/crates/swc_css_parser/tests/recovery/delim-token/bang/span.swc-stderr b/crates/swc_css_parser/tests/recovery/delim-token/bang/span.swc-stderr index ba625523e41c..dd87acd69774 100644 --- a/crates/swc_css_parser/tests/recovery/delim-token/bang/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/delim-token/bang/span.swc-stderr @@ -131,7 +131,7 @@ 3 | } `---- - x Delim(DelimToken { value: '!' }) + x Delim { value: '!' } ,-[$DIR/tests/recovery/delim-token/bang/input.css:1:1] 1 | a { 2 | color: !!; @@ -147,7 +147,7 @@ 3 | } `---- - x Delim(DelimToken { value: '!' }) + x Delim { value: '!' } ,-[$DIR/tests/recovery/delim-token/bang/input.css:1:1] 1 | a { 2 | color: !!; diff --git a/crates/swc_css_parser/tests/recovery/delim-token/bar/span.swc-stderr b/crates/swc_css_parser/tests/recovery/delim-token/bar/span.swc-stderr index b3ff5dcc2721..464a92d69c3e 100644 --- a/crates/swc_css_parser/tests/recovery/delim-token/bar/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/delim-token/bar/span.swc-stderr @@ -131,7 +131,7 @@ 3 | } `---- - x Delim(DelimToken { value: '|' }) + x Delim { value: '|' } ,-[$DIR/tests/recovery/delim-token/bar/input.css:1:1] 1 | a { 2 | prop: |; diff --git a/crates/swc_css_parser/tests/recovery/delim-token/caret/span.swc-stderr b/crates/swc_css_parser/tests/recovery/delim-token/caret/span.swc-stderr index 8e02a47ca80b..fe69f57b614a 100644 --- a/crates/swc_css_parser/tests/recovery/delim-token/caret/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/delim-token/caret/span.swc-stderr @@ -131,7 +131,7 @@ 3 | } `---- - x Delim(DelimToken { value: '^' }) + x Delim { value: '^' } ,-[$DIR/tests/recovery/delim-token/caret/input.css:1:1] 1 | a { 2 | prop: ^; diff --git a/crates/swc_css_parser/tests/recovery/delim-token/dollar/span.swc-stderr b/crates/swc_css_parser/tests/recovery/delim-token/dollar/span.swc-stderr index 793b460a49bc..4ee4fd64d7d1 100644 --- a/crates/swc_css_parser/tests/recovery/delim-token/dollar/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/delim-token/dollar/span.swc-stderr @@ -131,7 +131,7 @@ 3 | } `---- - x Delim(DelimToken { value: '$' }) + x Delim { value: '$' } ,-[$DIR/tests/recovery/delim-token/dollar/input.css:1:1] 1 | a { 2 | prop: $; diff --git a/crates/swc_css_parser/tests/recovery/delim-token/equals/span.swc-stderr b/crates/swc_css_parser/tests/recovery/delim-token/equals/span.swc-stderr index 6834e1df94c7..5ab8158b2ea6 100644 --- a/crates/swc_css_parser/tests/recovery/delim-token/equals/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/delim-token/equals/span.swc-stderr @@ -131,7 +131,7 @@ 3 | } `---- - x Delim(DelimToken { value: '=' }) + x Delim { value: '=' } ,-[$DIR/tests/recovery/delim-token/equals/input.css:1:1] 1 | a { 2 | prop: =; diff --git a/crates/swc_css_parser/tests/recovery/delim-token/greater-than/span.swc-stderr b/crates/swc_css_parser/tests/recovery/delim-token/greater-than/span.swc-stderr index da944c8d1a51..d70137631af2 100644 --- a/crates/swc_css_parser/tests/recovery/delim-token/greater-than/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/delim-token/greater-than/span.swc-stderr @@ -131,7 +131,7 @@ 3 | } `---- - x Delim(DelimToken { value: '>' }) + x Delim { value: '>' } ,-[$DIR/tests/recovery/delim-token/greater-than/input.css:1:1] 1 | a { 2 | prop: >; diff --git a/crates/swc_css_parser/tests/recovery/delim-token/hash/span.swc-stderr b/crates/swc_css_parser/tests/recovery/delim-token/hash/span.swc-stderr index 9ae82e2b4f31..42806ac3b77a 100644 --- a/crates/swc_css_parser/tests/recovery/delim-token/hash/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/delim-token/hash/span.swc-stderr @@ -131,7 +131,7 @@ 3 | } `---- - x Delim(DelimToken { value: '#' }) + x Delim { value: '#' } ,-[$DIR/tests/recovery/delim-token/hash/input.css:1:1] 1 | a { 2 | color: ##; @@ -147,7 +147,7 @@ 3 | } `---- - x Delim(DelimToken { value: '#' }) + x Delim { value: '#' } ,-[$DIR/tests/recovery/delim-token/hash/input.css:1:1] 1 | a { 2 | color: ##; diff --git a/crates/swc_css_parser/tests/recovery/delim-token/less-than/span.swc-stderr b/crates/swc_css_parser/tests/recovery/delim-token/less-than/span.swc-stderr index 38c3e0fee41c..37cdc7d91423 100644 --- a/crates/swc_css_parser/tests/recovery/delim-token/less-than/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/delim-token/less-than/span.swc-stderr @@ -131,7 +131,7 @@ 3 | } `---- - x Delim(DelimToken { value: '<' }) + x Delim { value: '<' } ,-[$DIR/tests/recovery/delim-token/less-than/input.css:1:1] 1 | a { 2 | color: <; diff --git a/crates/swc_css_parser/tests/recovery/delim-token/minus/span.swc-stderr b/crates/swc_css_parser/tests/recovery/delim-token/minus/span.swc-stderr index 0095f9334fca..48a4895ff447 100644 --- a/crates/swc_css_parser/tests/recovery/delim-token/minus/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/delim-token/minus/span.swc-stderr @@ -139,7 +139,7 @@ 3 | prop1: 1 - 2; `---- - x Delim(DelimToken { value: '-' }) + x Delim { value: '-' } ,-[$DIR/tests/recovery/delim-token/minus/input.css:1:1] 1 | a { 2 | prop: -; @@ -195,7 +195,7 @@ 4 | prop2: func(1 - 2); `---- - x Number(NumberToken { value: 1.0, raw: "1", type_flag: Integer }) + x Number { value: 1.0, raw: "1", type_flag: Integer } ,-[$DIR/tests/recovery/delim-token/minus/input.css:2:1] 2 | prop: -; 3 | prop1: 1 - 2; @@ -227,7 +227,7 @@ 4 | prop2: func(1 - 2); `---- - x Delim(DelimToken { value: '-' }) + x Delim { value: '-' } ,-[$DIR/tests/recovery/delim-token/minus/input.css:2:1] 2 | prop: -; 3 | prop1: 1 - 2; @@ -259,7 +259,7 @@ 4 | prop2: func(1 - 2); `---- - x Number(NumberToken { value: 2.0, raw: "2", type_flag: Integer }) + x Number { value: 2.0, raw: "2", type_flag: Integer } ,-[$DIR/tests/recovery/delim-token/minus/input.css:2:1] 2 | prop: -; 3 | prop1: 1 - 2; @@ -339,7 +339,7 @@ 5 | } `---- - x Number(NumberToken { value: 1.0, raw: "1", type_flag: Integer }) + x Number { value: 1.0, raw: "1", type_flag: Integer } ,-[$DIR/tests/recovery/delim-token/minus/input.css:3:1] 3 | prop1: 1 - 2; 4 | prop2: func(1 - 2); @@ -371,7 +371,7 @@ 5 | } `---- - x Delim(DelimToken { value: '-' }) + x Delim { value: '-' } ,-[$DIR/tests/recovery/delim-token/minus/input.css:3:1] 3 | prop1: 1 - 2; 4 | prop2: func(1 - 2); @@ -403,7 +403,7 @@ 5 | } `---- - x Number(NumberToken { value: 2.0, raw: "2", type_flag: Integer }) + x Number { value: 2.0, raw: "2", type_flag: Integer } ,-[$DIR/tests/recovery/delim-token/minus/input.css:3:1] 3 | prop1: 1 - 2; 4 | prop2: func(1 - 2); diff --git a/crates/swc_css_parser/tests/recovery/delim-token/percent/span.swc-stderr b/crates/swc_css_parser/tests/recovery/delim-token/percent/span.swc-stderr index 463818a88432..1a9a3b0a9d5e 100644 --- a/crates/swc_css_parser/tests/recovery/delim-token/percent/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/delim-token/percent/span.swc-stderr @@ -131,7 +131,7 @@ 3 | } `---- - x Delim(DelimToken { value: '%' }) + x Delim { value: '%' } ,-[$DIR/tests/recovery/delim-token/percent/input.css:1:1] 1 | a { 2 | prop: %; diff --git a/crates/swc_css_parser/tests/recovery/delim-token/plus/span.swc-stderr b/crates/swc_css_parser/tests/recovery/delim-token/plus/span.swc-stderr index f5ff0ec5be89..5d3cd3c80001 100644 --- a/crates/swc_css_parser/tests/recovery/delim-token/plus/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/delim-token/plus/span.swc-stderr @@ -139,7 +139,7 @@ 3 | prop1: 1 + 2; `---- - x Delim(DelimToken { value: '+' }) + x Delim { value: '+' } ,-[$DIR/tests/recovery/delim-token/plus/input.css:1:1] 1 | a { 2 | prop: +; @@ -195,7 +195,7 @@ 4 | prop2: func(1 + 2); `---- - x Number(NumberToken { value: 1.0, raw: "1", type_flag: Integer }) + x Number { value: 1.0, raw: "1", type_flag: Integer } ,-[$DIR/tests/recovery/delim-token/plus/input.css:2:1] 2 | prop: +; 3 | prop1: 1 + 2; @@ -227,7 +227,7 @@ 4 | prop2: func(1 + 2); `---- - x Delim(DelimToken { value: '+' }) + x Delim { value: '+' } ,-[$DIR/tests/recovery/delim-token/plus/input.css:2:1] 2 | prop: +; 3 | prop1: 1 + 2; @@ -259,7 +259,7 @@ 4 | prop2: func(1 + 2); `---- - x Number(NumberToken { value: 2.0, raw: "2", type_flag: Integer }) + x Number { value: 2.0, raw: "2", type_flag: Integer } ,-[$DIR/tests/recovery/delim-token/plus/input.css:2:1] 2 | prop: +; 3 | prop1: 1 + 2; @@ -339,7 +339,7 @@ 5 | } `---- - x Number(NumberToken { value: 1.0, raw: "1", type_flag: Integer }) + x Number { value: 1.0, raw: "1", type_flag: Integer } ,-[$DIR/tests/recovery/delim-token/plus/input.css:3:1] 3 | prop1: 1 + 2; 4 | prop2: func(1 + 2); @@ -371,7 +371,7 @@ 5 | } `---- - x Delim(DelimToken { value: '+' }) + x Delim { value: '+' } ,-[$DIR/tests/recovery/delim-token/plus/input.css:3:1] 3 | prop1: 1 + 2; 4 | prop2: func(1 + 2); @@ -403,7 +403,7 @@ 5 | } `---- - x Number(NumberToken { value: 2.0, raw: "2", type_flag: Integer }) + x Number { value: 2.0, raw: "2", type_flag: Integer } ,-[$DIR/tests/recovery/delim-token/plus/input.css:3:1] 3 | prop1: 1 + 2; 4 | prop2: func(1 + 2); diff --git a/crates/swc_css_parser/tests/recovery/delim-token/question-mark/span.swc-stderr b/crates/swc_css_parser/tests/recovery/delim-token/question-mark/span.swc-stderr index f6affc6a4de7..cf81f0eef433 100644 --- a/crates/swc_css_parser/tests/recovery/delim-token/question-mark/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/delim-token/question-mark/span.swc-stderr @@ -131,7 +131,7 @@ 3 | } `---- - x Delim(DelimToken { value: '?' }) + x Delim { value: '?' } ,-[$DIR/tests/recovery/delim-token/question-mark/input.css:1:1] 1 | a { 2 | color: ?; diff --git a/crates/swc_css_parser/tests/recovery/delim-token/star/span.swc-stderr b/crates/swc_css_parser/tests/recovery/delim-token/star/span.swc-stderr index 797953b28eff..f5d337688f2d 100644 --- a/crates/swc_css_parser/tests/recovery/delim-token/star/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/delim-token/star/span.swc-stderr @@ -131,7 +131,7 @@ 3 | } `---- - x Delim(DelimToken { value: '*' }) + x Delim { value: '*' } ,-[$DIR/tests/recovery/delim-token/star/input.css:1:1] 1 | a { 2 | color: *; diff --git a/crates/swc_css_parser/tests/recovery/delim-token/tilde/span.swc-stderr b/crates/swc_css_parser/tests/recovery/delim-token/tilde/span.swc-stderr index bd97968a80a9..78babfaaf057 100644 --- a/crates/swc_css_parser/tests/recovery/delim-token/tilde/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/delim-token/tilde/span.swc-stderr @@ -131,7 +131,7 @@ 3 | } `---- - x Delim(DelimToken { value: '~' }) + x Delim { value: '~' } ,-[$DIR/tests/recovery/delim-token/tilde/input.css:1:1] 1 | a { 2 | color: ~; diff --git a/crates/swc_css_parser/tests/recovery/escaped/declaration-value/span.swc-stderr b/crates/swc_css_parser/tests/recovery/escaped/declaration-value/span.swc-stderr index 6e4c12a09cee..76e8a1d3505b 100644 --- a/crates/swc_css_parser/tests/recovery/escaped/declaration-value/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/escaped/declaration-value/span.swc-stderr @@ -107,7 +107,7 @@ : ^ `---- - x Ident(IdentToken { value: Atom('x' type=static), raw: "x" }) + x Ident { value: Atom('x' type=static), raw: "x" } ,-[$DIR/tests/recovery/escaped/declaration-value/input.css:1:1] 1 | a { value: x } : ^ @@ -119,7 +119,7 @@ : ^ `---- - x Delim(DelimToken { value: '\u{1}' }) + x Delim { value: '\u{1}' } ,-[$DIR/tests/recovery/escaped/declaration-value/input.css:1:1] 1 | a { value: x } : ^ diff --git a/crates/swc_css_parser/tests/recovery/escaped/id-selector/span.swc-stderr b/crates/swc_css_parser/tests/recovery/escaped/id-selector/span.swc-stderr index aafce4019da6..3650478a333f 100644 --- a/crates/swc_css_parser/tests/recovery/escaped/id-selector/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/escaped/id-selector/span.swc-stderr @@ -23,7 +23,7 @@ : ^^^^^^^^^ `---- - x Hash(HashToken { is_id: false, value: Atom('0,hash' type=inline), raw: "0\\2chash" }) + x Hash { is_id: false, value: Atom('0,hash' type=inline), raw: "0\\2chash" } ,-[$DIR/tests/recovery/escaped/id-selector/input.css:1:1] 1 | #0\2chash {} : ^^^^^^^^^ diff --git a/crates/swc_css_parser/tests/recovery/function/bad-comment-2/span.swc-stderr b/crates/swc_css_parser/tests/recovery/function/bad-comment-2/span.swc-stderr index b0cab4377c08..3f6c7277c931 100644 --- a/crates/swc_css_parser/tests/recovery/function/bad-comment-2/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/function/bad-comment-2/span.swc-stderr @@ -151,7 +151,7 @@ 6 | } `---- - x BadUrl(BadUrlToken { raw: ("url", "\n /* test */\n \"test.png\"\n ") }) + x BadUrl { raw: ("url", "\n /* test */\n \"test.png\"\n ") } ,-[$DIR/tests/recovery/function/bad-comment-2/input.css:1:1] 1 | a { 2 | ,-> background: url( diff --git a/crates/swc_css_parser/tests/recovery/function/bad-comment/span.swc-stderr b/crates/swc_css_parser/tests/recovery/function/bad-comment/span.swc-stderr index 1534719f82e7..1fe352ff235d 100644 --- a/crates/swc_css_parser/tests/recovery/function/bad-comment/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/function/bad-comment/span.swc-stderr @@ -151,7 +151,7 @@ 6 | } `---- - x BadUrl(BadUrlToken { raw: ("url", "\n /* test */\n test.png\n ") }) + x BadUrl { raw: ("url", "\n /* test */\n test.png\n ") } ,-[$DIR/tests/recovery/function/bad-comment/input.css:1:1] 1 | a { 2 | ,-> background: url( diff --git a/crates/swc_css_parser/tests/recovery/function/base/span.swc-stderr b/crates/swc_css_parser/tests/recovery/function/base/span.swc-stderr index ca227a3e18a8..4c7f850d860c 100644 --- a/crates/swc_css_parser/tests/recovery/function/base/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/function/base/span.swc-stderr @@ -179,7 +179,7 @@ 3 | prop: func(ident.ident); `---- - x Number(NumberToken { value: 1.0, raw: "1", type_flag: Integer }) + x Number { value: 1.0, raw: "1", type_flag: Integer } ,-[$DIR/tests/recovery/function/base/input.css:1:1] 1 | div { 2 | prop: func(1 + 2); @@ -211,7 +211,7 @@ 3 | prop: func(ident.ident); `---- - x Delim(DelimToken { value: '+' }) + x Delim { value: '+' } ,-[$DIR/tests/recovery/function/base/input.css:1:1] 1 | div { 2 | prop: func(1 + 2); @@ -243,7 +243,7 @@ 3 | prop: func(ident.ident); `---- - x Number(NumberToken { value: 2.0, raw: "2", type_flag: Integer }) + x Number { value: 2.0, raw: "2", type_flag: Integer } ,-[$DIR/tests/recovery/function/base/input.css:1:1] 1 | div { 2 | prop: func(1 + 2); @@ -323,7 +323,7 @@ 4 | prop: func3( ident.ident ); `---- - x Ident(IdentToken { value: Atom('ident' type=inline), raw: "ident" }) + x Ident { value: Atom('ident' type=inline), raw: "ident" } ,-[$DIR/tests/recovery/function/base/input.css:2:1] 2 | prop: func(1 + 2); 3 | prop: func(ident.ident); @@ -339,7 +339,7 @@ 4 | prop: func3( ident.ident ); `---- - x Delim(DelimToken { value: '.' }) + x Delim { value: '.' } ,-[$DIR/tests/recovery/function/base/input.css:2:1] 2 | prop: func(1 + 2); 3 | prop: func(ident.ident); @@ -355,7 +355,7 @@ 4 | prop: func3( ident.ident ); `---- - x Ident(IdentToken { value: Atom('ident' type=inline), raw: "ident" }) + x Ident { value: Atom('ident' type=inline), raw: "ident" } ,-[$DIR/tests/recovery/function/base/input.css:2:1] 2 | prop: func(1 + 2); 3 | prop: func(ident.ident); @@ -451,7 +451,7 @@ 5 | prop: func([foo bar]); `---- - x Ident(IdentToken { value: Atom('ident' type=inline), raw: "ident" }) + x Ident { value: Atom('ident' type=inline), raw: "ident" } ,-[$DIR/tests/recovery/function/base/input.css:3:1] 3 | prop: func(ident.ident); 4 | prop: func3( ident.ident ); @@ -467,7 +467,7 @@ 5 | prop: func([foo bar]); `---- - x Delim(DelimToken { value: '.' }) + x Delim { value: '.' } ,-[$DIR/tests/recovery/function/base/input.css:3:1] 3 | prop: func(ident.ident); 4 | prop: func3( ident.ident ); @@ -483,7 +483,7 @@ 5 | prop: func([foo bar]); `---- - x Ident(IdentToken { value: Atom('ident' type=inline), raw: "ident" }) + x Ident { value: Atom('ident' type=inline), raw: "ident" } ,-[$DIR/tests/recovery/function/base/input.css:3:1] 3 | prop: func(ident.ident); 4 | prop: func3( ident.ident ); @@ -875,7 +875,7 @@ 8 | prop: func(1, 2); `---- - x Ident(IdentToken { value: Atom('foo' type=inline), raw: "foo" }) + x Ident { value: Atom('foo' type=inline), raw: "foo" } ,-[$DIR/tests/recovery/function/base/input.css:6:1] 6 | prop: func((foo, bar)); 7 | prop: func({ foo: bar }); @@ -923,7 +923,7 @@ 8 | prop: func(1, 2); `---- - x Ident(IdentToken { value: Atom('bar' type=inline), raw: "bar" }) + x Ident { value: Atom('bar' type=inline), raw: "bar" } ,-[$DIR/tests/recovery/function/base/input.css:6:1] 6 | prop: func((foo, bar)); 7 | prop: func({ foo: bar }); diff --git a/crates/swc_css_parser/tests/recovery/function/nested-unclosed/span.swc-stderr b/crates/swc_css_parser/tests/recovery/function/nested-unclosed/span.swc-stderr index 44beae8a6510..7fa7e0604fe7 100644 --- a/crates/swc_css_parser/tests/recovery/function/nested-unclosed/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/function/nested-unclosed/span.swc-stderr @@ -155,7 +155,7 @@ 3 | } `---- - x String(StringToken { value: Atom('test' type=inline), raw: "\"test\"" }) + x String { value: Atom('test' type=inline), raw: "\"test\"" } ,-[$DIR/tests/recovery/function/nested-unclosed/input.css:1:1] 1 | a { 2 | prop: url("test") : diff --git a/crates/swc_css_parser/tests/recovery/function/rgb/span.swc-stderr b/crates/swc_css_parser/tests/recovery/function/rgb/span.swc-stderr index d2cde23121e6..695577c755b0 100644 --- a/crates/swc_css_parser/tests/recovery/function/rgb/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/function/rgb/span.swc-stderr @@ -198,7 +198,7 @@ : ^^^^^^ `---- - x String(StringToken { value: Atom('test' type=inline), raw: "\"test\"" }) + x String { value: Atom('test' type=inline), raw: "\"test\"" } ,-[$DIR/tests/recovery/function/rgb/input.css:1:1] 1 | .div { 2 | color: rgb("test"); @@ -285,7 +285,7 @@ 5 | color: rgb(100, "test", 100); `---- - x String(StringToken { value: Atom('test' type=inline), raw: "\"test\"" }) + x String { value: Atom('test' type=inline), raw: "\"test\"" } ,-[$DIR/tests/recovery/function/rgb/input.css:3:1] 3 | 4 | color: rgb("test", 100, 100); @@ -333,7 +333,7 @@ 5 | color: rgb(100, "test", 100); `---- - x Number(NumberToken { value: 100.0, raw: "100", type_flag: Integer }) + x Number { value: 100.0, raw: "100", type_flag: Integer } ,-[$DIR/tests/recovery/function/rgb/input.css:3:1] 3 | 4 | color: rgb("test", 100, 100); @@ -381,7 +381,7 @@ 5 | color: rgb(100, "test", 100); `---- - x Number(NumberToken { value: 100.0, raw: "100", type_flag: Integer }) + x Number { value: 100.0, raw: "100", type_flag: Integer } ,-[$DIR/tests/recovery/function/rgb/input.css:3:1] 3 | 4 | color: rgb("test", 100, 100); @@ -469,7 +469,7 @@ 6 | color: rgb(100, 100, "test"); `---- - x Number(NumberToken { value: 100.0, raw: "100", type_flag: Integer }) + x Number { value: 100.0, raw: "100", type_flag: Integer } ,-[$DIR/tests/recovery/function/rgb/input.css:4:1] 4 | color: rgb("test", 100, 100); 5 | color: rgb(100, "test", 100); @@ -517,7 +517,7 @@ 6 | color: rgb(100, 100, "test"); `---- - x String(StringToken { value: Atom('test' type=inline), raw: "\"test\"" }) + x String { value: Atom('test' type=inline), raw: "\"test\"" } ,-[$DIR/tests/recovery/function/rgb/input.css:4:1] 4 | color: rgb("test", 100, 100); 5 | color: rgb(100, "test", 100); @@ -565,7 +565,7 @@ 6 | color: rgb(100, 100, "test"); `---- - x Number(NumberToken { value: 100.0, raw: "100", type_flag: Integer }) + x Number { value: 100.0, raw: "100", type_flag: Integer } ,-[$DIR/tests/recovery/function/rgb/input.css:4:1] 4 | color: rgb("test", 100, 100); 5 | color: rgb(100, "test", 100); @@ -653,7 +653,7 @@ 7 | color: rgb(100, 100, 100, "test"); `---- - x Number(NumberToken { value: 100.0, raw: "100", type_flag: Integer }) + x Number { value: 100.0, raw: "100", type_flag: Integer } ,-[$DIR/tests/recovery/function/rgb/input.css:5:1] 5 | color: rgb(100, "test", 100); 6 | color: rgb(100, 100, "test"); @@ -701,7 +701,7 @@ 7 | color: rgb(100, 100, 100, "test"); `---- - x Number(NumberToken { value: 100.0, raw: "100", type_flag: Integer }) + x Number { value: 100.0, raw: "100", type_flag: Integer } ,-[$DIR/tests/recovery/function/rgb/input.css:5:1] 5 | color: rgb(100, "test", 100); 6 | color: rgb(100, 100, "test"); @@ -749,7 +749,7 @@ 7 | color: rgb(100, 100, 100, "test"); `---- - x String(StringToken { value: Atom('test' type=inline), raw: "\"test\"" }) + x String { value: Atom('test' type=inline), raw: "\"test\"" } ,-[$DIR/tests/recovery/function/rgb/input.css:5:1] 5 | color: rgb(100, "test", 100); 6 | color: rgb(100, 100, "test"); @@ -827,7 +827,7 @@ : ^^^ `---- - x Number(NumberToken { value: 100.0, raw: "100", type_flag: Integer }) + x Number { value: 100.0, raw: "100", type_flag: Integer } ,-[$DIR/tests/recovery/function/rgb/input.css:6:1] 6 | color: rgb(100, 100, "test"); 7 | color: rgb(100, 100, 100, "test"); @@ -869,7 +869,7 @@ : ^^^ `---- - x Number(NumberToken { value: 100.0, raw: "100", type_flag: Integer }) + x Number { value: 100.0, raw: "100", type_flag: Integer } ,-[$DIR/tests/recovery/function/rgb/input.css:6:1] 6 | color: rgb(100, 100, "test"); 7 | color: rgb(100, 100, 100, "test"); @@ -911,7 +911,7 @@ : ^^^ `---- - x Number(NumberToken { value: 100.0, raw: "100", type_flag: Integer }) + x Number { value: 100.0, raw: "100", type_flag: Integer } ,-[$DIR/tests/recovery/function/rgb/input.css:6:1] 6 | color: rgb(100, 100, "test"); 7 | color: rgb(100, 100, 100, "test"); @@ -953,7 +953,7 @@ : ^^^^^^ `---- - x String(StringToken { value: Atom('test' type=inline), raw: "\"test\"" }) + x String { value: Atom('test' type=inline), raw: "\"test\"" } ,-[$DIR/tests/recovery/function/rgb/input.css:6:1] 6 | color: rgb(100, 100, "test"); 7 | color: rgb(100, 100, 100, "test"); @@ -1040,7 +1040,7 @@ 10 | color: rgb(100 "test" 100); `---- - x String(StringToken { value: Atom('test' type=inline), raw: "\"test\"" }) + x String { value: Atom('test' type=inline), raw: "\"test\"" } ,-[$DIR/tests/recovery/function/rgb/input.css:8:1] 8 | 9 | color: rgb("test" 100 100); @@ -1072,7 +1072,7 @@ 10 | color: rgb(100 "test" 100); `---- - x Number(NumberToken { value: 100.0, raw: "100", type_flag: Integer }) + x Number { value: 100.0, raw: "100", type_flag: Integer } ,-[$DIR/tests/recovery/function/rgb/input.css:8:1] 8 | 9 | color: rgb("test" 100 100); @@ -1104,7 +1104,7 @@ 10 | color: rgb(100 "test" 100); `---- - x Number(NumberToken { value: 100.0, raw: "100", type_flag: Integer }) + x Number { value: 100.0, raw: "100", type_flag: Integer } ,-[$DIR/tests/recovery/function/rgb/input.css:8:1] 8 | 9 | color: rgb("test" 100 100); @@ -1192,7 +1192,7 @@ 11 | color: rgb(100 100 "test"); `---- - x Number(NumberToken { value: 100.0, raw: "100", type_flag: Integer }) + x Number { value: 100.0, raw: "100", type_flag: Integer } ,-[$DIR/tests/recovery/function/rgb/input.css:9:1] 9 | color: rgb("test" 100 100); 10 | color: rgb(100 "test" 100); @@ -1224,7 +1224,7 @@ 11 | color: rgb(100 100 "test"); `---- - x String(StringToken { value: Atom('test' type=inline), raw: "\"test\"" }) + x String { value: Atom('test' type=inline), raw: "\"test\"" } ,-[$DIR/tests/recovery/function/rgb/input.css:9:1] 9 | color: rgb("test" 100 100); 10 | color: rgb(100 "test" 100); @@ -1256,7 +1256,7 @@ 11 | color: rgb(100 100 "test"); `---- - x Number(NumberToken { value: 100.0, raw: "100", type_flag: Integer }) + x Number { value: 100.0, raw: "100", type_flag: Integer } ,-[$DIR/tests/recovery/function/rgb/input.css:9:1] 9 | color: rgb("test" 100 100); 10 | color: rgb(100 "test" 100); @@ -1344,7 +1344,7 @@ 12 | color: rgb(100 100 100 / "test"); `---- - x Number(NumberToken { value: 100.0, raw: "100", type_flag: Integer }) + x Number { value: 100.0, raw: "100", type_flag: Integer } ,-[$DIR/tests/recovery/function/rgb/input.css:10:1] 10 | color: rgb(100 "test" 100); 11 | color: rgb(100 100 "test"); @@ -1376,7 +1376,7 @@ 12 | color: rgb(100 100 100 / "test"); `---- - x Number(NumberToken { value: 100.0, raw: "100", type_flag: Integer }) + x Number { value: 100.0, raw: "100", type_flag: Integer } ,-[$DIR/tests/recovery/function/rgb/input.css:10:1] 10 | color: rgb(100 "test" 100); 11 | color: rgb(100 100 "test"); @@ -1408,7 +1408,7 @@ 12 | color: rgb(100 100 100 / "test"); `---- - x String(StringToken { value: Atom('test' type=inline), raw: "\"test\"" }) + x String { value: Atom('test' type=inline), raw: "\"test\"" } ,-[$DIR/tests/recovery/function/rgb/input.css:10:1] 10 | color: rgb(100 "test" 100); 11 | color: rgb(100 100 "test"); @@ -1486,7 +1486,7 @@ : ^^^ `---- - x Number(NumberToken { value: 100.0, raw: "100", type_flag: Integer }) + x Number { value: 100.0, raw: "100", type_flag: Integer } ,-[$DIR/tests/recovery/function/rgb/input.css:11:1] 11 | color: rgb(100 100 "test"); 12 | color: rgb(100 100 100 / "test"); @@ -1514,7 +1514,7 @@ : ^^^ `---- - x Number(NumberToken { value: 100.0, raw: "100", type_flag: Integer }) + x Number { value: 100.0, raw: "100", type_flag: Integer } ,-[$DIR/tests/recovery/function/rgb/input.css:11:1] 11 | color: rgb(100 100 "test"); 12 | color: rgb(100 100 100 / "test"); @@ -1542,7 +1542,7 @@ : ^^^ `---- - x Number(NumberToken { value: 100.0, raw: "100", type_flag: Integer }) + x Number { value: 100.0, raw: "100", type_flag: Integer } ,-[$DIR/tests/recovery/function/rgb/input.css:11:1] 11 | color: rgb(100 100 "test"); 12 | color: rgb(100 100 100 / "test"); @@ -1570,7 +1570,7 @@ : ^ `---- - x Delim(DelimToken { value: '/' }) + x Delim { value: '/' } ,-[$DIR/tests/recovery/function/rgb/input.css:11:1] 11 | color: rgb(100 100 "test"); 12 | color: rgb(100 100 100 / "test"); @@ -1598,7 +1598,7 @@ : ^^^^^^ `---- - x String(StringToken { value: Atom('test' type=inline), raw: "\"test\"" }) + x String { value: Atom('test' type=inline), raw: "\"test\"" } ,-[$DIR/tests/recovery/function/rgb/input.css:11:1] 11 | color: rgb(100 100 "test"); 12 | color: rgb(100 100 100 / "test"); diff --git a/crates/swc_css_parser/tests/recovery/function/unclosed-2/span.swc-stderr b/crates/swc_css_parser/tests/recovery/function/unclosed-2/span.swc-stderr index 369c2912223d..2d8837624e04 100644 --- a/crates/swc_css_parser/tests/recovery/function/unclosed-2/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/function/unclosed-2/span.swc-stderr @@ -143,7 +143,7 @@ 3 | } `---- - x Number(NumberToken { value: 4.0, raw: "4", type_flag: Integer }) + x Number { value: 4.0, raw: "4", type_flag: Integer } ,-[$DIR/tests/recovery/function/unclosed-2/input.css:1:1] 1 | .style { 2 | grid-template-columns: repeat(4, [col-start] 12px @@ -215,7 +215,7 @@ 3 | } `---- - x Ident(IdentToken { value: Atom('col-start' type=dynamic), raw: "col-start" }) + x Ident { value: Atom('col-start' type=dynamic), raw: "col-start" } ,-[$DIR/tests/recovery/function/unclosed-2/input.css:1:1] 1 | .style { 2 | grid-template-columns: repeat(4, [col-start] 12px diff --git a/crates/swc_css_parser/tests/recovery/hacks/span.swc-stderr b/crates/swc_css_parser/tests/recovery/hacks/span.swc-stderr index 46db9a8fbeec..9eeb8c537862 100644 --- a/crates/swc_css_parser/tests/recovery/hacks/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/hacks/span.swc-stderr @@ -983,7 +983,7 @@ 14 | .selector { [;property: value;]; } `---- - x Ident(IdentToken { value: Atom('property' type=static), raw: "property" }) + x Ident { value: Atom('property' type=static), raw: "property" } ,-[$DIR/tests/recovery/hacks/input.css:12:1] 12 | 13 | .selector { (;property: value;); } @@ -1031,7 +1031,7 @@ 14 | .selector { [;property: value;]; } `---- - x Ident(IdentToken { value: Atom('value' type=inline), raw: "value" }) + x Ident { value: Atom('value' type=inline), raw: "value" } ,-[$DIR/tests/recovery/hacks/input.css:12:1] 12 | 13 | .selector { (;property: value;); } @@ -1197,7 +1197,7 @@ : ^^^^^^^^ `---- - x Ident(IdentToken { value: Atom('property' type=static), raw: "property" }) + x Ident { value: Atom('property' type=static), raw: "property" } ,-[$DIR/tests/recovery/hacks/input.css:13:1] 13 | .selector { (;property: value;); } 14 | .selector { [;property: value;]; } @@ -1239,7 +1239,7 @@ : ^^^^^ `---- - x Ident(IdentToken { value: Atom('value' type=inline), raw: "value" }) + x Ident { value: Atom('value' type=inline), raw: "value" } ,-[$DIR/tests/recovery/hacks/input.css:13:1] 13 | .selector { (;property: value;); } 14 | .selector { [;property: value;]; } @@ -1323,7 +1323,7 @@ : ^^^ `---- - x Ident(IdentToken { value: Atom('\0' type=inline), raw: "\\\\0" }) + x Ident { value: Atom('\0' type=inline), raw: "\\\\0" } ,-[$DIR/tests/recovery/hacks/input.css:15:1] 15 | 16 | @media \\0 screen {} @@ -1351,7 +1351,7 @@ : ^^^^^^ `---- - x Ident(IdentToken { value: Atom('screen' type=inline), raw: "screen" }) + x Ident { value: Atom('screen' type=inline), raw: "screen" } ,-[$DIR/tests/recovery/hacks/input.css:15:1] 15 | 16 | @media \\0 screen {} @@ -6017,7 +6017,7 @@ : ^^^^^ `---- - x Ident(IdentToken { value: Atom('hover' type=inline), raw: "hover" }) + x Ident { value: Atom('hover' type=inline), raw: "hover" } ,-[$DIR/tests/recovery/hacks/input.css:63:1] 63 | 64 | _:-moz-tree-row(hover), .selector {} @@ -9455,7 +9455,7 @@ 105 | color: red; `---- - x Delim(DelimToken { value: '!' }) + x Delim { value: '!' } ,-[$DIR/tests/recovery/hacks/input.css:103:1] 103 | .selector { 104 | !property: value; @@ -9471,7 +9471,7 @@ 105 | color: red; `---- - x Ident(IdentToken { value: Atom('property' type=static), raw: "property" }) + x Ident { value: Atom('property' type=static), raw: "property" } ,-[$DIR/tests/recovery/hacks/input.css:103:1] 103 | .selector { 104 | !property: value; @@ -9519,7 +9519,7 @@ 105 | color: red; `---- - x Ident(IdentToken { value: Atom('value' type=inline), raw: "value" }) + x Ident { value: Atom('value' type=inline), raw: "value" } ,-[$DIR/tests/recovery/hacks/input.css:103:1] 103 | .selector { 104 | !property: value; @@ -9709,7 +9709,7 @@ 109 | color: red; `---- - x Delim(DelimToken { value: '$' }) + x Delim { value: '$' } ,-[$DIR/tests/recovery/hacks/input.css:107:1] 107 | .selector { 108 | $property: value; @@ -9725,7 +9725,7 @@ 109 | color: red; `---- - x Ident(IdentToken { value: Atom('property' type=static), raw: "property" }) + x Ident { value: Atom('property' type=static), raw: "property" } ,-[$DIR/tests/recovery/hacks/input.css:107:1] 107 | .selector { 108 | $property: value; @@ -9773,7 +9773,7 @@ 109 | color: red; `---- - x Ident(IdentToken { value: Atom('value' type=inline), raw: "value" }) + x Ident { value: Atom('value' type=inline), raw: "value" } ,-[$DIR/tests/recovery/hacks/input.css:107:1] 107 | .selector { 108 | $property: value; @@ -9963,7 +9963,7 @@ 113 | color: red; `---- - x Delim(DelimToken { value: '&' }) + x Delim { value: '&' } ,-[$DIR/tests/recovery/hacks/input.css:111:1] 111 | .selector { 112 | &property: value; @@ -9979,7 +9979,7 @@ 113 | color: red; `---- - x Ident(IdentToken { value: Atom('property' type=static), raw: "property" }) + x Ident { value: Atom('property' type=static), raw: "property" } ,-[$DIR/tests/recovery/hacks/input.css:111:1] 111 | .selector { 112 | &property: value; @@ -10027,7 +10027,7 @@ 113 | color: red; `---- - x Ident(IdentToken { value: Atom('value' type=inline), raw: "value" }) + x Ident { value: Atom('value' type=inline), raw: "value" } ,-[$DIR/tests/recovery/hacks/input.css:111:1] 111 | .selector { 112 | &property: value; @@ -10217,7 +10217,7 @@ 117 | color: red; `---- - x Delim(DelimToken { value: '*' }) + x Delim { value: '*' } ,-[$DIR/tests/recovery/hacks/input.css:115:1] 115 | .selector { 116 | *property: value; @@ -10233,7 +10233,7 @@ 117 | color: red; `---- - x Ident(IdentToken { value: Atom('property' type=static), raw: "property" }) + x Ident { value: Atom('property' type=static), raw: "property" } ,-[$DIR/tests/recovery/hacks/input.css:115:1] 115 | .selector { 116 | *property: value; @@ -10281,7 +10281,7 @@ 117 | color: red; `---- - x Ident(IdentToken { value: Atom('value' type=inline), raw: "value" }) + x Ident { value: Atom('value' type=inline), raw: "value" } ,-[$DIR/tests/recovery/hacks/input.css:115:1] 115 | .selector { 116 | *property: value; @@ -10487,7 +10487,7 @@ 121 | color: red; `---- - x Ident(IdentToken { value: Atom('property' type=static), raw: "property" }) + x Ident { value: Atom('property' type=static), raw: "property" } ,-[$DIR/tests/recovery/hacks/input.css:119:1] 119 | .selector { 120 | )property: value; @@ -10535,7 +10535,7 @@ 121 | color: red; `---- - x Ident(IdentToken { value: Atom('value' type=inline), raw: "value" }) + x Ident { value: Atom('value' type=inline), raw: "value" } ,-[$DIR/tests/recovery/hacks/input.css:119:1] 119 | .selector { 120 | )property: value; @@ -10725,7 +10725,7 @@ 125 | color: red; `---- - x Delim(DelimToken { value: '=' }) + x Delim { value: '=' } ,-[$DIR/tests/recovery/hacks/input.css:123:1] 123 | .selector { 124 | =property: value; @@ -10741,7 +10741,7 @@ 125 | color: red; `---- - x Ident(IdentToken { value: Atom('property' type=static), raw: "property" }) + x Ident { value: Atom('property' type=static), raw: "property" } ,-[$DIR/tests/recovery/hacks/input.css:123:1] 123 | .selector { 124 | =property: value; @@ -10789,7 +10789,7 @@ 125 | color: red; `---- - x Ident(IdentToken { value: Atom('value' type=inline), raw: "value" }) + x Ident { value: Atom('value' type=inline), raw: "value" } ,-[$DIR/tests/recovery/hacks/input.css:123:1] 123 | .selector { 124 | =property: value; @@ -10979,7 +10979,7 @@ 129 | color: red; `---- - x Delim(DelimToken { value: '%' }) + x Delim { value: '%' } ,-[$DIR/tests/recovery/hacks/input.css:127:1] 127 | .selector { 128 | %property: value; @@ -10995,7 +10995,7 @@ 129 | color: red; `---- - x Ident(IdentToken { value: Atom('property' type=static), raw: "property" }) + x Ident { value: Atom('property' type=static), raw: "property" } ,-[$DIR/tests/recovery/hacks/input.css:127:1] 127 | .selector { 128 | %property: value; @@ -11043,7 +11043,7 @@ 129 | color: red; `---- - x Ident(IdentToken { value: Atom('value' type=inline), raw: "value" }) + x Ident { value: Atom('value' type=inline), raw: "value" } ,-[$DIR/tests/recovery/hacks/input.css:127:1] 127 | .selector { 128 | %property: value; @@ -11233,7 +11233,7 @@ 133 | color: red; `---- - x Delim(DelimToken { value: '+' }) + x Delim { value: '+' } ,-[$DIR/tests/recovery/hacks/input.css:131:1] 131 | .selector { 132 | +property: value; @@ -11249,7 +11249,7 @@ 133 | color: red; `---- - x Ident(IdentToken { value: Atom('property' type=static), raw: "property" }) + x Ident { value: Atom('property' type=static), raw: "property" } ,-[$DIR/tests/recovery/hacks/input.css:131:1] 131 | .selector { 132 | +property: value; @@ -11297,7 +11297,7 @@ 133 | color: red; `---- - x Ident(IdentToken { value: Atom('value' type=inline), raw: "value" }) + x Ident { value: Atom('value' type=inline), raw: "value" } ,-[$DIR/tests/recovery/hacks/input.css:131:1] 131 | .selector { 132 | +property: value; @@ -11599,7 +11599,7 @@ 137 | color: red; `---- - x Ident(IdentToken { value: Atom('value' type=inline), raw: "value" }) + x Ident { value: Atom('value' type=inline), raw: "value" } ,-[$DIR/tests/recovery/hacks/input.css:135:1] 135 | .selector { 136 | @property: value; @@ -11733,7 +11733,7 @@ 141 | color: red; `---- - x Ident(IdentToken { value: Atom('property' type=static), raw: "property" }) + x Ident { value: Atom('property' type=static), raw: "property" } ,-[$DIR/tests/recovery/hacks/input.css:139:1] 139 | .selector { 140 | ,property: value; @@ -11781,7 +11781,7 @@ 141 | color: red; `---- - x Ident(IdentToken { value: Atom('value' type=inline), raw: "value" }) + x Ident { value: Atom('value' type=inline), raw: "value" } ,-[$DIR/tests/recovery/hacks/input.css:139:1] 139 | .selector { 140 | ,property: value; @@ -11971,7 +11971,7 @@ 145 | color: red; `---- - x Delim(DelimToken { value: '.' }) + x Delim { value: '.' } ,-[$DIR/tests/recovery/hacks/input.css:143:1] 143 | .selector { 144 | .property: value; @@ -11987,7 +11987,7 @@ 145 | color: red; `---- - x Ident(IdentToken { value: Atom('property' type=static), raw: "property" }) + x Ident { value: Atom('property' type=static), raw: "property" } ,-[$DIR/tests/recovery/hacks/input.css:143:1] 143 | .selector { 144 | .property: value; @@ -12035,7 +12035,7 @@ 145 | color: red; `---- - x Ident(IdentToken { value: Atom('value' type=inline), raw: "value" }) + x Ident { value: Atom('value' type=inline), raw: "value" } ,-[$DIR/tests/recovery/hacks/input.css:143:1] 143 | .selector { 144 | .property: value; @@ -12225,7 +12225,7 @@ 149 | color: red; `---- - x Delim(DelimToken { value: '/' }) + x Delim { value: '/' } ,-[$DIR/tests/recovery/hacks/input.css:147:1] 147 | .selector { 148 | /property: value; @@ -12241,7 +12241,7 @@ 149 | color: red; `---- - x Ident(IdentToken { value: Atom('property' type=static), raw: "property" }) + x Ident { value: Atom('property' type=static), raw: "property" } ,-[$DIR/tests/recovery/hacks/input.css:147:1] 147 | .selector { 148 | /property: value; @@ -12289,7 +12289,7 @@ 149 | color: red; `---- - x Ident(IdentToken { value: Atom('value' type=inline), raw: "value" }) + x Ident { value: Atom('value' type=inline), raw: "value" } ,-[$DIR/tests/recovery/hacks/input.css:147:1] 147 | .selector { 148 | /property: value; @@ -12479,7 +12479,7 @@ 153 | color: red; `---- - x Delim(DelimToken { value: '`' }) + x Delim { value: '`' } ,-[$DIR/tests/recovery/hacks/input.css:151:1] 151 | .selector { 152 | `property: value; @@ -12495,7 +12495,7 @@ 153 | color: red; `---- - x Ident(IdentToken { value: Atom('property' type=static), raw: "property" }) + x Ident { value: Atom('property' type=static), raw: "property" } ,-[$DIR/tests/recovery/hacks/input.css:151:1] 151 | .selector { 152 | `property: value; @@ -12543,7 +12543,7 @@ 153 | color: red; `---- - x Ident(IdentToken { value: Atom('value' type=inline), raw: "value" }) + x Ident { value: Atom('value' type=inline), raw: "value" } ,-[$DIR/tests/recovery/hacks/input.css:151:1] 151 | .selector { 152 | `property: value; @@ -12749,7 +12749,7 @@ 157 | color: red; `---- - x Ident(IdentToken { value: Atom('property' type=static), raw: "property" }) + x Ident { value: Atom('property' type=static), raw: "property" } ,-[$DIR/tests/recovery/hacks/input.css:155:1] 155 | .selector { 156 | ]property: value; @@ -12797,7 +12797,7 @@ 157 | color: red; `---- - x Ident(IdentToken { value: Atom('value' type=inline), raw: "value" }) + x Ident { value: Atom('value' type=inline), raw: "value" } ,-[$DIR/tests/recovery/hacks/input.css:155:1] 155 | .selector { 156 | ]property: value; @@ -12987,7 +12987,7 @@ 161 | color: red; `---- - x Hash(HashToken { is_id: true, value: Atom('property' type=static), raw: "property" }) + x Hash { is_id: true, value: Atom('property' type=static), raw: "property" } ,-[$DIR/tests/recovery/hacks/input.css:159:1] 159 | .selector { 160 | #property: value; @@ -13035,7 +13035,7 @@ 161 | color: red; `---- - x Ident(IdentToken { value: Atom('value' type=inline), raw: "value" }) + x Ident { value: Atom('value' type=inline), raw: "value" } ,-[$DIR/tests/recovery/hacks/input.css:159:1] 159 | .selector { 160 | #property: value; @@ -13225,7 +13225,7 @@ 165 | color: red; `---- - x Delim(DelimToken { value: '~' }) + x Delim { value: '~' } ,-[$DIR/tests/recovery/hacks/input.css:163:1] 163 | .selector { 164 | ~property: value; @@ -13241,7 +13241,7 @@ 165 | color: red; `---- - x Ident(IdentToken { value: Atom('property' type=static), raw: "property" }) + x Ident { value: Atom('property' type=static), raw: "property" } ,-[$DIR/tests/recovery/hacks/input.css:163:1] 163 | .selector { 164 | ~property: value; @@ -13289,7 +13289,7 @@ 165 | color: red; `---- - x Ident(IdentToken { value: Atom('value' type=inline), raw: "value" }) + x Ident { value: Atom('value' type=inline), raw: "value" } ,-[$DIR/tests/recovery/hacks/input.css:163:1] 163 | .selector { 164 | ~property: value; @@ -13479,7 +13479,7 @@ 169 | color: red; `---- - x Delim(DelimToken { value: '?' }) + x Delim { value: '?' } ,-[$DIR/tests/recovery/hacks/input.css:167:1] 167 | .selector { 168 | ?property: value; @@ -13495,7 +13495,7 @@ 169 | color: red; `---- - x Ident(IdentToken { value: Atom('property' type=static), raw: "property" }) + x Ident { value: Atom('property' type=static), raw: "property" } ,-[$DIR/tests/recovery/hacks/input.css:167:1] 167 | .selector { 168 | ?property: value; @@ -13543,7 +13543,7 @@ 169 | color: red; `---- - x Ident(IdentToken { value: Atom('value' type=inline), raw: "value" }) + x Ident { value: Atom('value' type=inline), raw: "value" } ,-[$DIR/tests/recovery/hacks/input.css:167:1] 167 | .selector { 168 | ?property: value; @@ -13749,7 +13749,7 @@ 173 | color: red; `---- - x Ident(IdentToken { value: Atom('property' type=static), raw: "property" }) + x Ident { value: Atom('property' type=static), raw: "property" } ,-[$DIR/tests/recovery/hacks/input.css:171:1] 171 | .selector { 172 | :property: value; @@ -13797,7 +13797,7 @@ 173 | color: red; `---- - x Ident(IdentToken { value: Atom('value' type=inline), raw: "value" }) + x Ident { value: Atom('value' type=inline), raw: "value" } ,-[$DIR/tests/recovery/hacks/input.css:171:1] 171 | .selector { 172 | :property: value; @@ -13984,7 +13984,7 @@ 177 | color: red; `---- - x Delim(DelimToken { value: '|' }) + x Delim { value: '|' } ,-[$DIR/tests/recovery/hacks/input.css:175:1] 175 | .selector { 176 | |property: value; @@ -14000,7 +14000,7 @@ 177 | color: red; `---- - x Ident(IdentToken { value: Atom('property' type=static), raw: "property" }) + x Ident { value: Atom('property' type=static), raw: "property" } ,-[$DIR/tests/recovery/hacks/input.css:175:1] 175 | .selector { 176 | |property: value; @@ -14048,7 +14048,7 @@ 177 | color: red; `---- - x Ident(IdentToken { value: Atom('value' type=inline), raw: "value" }) + x Ident { value: Atom('value' type=inline), raw: "value" } ,-[$DIR/tests/recovery/hacks/input.css:175:1] 175 | .selector { 176 | |property: value; @@ -14240,7 +14240,7 @@ : ^^^^^ `---- - x Ident(IdentToken { value: Atom('value' type=inline), raw: "value" }) + x Ident { value: Atom('value' type=inline), raw: "value" } ,-[$DIR/tests/recovery/hacks/input.css:179:1] 179 | 180 | .selector { property: value !ie; } @@ -14268,7 +14268,7 @@ : ^ `---- - x Delim(DelimToken { value: '!' }) + x Delim { value: '!' } ,-[$DIR/tests/recovery/hacks/input.css:179:1] 179 | 180 | .selector { property: value !ie; } @@ -14282,7 +14282,7 @@ : ^^ `---- - x Ident(IdentToken { value: Atom('ie' type=inline), raw: "ie" }) + x Ident { value: Atom('ie' type=inline), raw: "ie" } ,-[$DIR/tests/recovery/hacks/input.css:179:1] 179 | 180 | .selector { property: value !ie; } @@ -15826,7 +15826,7 @@ 205 | .selector { [;property: value;]; } `---- - x Ident(IdentToken { value: Atom('property' type=static), raw: "property" }) + x Ident { value: Atom('property' type=static), raw: "property" } ,-[$DIR/tests/recovery/hacks/input.css:203:1] 203 | 204 | .selector { (;property: value;); } @@ -15874,7 +15874,7 @@ 205 | .selector { [;property: value;]; } `---- - x Ident(IdentToken { value: Atom('value' type=inline), raw: "value" }) + x Ident { value: Atom('value' type=inline), raw: "value" } ,-[$DIR/tests/recovery/hacks/input.css:203:1] 203 | 204 | .selector { (;property: value;); } @@ -16040,7 +16040,7 @@ : ^^^^^^^^ `---- - x Ident(IdentToken { value: Atom('property' type=static), raw: "property" }) + x Ident { value: Atom('property' type=static), raw: "property" } ,-[$DIR/tests/recovery/hacks/input.css:204:1] 204 | .selector { (;property: value;); } 205 | .selector { [;property: value;]; } @@ -16082,7 +16082,7 @@ : ^^^^^ `---- - x Ident(IdentToken { value: Atom('value' type=inline), raw: "value" }) + x Ident { value: Atom('value' type=inline), raw: "value" } ,-[$DIR/tests/recovery/hacks/input.css:204:1] 204 | .selector { (;property: value;); } 205 | .selector { [;property: value;]; } @@ -17857,7 +17857,7 @@ 226 | .selector { [;property: value;]; } `---- - x Ident(IdentToken { value: Atom('property' type=static), raw: "property" }) + x Ident { value: Atom('property' type=static), raw: "property" } ,-[$DIR/tests/recovery/hacks/input.css:224:1] 224 | 225 | .selector { (;property: value;); } @@ -17905,7 +17905,7 @@ 226 | .selector { [;property: value;]; } `---- - x Ident(IdentToken { value: Atom('value' type=inline), raw: "value" }) + x Ident { value: Atom('value' type=inline), raw: "value" } ,-[$DIR/tests/recovery/hacks/input.css:224:1] 224 | 225 | .selector { (;property: value;); } @@ -18071,7 +18071,7 @@ : ^^^^^^^^ `---- - x Ident(IdentToken { value: Atom('property' type=static), raw: "property" }) + x Ident { value: Atom('property' type=static), raw: "property" } ,-[$DIR/tests/recovery/hacks/input.css:225:1] 225 | .selector { (;property: value;); } 226 | .selector { [;property: value;]; } @@ -18113,7 +18113,7 @@ : ^^^^^ `---- - x Ident(IdentToken { value: Atom('value' type=inline), raw: "value" }) + x Ident { value: Atom('value' type=inline), raw: "value" } ,-[$DIR/tests/recovery/hacks/input.css:225:1] 225 | .selector { (;property: value;); } 226 | .selector { [;property: value;]; } @@ -19496,7 +19496,7 @@ : ^^^ `---- - x Ident(IdentToken { value: Atom('\0' type=inline), raw: "\\\\0" }) + x Ident { value: Atom('\0' type=inline), raw: "\\\\0" } ,-[$DIR/tests/recovery/hacks/input.css:240:1] 240 | 241 | @media \\0 screen {} @@ -19524,7 +19524,7 @@ : ^^^^^^ `---- - x Ident(IdentToken { value: Atom('screen' type=inline), raw: "screen" }) + x Ident { value: Atom('screen' type=inline), raw: "screen" } ,-[$DIR/tests/recovery/hacks/input.css:240:1] 240 | 241 | @media \\0 screen {} @@ -19680,7 +19680,7 @@ 245 | _background: white; `---- - x Delim(DelimToken { value: '*' }) + x Delim { value: '*' } ,-[$DIR/tests/recovery/hacks/input.css:243:1] 243 | a { 244 | *color : black; @@ -19696,7 +19696,7 @@ 245 | _background: white; `---- - x Ident(IdentToken { value: Atom('color' type=static), raw: "color" }) + x Ident { value: Atom('color' type=static), raw: "color" } ,-[$DIR/tests/recovery/hacks/input.css:243:1] 243 | a { 244 | *color : black; @@ -19760,7 +19760,7 @@ 245 | _background: white; `---- - x Ident(IdentToken { value: Atom('black' type=inline), raw: "black" }) + x Ident { value: Atom('black' type=inline), raw: "black" } ,-[$DIR/tests/recovery/hacks/input.css:243:1] 243 | a { 244 | *color : black; @@ -19920,7 +19920,7 @@ 248 | } `---- - x Delim(DelimToken { value: '$' }) + x Delim { value: '$' } ,-[$DIR/tests/recovery/hacks/input.css:246:1] 246 | font-size/**/: big; 247 | $(var)-size: 100%; @@ -19960,7 +19960,7 @@ 248 | } `---- - x Ident(IdentToken { value: Atom('var' type=static), raw: "var" }) + x Ident { value: Atom('var' type=static), raw: "var" } ,-[$DIR/tests/recovery/hacks/input.css:246:1] 246 | font-size/**/: big; 247 | $(var)-size: 100%; @@ -19976,7 +19976,7 @@ 248 | } `---- - x Ident(IdentToken { value: Atom('-size' type=inline), raw: "-size" }) + x Ident { value: Atom('-size' type=inline), raw: "-size" } ,-[$DIR/tests/recovery/hacks/input.css:246:1] 246 | font-size/**/: big; 247 | $(var)-size: 100%; @@ -20024,7 +20024,7 @@ 248 | } `---- - x Percentage(PercentageToken { value: 100.0, raw: "100" }) + x Percentage { value: 100.0, raw: "100" } ,-[$DIR/tests/recovery/hacks/input.css:246:1] 246 | font-size/**/: big; 247 | $(var)-size: 100%; @@ -20146,7 +20146,7 @@ : ^ `---- - x Delim(DelimToken { value: '*' }) + x Delim { value: '*' } ,-[$DIR/tests/recovery/hacks/input.css:249:1] 249 | 250 | a{*b:c} @@ -20160,7 +20160,7 @@ : ^ `---- - x Ident(IdentToken { value: Atom('b' type=static), raw: "b" }) + x Ident { value: Atom('b' type=static), raw: "b" } ,-[$DIR/tests/recovery/hacks/input.css:249:1] 249 | 250 | a{*b:c} @@ -20188,7 +20188,7 @@ : ^ `---- - x Ident(IdentToken { value: Atom('c' type=inline), raw: "c" }) + x Ident { value: Atom('c' type=inline), raw: "c" } ,-[$DIR/tests/recovery/hacks/input.css:249:1] 249 | 250 | a{*b:c} diff --git a/crates/swc_css_parser/tests/recovery/ie-progid/span.swc-stderr b/crates/swc_css_parser/tests/recovery/ie-progid/span.swc-stderr index c7f374c66e0d..ebfb3d7676ab 100644 --- a/crates/swc_css_parser/tests/recovery/ie-progid/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/ie-progid/span.swc-stderr @@ -135,7 +135,7 @@ 3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); `---- - x Ident(IdentToken { value: Atom('progid' type=inline), raw: "progid" }) + x Ident { value: Atom('progid' type=inline), raw: "progid" } ,-[$DIR/tests/recovery/ie-progid/input.css:1:1] 1 | a { 2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0); @@ -167,7 +167,7 @@ 3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); `---- - x Ident(IdentToken { value: Atom('DXImageTransform' type=dynamic), raw: "DXImageTransform" }) + x Ident { value: Atom('DXImageTransform' type=dynamic), raw: "DXImageTransform" } ,-[$DIR/tests/recovery/ie-progid/input.css:1:1] 1 | a { 2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0); @@ -183,7 +183,7 @@ 3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); `---- - x Delim(DelimToken { value: '.' }) + x Delim { value: '.' } ,-[$DIR/tests/recovery/ie-progid/input.css:1:1] 1 | a { 2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0); @@ -199,7 +199,7 @@ 3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); `---- - x Ident(IdentToken { value: Atom('Microsoft' type=dynamic), raw: "Microsoft" }) + x Ident { value: Atom('Microsoft' type=dynamic), raw: "Microsoft" } ,-[$DIR/tests/recovery/ie-progid/input.css:1:1] 1 | a { 2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0); @@ -215,7 +215,7 @@ 3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); `---- - x Delim(DelimToken { value: '.' }) + x Delim { value: '.' } ,-[$DIR/tests/recovery/ie-progid/input.css:1:1] 1 | a { 2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0); @@ -255,7 +255,7 @@ 3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); `---- - x Ident(IdentToken { value: Atom('startColorstr' type=dynamic), raw: "startColorstr" }) + x Ident { value: Atom('startColorstr' type=dynamic), raw: "startColorstr" } ,-[$DIR/tests/recovery/ie-progid/input.css:1:1] 1 | a { 2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0); @@ -271,7 +271,7 @@ 3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); `---- - x Delim(DelimToken { value: '=' }) + x Delim { value: '=' } ,-[$DIR/tests/recovery/ie-progid/input.css:1:1] 1 | a { 2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0); @@ -287,7 +287,7 @@ 3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); `---- - x String(StringToken { value: Atom('#4f4f4f' type=inline), raw: "'#4f4f4f'" }) + x String { value: Atom('#4f4f4f' type=inline), raw: "'#4f4f4f'" } ,-[$DIR/tests/recovery/ie-progid/input.css:1:1] 1 | a { 2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0); @@ -319,7 +319,7 @@ 3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); `---- - x Ident(IdentToken { value: Atom('endColorstr' type=dynamic), raw: "endColorstr" }) + x Ident { value: Atom('endColorstr' type=dynamic), raw: "endColorstr" } ,-[$DIR/tests/recovery/ie-progid/input.css:1:1] 1 | a { 2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0); @@ -335,7 +335,7 @@ 3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); `---- - x Delim(DelimToken { value: '=' }) + x Delim { value: '=' } ,-[$DIR/tests/recovery/ie-progid/input.css:1:1] 1 | a { 2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0); @@ -351,7 +351,7 @@ 3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); `---- - x String(StringToken { value: Atom('#292929' type=inline), raw: "'#292929'" }) + x String { value: Atom('#292929' type=inline), raw: "'#292929'" } ,-[$DIR/tests/recovery/ie-progid/input.css:1:1] 1 | a { 2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0); @@ -383,7 +383,7 @@ 3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); `---- - x Ident(IdentToken { value: Atom('GradientType' type=dynamic), raw: "GradientType" }) + x Ident { value: Atom('GradientType' type=dynamic), raw: "GradientType" } ,-[$DIR/tests/recovery/ie-progid/input.css:1:1] 1 | a { 2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0); @@ -399,7 +399,7 @@ 3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); `---- - x Delim(DelimToken { value: '=' }) + x Delim { value: '=' } ,-[$DIR/tests/recovery/ie-progid/input.css:1:1] 1 | a { 2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0); @@ -415,7 +415,7 @@ 3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); `---- - x Number(NumberToken { value: 0.0, raw: "0", type_flag: Integer }) + x Number { value: 0.0, raw: "0", type_flag: Integer } ,-[$DIR/tests/recovery/ie-progid/input.css:1:1] 1 | a { 2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0); @@ -471,7 +471,7 @@ 4 | } `---- - x Ident(IdentToken { value: Atom('progid' type=inline), raw: "progid" }) + x Ident { value: Atom('progid' type=inline), raw: "progid" } ,-[$DIR/tests/recovery/ie-progid/input.css:2:1] 2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0); 3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); @@ -503,7 +503,7 @@ 4 | } `---- - x Ident(IdentToken { value: Atom('DXImageTransform' type=dynamic), raw: "DXImageTransform" }) + x Ident { value: Atom('DXImageTransform' type=dynamic), raw: "DXImageTransform" } ,-[$DIR/tests/recovery/ie-progid/input.css:2:1] 2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0); 3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); @@ -519,7 +519,7 @@ 4 | } `---- - x Delim(DelimToken { value: '.' }) + x Delim { value: '.' } ,-[$DIR/tests/recovery/ie-progid/input.css:2:1] 2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0); 3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); @@ -535,7 +535,7 @@ 4 | } `---- - x Ident(IdentToken { value: Atom('Microsoft' type=dynamic), raw: "Microsoft" }) + x Ident { value: Atom('Microsoft' type=dynamic), raw: "Microsoft" } ,-[$DIR/tests/recovery/ie-progid/input.css:2:1] 2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0); 3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); @@ -551,7 +551,7 @@ 4 | } `---- - x Delim(DelimToken { value: '.' }) + x Delim { value: '.' } ,-[$DIR/tests/recovery/ie-progid/input.css:2:1] 2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0); 3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); @@ -591,7 +591,7 @@ 4 | } `---- - x Ident(IdentToken { value: Atom('pixelradius' type=dynamic), raw: "pixelradius" }) + x Ident { value: Atom('pixelradius' type=dynamic), raw: "pixelradius" } ,-[$DIR/tests/recovery/ie-progid/input.css:2:1] 2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0); 3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); @@ -607,7 +607,7 @@ 4 | } `---- - x Delim(DelimToken { value: '=' }) + x Delim { value: '=' } ,-[$DIR/tests/recovery/ie-progid/input.css:2:1] 2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0); 3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); @@ -623,7 +623,7 @@ 4 | } `---- - x Number(NumberToken { value: 2.0, raw: "2", type_flag: Integer }) + x Number { value: 2.0, raw: "2", type_flag: Integer } ,-[$DIR/tests/recovery/ie-progid/input.css:2:1] 2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0); 3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); @@ -655,7 +655,7 @@ 4 | } `---- - x Ident(IdentToken { value: Atom('progid' type=inline), raw: "progid" }) + x Ident { value: Atom('progid' type=inline), raw: "progid" } ,-[$DIR/tests/recovery/ie-progid/input.css:2:1] 2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0); 3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); @@ -687,7 +687,7 @@ 4 | } `---- - x Ident(IdentToken { value: Atom('DXImageTransform' type=dynamic), raw: "DXImageTransform" }) + x Ident { value: Atom('DXImageTransform' type=dynamic), raw: "DXImageTransform" } ,-[$DIR/tests/recovery/ie-progid/input.css:2:1] 2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0); 3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); @@ -703,7 +703,7 @@ 4 | } `---- - x Delim(DelimToken { value: '.' }) + x Delim { value: '.' } ,-[$DIR/tests/recovery/ie-progid/input.css:2:1] 2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0); 3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); @@ -719,7 +719,7 @@ 4 | } `---- - x Ident(IdentToken { value: Atom('Microsoft' type=dynamic), raw: "Microsoft" }) + x Ident { value: Atom('Microsoft' type=dynamic), raw: "Microsoft" } ,-[$DIR/tests/recovery/ie-progid/input.css:2:1] 2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0); 3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); @@ -735,7 +735,7 @@ 4 | } `---- - x Delim(DelimToken { value: '.' }) + x Delim { value: '.' } ,-[$DIR/tests/recovery/ie-progid/input.css:2:1] 2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0); 3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); @@ -775,7 +775,7 @@ 4 | } `---- - x Ident(IdentToken { value: Atom('duration' type=dynamic), raw: "duration" }) + x Ident { value: Atom('duration' type=dynamic), raw: "duration" } ,-[$DIR/tests/recovery/ie-progid/input.css:2:1] 2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0); 3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); @@ -791,7 +791,7 @@ 4 | } `---- - x Delim(DelimToken { value: '=' }) + x Delim { value: '=' } ,-[$DIR/tests/recovery/ie-progid/input.css:2:1] 2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0); 3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); @@ -807,7 +807,7 @@ 4 | } `---- - x Number(NumberToken { value: 3.0, raw: "3", type_flag: Integer }) + x Number { value: 3.0, raw: "3", type_flag: Integer } ,-[$DIR/tests/recovery/ie-progid/input.css:2:1] 2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0); 3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); diff --git a/crates/swc_css_parser/tests/recovery/number/span.swc-stderr b/crates/swc_css_parser/tests/recovery/number/span.swc-stderr index d07c2a8da472..5d5cc60b6678 100644 --- a/crates/swc_css_parser/tests/recovery/number/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/number/span.swc-stderr @@ -181,7 +181,7 @@ 4 | prop2: 10 `---- - x Ident(IdentToken { value: Atom('prop1' type=inline), raw: "prop1" }) + x Ident { value: Atom('prop1' type=inline), raw: "prop1" } ,-[$DIR/tests/recovery/number/input.css:2:1] 2 | prop: 10.10px 3 | prop1: 10px @@ -261,7 +261,7 @@ 5 | prop3: 10.10 `---- - x Ident(IdentToken { value: Atom('prop2' type=inline), raw: "prop2" }) + x Ident { value: Atom('prop2' type=inline), raw: "prop2" } ,-[$DIR/tests/recovery/number/input.css:3:1] 3 | prop1: 10px 4 | prop2: 10 @@ -309,7 +309,7 @@ 5 | prop3: 10.10 `---- - x Number(NumberToken { value: 10.0, raw: "10", type_flag: Integer }) + x Number { value: 10.0, raw: "10", type_flag: Integer } ,-[$DIR/tests/recovery/number/input.css:3:1] 3 | prop1: 10px 4 | prop2: 10 @@ -341,7 +341,7 @@ 6 | } `---- - x Ident(IdentToken { value: Atom('prop3' type=inline), raw: "prop3" }) + x Ident { value: Atom('prop3' type=inline), raw: "prop3" } ,-[$DIR/tests/recovery/number/input.css:4:1] 4 | prop2: 10 5 | prop3: 10.10 @@ -389,7 +389,7 @@ 6 | } `---- - x Number(NumberToken { value: 10.1, raw: "10.10", type_flag: Number }) + x Number { value: 10.1, raw: "10.10", type_flag: Number } ,-[$DIR/tests/recovery/number/input.css:4:1] 4 | prop2: 10 5 | prop3: 10.10 diff --git a/crates/swc_css_parser/tests/recovery/qualified-rule/basic/span.swc-stderr b/crates/swc_css_parser/tests/recovery/qualified-rule/basic/span.swc-stderr index b307b6dccae4..9aea22a90930 100644 --- a/crates/swc_css_parser/tests/recovery/qualified-rule/basic/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/qualified-rule/basic/span.swc-stderr @@ -32,7 +32,7 @@ : ^ `---- - x Delim(DelimToken { value: '/' }) + x Delim { value: '/' } ,-[$DIR/tests/recovery/qualified-rule/basic/input.css:1:1] 1 | // test : ^ @@ -44,7 +44,7 @@ : ^ `---- - x Delim(DelimToken { value: '/' }) + x Delim { value: '/' } ,-[$DIR/tests/recovery/qualified-rule/basic/input.css:1:1] 1 | // test : ^ @@ -68,7 +68,7 @@ : ^^^^ `---- - x Ident(IdentToken { value: Atom('test' type=inline), raw: "test" }) + x Ident { value: Atom('test' type=inline), raw: "test" } ,-[$DIR/tests/recovery/qualified-rule/basic/input.css:1:1] 1 | // test : ^^^^ @@ -98,7 +98,7 @@ 4 | color: red; `---- - x Ident(IdentToken { value: Atom('a' type=static), raw: "a" }) + x Ident { value: Atom('a' type=static), raw: "a" } ,-[$DIR/tests/recovery/qualified-rule/basic/input.css:2:1] 2 | 3 | a { diff --git a/crates/swc_css_parser/tests/recovery/qualified-rule/double-slash-comment/span.swc-stderr b/crates/swc_css_parser/tests/recovery/qualified-rule/double-slash-comment/span.swc-stderr index 6845c8fcd410..004149f4604d 100644 --- a/crates/swc_css_parser/tests/recovery/qualified-rule/double-slash-comment/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/qualified-rule/double-slash-comment/span.swc-stderr @@ -30,7 +30,7 @@ 2 | a { `---- - x Delim(DelimToken { value: '/' }) + x Delim { value: '/' } ,-[$DIR/tests/recovery/qualified-rule/double-slash-comment/input.css:1:1] 1 | // test : ^ @@ -44,7 +44,7 @@ 2 | a { `---- - x Delim(DelimToken { value: '/' }) + x Delim { value: '/' } ,-[$DIR/tests/recovery/qualified-rule/double-slash-comment/input.css:1:1] 1 | // test : ^ @@ -72,7 +72,7 @@ 2 | a { `---- - x Ident(IdentToken { value: Atom('test' type=inline), raw: "test" }) + x Ident { value: Atom('test' type=inline), raw: "test" } ,-[$DIR/tests/recovery/qualified-rule/double-slash-comment/input.css:1:1] 1 | // test : ^^^^ @@ -103,7 +103,7 @@ 3 | color: red; `---- - x Ident(IdentToken { value: Atom('a' type=static), raw: "a" }) + x Ident { value: Atom('a' type=static), raw: "a" } ,-[$DIR/tests/recovery/qualified-rule/double-slash-comment/input.css:1:1] 1 | // test 2 | a { diff --git a/crates/swc_css_parser/tests/recovery/rules/at-rule-in-middle/span.swc-stderr b/crates/swc_css_parser/tests/recovery/rules/at-rule-in-middle/span.swc-stderr index d08528b9ae25..e09ac666e817 100644 --- a/crates/swc_css_parser/tests/recovery/rules/at-rule-in-middle/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/rules/at-rule-in-middle/span.swc-stderr @@ -211,7 +211,7 @@ : ^ `---- - x Ident(IdentToken { value: Atom('a' type=static), raw: "a" }) + x Ident { value: Atom('a' type=static), raw: "a" } ,-[$DIR/tests/recovery/rules/at-rule-in-middle/input.css:4:1] 4 | 5 | a { color: blue } diff --git a/crates/swc_css_parser/tests/recovery/rules/at-rule-with-semi/span.swc-stderr b/crates/swc_css_parser/tests/recovery/rules/at-rule-with-semi/span.swc-stderr index 1a37ac45abf3..4a149471f486 100644 --- a/crates/swc_css_parser/tests/recovery/rules/at-rule-with-semi/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/rules/at-rule-with-semi/span.swc-stderr @@ -91,7 +91,7 @@ : ^ `---- - x Ident(IdentToken { value: Atom('a' type=static), raw: "a" }) + x Ident { value: Atom('a' type=static), raw: "a" } ,-[$DIR/tests/recovery/rules/at-rule-with-semi/input.css:2:1] 2 | 3 | a { color: red } diff --git a/crates/swc_css_parser/tests/recovery/rules/unclosed-brackets/span.swc-stderr b/crates/swc_css_parser/tests/recovery/rules/unclosed-brackets/span.swc-stderr index 88382c19043d..6aae0fa43412 100644 --- a/crates/swc_css_parser/tests/recovery/rules/unclosed-brackets/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/rules/unclosed-brackets/span.swc-stderr @@ -27,7 +27,7 @@ : ^ `---- - x Delim(DelimToken { value: '.' }) + x Delim { value: '.' } ,-[$DIR/tests/recovery/rules/unclosed-brackets/input.css:1:1] 1 | .class[attr= { : ^ @@ -39,7 +39,7 @@ : ^^^^^ `---- - x Ident(IdentToken { value: Atom('class' type=static), raw: "class" }) + x Ident { value: Atom('class' type=static), raw: "class" } ,-[$DIR/tests/recovery/rules/unclosed-brackets/input.css:1:1] 1 | .class[attr= { : ^^^^^ @@ -79,7 +79,7 @@ : ^^^^ `---- - x Ident(IdentToken { value: Atom('attr' type=inline), raw: "attr" }) + x Ident { value: Atom('attr' type=inline), raw: "attr" } ,-[$DIR/tests/recovery/rules/unclosed-brackets/input.css:1:1] 1 | .class[attr= { : ^^^^ @@ -91,7 +91,7 @@ : ^ `---- - x Delim(DelimToken { value: '=' }) + x Delim { value: '=' } ,-[$DIR/tests/recovery/rules/unclosed-brackets/input.css:1:1] 1 | .class[attr= { : ^ @@ -166,7 +166,7 @@ : ^ `---- - x Delim(DelimToken { value: '.' }) + x Delim { value: '.' } ,-[$DIR/tests/recovery/rules/unclosed-brackets/input.css:4:1] 4 | 5 | .class { color: red } @@ -180,7 +180,7 @@ : ^^^^^ `---- - x Ident(IdentToken { value: Atom('class' type=static), raw: "class" }) + x Ident { value: Atom('class' type=static), raw: "class" } ,-[$DIR/tests/recovery/rules/unclosed-brackets/input.css:4:1] 4 | 5 | .class { color: red } @@ -243,7 +243,7 @@ : ^^^^^ `---- - x Ident(IdentToken { value: Atom('color' type=static), raw: "color" }) + x Ident { value: Atom('color' type=static), raw: "color" } ,-[$DIR/tests/recovery/rules/unclosed-brackets/input.css:4:1] 4 | 5 | .class { color: red } @@ -285,7 +285,7 @@ : ^^^ `---- - x Ident(IdentToken { value: Atom('red' type=inline), raw: "red" }) + x Ident { value: Atom('red' type=inline), raw: "red" } ,-[$DIR/tests/recovery/rules/unclosed-brackets/input.css:4:1] 4 | 5 | .class { color: red } @@ -329,7 +329,7 @@ : ^ `---- - x Delim(DelimToken { value: '.' }) + x Delim { value: '.' } ,-[$DIR/tests/recovery/rules/unclosed-brackets/input.css:6:1] 6 | 7 | .class { color: blue } @@ -343,7 +343,7 @@ : ^^^^^ `---- - x Ident(IdentToken { value: Atom('class' type=static), raw: "class" }) + x Ident { value: Atom('class' type=static), raw: "class" } ,-[$DIR/tests/recovery/rules/unclosed-brackets/input.css:6:1] 6 | 7 | .class { color: blue } @@ -406,7 +406,7 @@ : ^^^^^ `---- - x Ident(IdentToken { value: Atom('color' type=static), raw: "color" }) + x Ident { value: Atom('color' type=static), raw: "color" } ,-[$DIR/tests/recovery/rules/unclosed-brackets/input.css:6:1] 6 | 7 | .class { color: blue } @@ -448,7 +448,7 @@ : ^^^^ `---- - x Ident(IdentToken { value: Atom('blue' type=inline), raw: "blue" }) + x Ident { value: Atom('blue' type=inline), raw: "blue" } ,-[$DIR/tests/recovery/rules/unclosed-brackets/input.css:6:1] 6 | 7 | .class { color: blue } diff --git a/crates/swc_css_parser/tests/recovery/rules/unclosed-curly/span.swc-stderr b/crates/swc_css_parser/tests/recovery/rules/unclosed-curly/span.swc-stderr index ad2f879ed3b4..621b003cf395 100644 --- a/crates/swc_css_parser/tests/recovery/rules/unclosed-curly/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/rules/unclosed-curly/span.swc-stderr @@ -28,7 +28,7 @@ : ^^^^ `---- - x Ident(IdentToken { value: Atom('test' type=inline), raw: "test" }) + x Ident { value: Atom('test' type=inline), raw: "test" } ,-[$DIR/tests/recovery/rules/unclosed-curly/input.css:1:1] 1 | test}; : ^^^^ @@ -79,7 +79,7 @@ : ^ `---- - x Ident(IdentToken { value: Atom('a' type=static), raw: "a" }) + x Ident { value: Atom('a' type=static), raw: "a" } ,-[$DIR/tests/recovery/rules/unclosed-curly/input.css:2:1] 2 | 3 | a { color: red } diff --git a/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-matcher-1/span.swc-stderr b/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-matcher-1/span.swc-stderr index 5745901253e2..b79a20fff552 100644 --- a/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-matcher-1/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-matcher-1/span.swc-stderr @@ -41,7 +41,7 @@ : ^^^^ `---- - x Ident(IdentToken { value: Atom('href' type=static), raw: "href" }) + x Ident { value: Atom('href' type=static), raw: "href" } ,-[$DIR/tests/recovery/selector/attribute/invalid-matcher-1/input.css:1:1] 1 | [href=] {} : ^^^^ @@ -53,7 +53,7 @@ : ^ `---- - x Delim(DelimToken { value: '=' }) + x Delim { value: '=' } ,-[$DIR/tests/recovery/selector/attribute/invalid-matcher-1/input.css:1:1] 1 | [href=] {} : ^ diff --git a/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-matcher-2/span.swc-stderr b/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-matcher-2/span.swc-stderr index bf7d5225d48e..e9d31d663882 100644 --- a/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-matcher-2/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-matcher-2/span.swc-stderr @@ -41,7 +41,7 @@ : ^^^^ `---- - x Ident(IdentToken { value: Atom('href' type=static), raw: "href" }) + x Ident { value: Atom('href' type=static), raw: "href" } ,-[$DIR/tests/recovery/selector/attribute/invalid-matcher-2/input.css:1:1] 1 | [href#="test"] {} : ^^^^ @@ -53,7 +53,7 @@ : ^ `---- - x Delim(DelimToken { value: '#' }) + x Delim { value: '#' } ,-[$DIR/tests/recovery/selector/attribute/invalid-matcher-2/input.css:1:1] 1 | [href#="test"] {} : ^ @@ -65,7 +65,7 @@ : ^ `---- - x Delim(DelimToken { value: '=' }) + x Delim { value: '=' } ,-[$DIR/tests/recovery/selector/attribute/invalid-matcher-2/input.css:1:1] 1 | [href#="test"] {} : ^ @@ -77,7 +77,7 @@ : ^^^^^^ `---- - x String(StringToken { value: Atom('test' type=inline), raw: "\"test\"" }) + x String { value: Atom('test' type=inline), raw: "\"test\"" } ,-[$DIR/tests/recovery/selector/attribute/invalid-matcher-2/input.css:1:1] 1 | [href#="test"] {} : ^^^^^^ diff --git a/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-matcher-3/span.swc-stderr b/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-matcher-3/span.swc-stderr index 895b879697da..900cabe4ced0 100644 --- a/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-matcher-3/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-matcher-3/span.swc-stderr @@ -27,7 +27,7 @@ 2 | color: purple; `---- - x Ident(IdentToken { value: Atom('a' type=static), raw: "a" }) + x Ident { value: Atom('a' type=static), raw: "a" } ,-[$DIR/tests/recovery/selector/attribute/invalid-matcher-3/input.css:1:1] 1 | a[title * = "title" i ] { : ^ @@ -62,7 +62,7 @@ 2 | color: purple; `---- - x Ident(IdentToken { value: Atom('title' type=static), raw: "title" }) + x Ident { value: Atom('title' type=static), raw: "title" } ,-[$DIR/tests/recovery/selector/attribute/invalid-matcher-3/input.css:1:1] 1 | a[title * = "title" i ] { : ^^^^^ @@ -90,7 +90,7 @@ 2 | color: purple; `---- - x Delim(DelimToken { value: '*' }) + x Delim { value: '*' } ,-[$DIR/tests/recovery/selector/attribute/invalid-matcher-3/input.css:1:1] 1 | a[title * = "title" i ] { : ^ @@ -118,7 +118,7 @@ 2 | color: purple; `---- - x Delim(DelimToken { value: '=' }) + x Delim { value: '=' } ,-[$DIR/tests/recovery/selector/attribute/invalid-matcher-3/input.css:1:1] 1 | a[title * = "title" i ] { : ^ @@ -146,7 +146,7 @@ 2 | color: purple; `---- - x String(StringToken { value: Atom('title' type=static), raw: "\"title\"" }) + x String { value: Atom('title' type=static), raw: "\"title\"" } ,-[$DIR/tests/recovery/selector/attribute/invalid-matcher-3/input.css:1:1] 1 | a[title * = "title" i ] { : ^^^^^^^ @@ -174,7 +174,7 @@ 2 | color: purple; `---- - x Ident(IdentToken { value: Atom('i' type=static), raw: "i" }) + x Ident { value: Atom('i' type=static), raw: "i" } ,-[$DIR/tests/recovery/selector/attribute/invalid-matcher-3/input.css:1:1] 1 | a[title * = "title" i ] { : ^ diff --git a/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-matcher-4/span.swc-stderr b/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-matcher-4/span.swc-stderr index 3954b6bd639b..ee13b9ccddce 100644 --- a/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-matcher-4/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-matcher-4/span.swc-stderr @@ -27,7 +27,7 @@ 2 | color: purple; `---- - x Ident(IdentToken { value: Atom('a' type=static), raw: "a" }) + x Ident { value: Atom('a' type=static), raw: "a" } ,-[$DIR/tests/recovery/selector/attribute/invalid-matcher-4/input.css:1:1] 1 | a[title%="title"] { : ^ @@ -62,7 +62,7 @@ 2 | color: purple; `---- - x Ident(IdentToken { value: Atom('title' type=static), raw: "title" }) + x Ident { value: Atom('title' type=static), raw: "title" } ,-[$DIR/tests/recovery/selector/attribute/invalid-matcher-4/input.css:1:1] 1 | a[title%="title"] { : ^^^^^ @@ -76,7 +76,7 @@ 2 | color: purple; `---- - x Delim(DelimToken { value: '%' }) + x Delim { value: '%' } ,-[$DIR/tests/recovery/selector/attribute/invalid-matcher-4/input.css:1:1] 1 | a[title%="title"] { : ^ @@ -90,7 +90,7 @@ 2 | color: purple; `---- - x Delim(DelimToken { value: '=' }) + x Delim { value: '=' } ,-[$DIR/tests/recovery/selector/attribute/invalid-matcher-4/input.css:1:1] 1 | a[title%="title"] { : ^ @@ -104,7 +104,7 @@ 2 | color: purple; `---- - x String(StringToken { value: Atom('title' type=static), raw: "\"title\"" }) + x String { value: Atom('title' type=static), raw: "\"title\"" } ,-[$DIR/tests/recovery/selector/attribute/invalid-matcher-4/input.css:1:1] 1 | a[title%="title"] { : ^^^^^^^ diff --git a/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-matcher/span.swc-stderr b/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-matcher/span.swc-stderr index 53ea0ab902ad..f6e817b15666 100644 --- a/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-matcher/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-matcher/span.swc-stderr @@ -41,7 +41,7 @@ : ^^^^ `---- - x Ident(IdentToken { value: Atom('href' type=static), raw: "href" }) + x Ident { value: Atom('href' type=static), raw: "href" } ,-[$DIR/tests/recovery/selector/attribute/invalid-matcher/input.css:1:1] 1 | [href==".org"] {} : ^^^^ @@ -53,7 +53,7 @@ : ^ `---- - x Delim(DelimToken { value: '=' }) + x Delim { value: '=' } ,-[$DIR/tests/recovery/selector/attribute/invalid-matcher/input.css:1:1] 1 | [href==".org"] {} : ^ @@ -65,7 +65,7 @@ : ^ `---- - x Delim(DelimToken { value: '=' }) + x Delim { value: '=' } ,-[$DIR/tests/recovery/selector/attribute/invalid-matcher/input.css:1:1] 1 | [href==".org"] {} : ^ @@ -77,7 +77,7 @@ : ^^^^^^ `---- - x String(StringToken { value: Atom('.org' type=inline), raw: "\".org\"" }) + x String { value: Atom('.org' type=inline), raw: "\".org\"" } ,-[$DIR/tests/recovery/selector/attribute/invalid-matcher/input.css:1:1] 1 | [href==".org"] {} : ^^^^^^ diff --git a/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-modifier/span.swc-stderr b/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-modifier/span.swc-stderr index 62341610cbce..7eb2e0530b34 100644 --- a/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-modifier/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/selector/attribute/invalid-modifier/span.swc-stderr @@ -41,7 +41,7 @@ : ^^^^ `---- - x Ident(IdentToken { value: Atom('href' type=static), raw: "href" }) + x Ident { value: Atom('href' type=static), raw: "href" } ,-[$DIR/tests/recovery/selector/attribute/invalid-modifier/input.css:1:1] 1 | [href="test" "z"] {} : ^^^^ @@ -53,7 +53,7 @@ : ^ `---- - x Delim(DelimToken { value: '=' }) + x Delim { value: '=' } ,-[$DIR/tests/recovery/selector/attribute/invalid-modifier/input.css:1:1] 1 | [href="test" "z"] {} : ^ @@ -65,7 +65,7 @@ : ^^^^^^ `---- - x String(StringToken { value: Atom('test' type=inline), raw: "\"test\"" }) + x String { value: Atom('test' type=inline), raw: "\"test\"" } ,-[$DIR/tests/recovery/selector/attribute/invalid-modifier/input.css:1:1] 1 | [href="test" "z"] {} : ^^^^^^ @@ -89,7 +89,7 @@ : ^^^ `---- - x String(StringToken { value: Atom('z' type=inline), raw: "\"z\"" }) + x String { value: Atom('z' type=inline), raw: "\"z\"" } ,-[$DIR/tests/recovery/selector/attribute/invalid-modifier/input.css:1:1] 1 | [href="test" "z"] {} : ^^^ diff --git a/crates/swc_css_parser/tests/recovery/selector/attribute/unclosed/span.swc-stderr b/crates/swc_css_parser/tests/recovery/selector/attribute/unclosed/span.swc-stderr index 30776fd316d8..4c53407d39b1 100644 --- a/crates/swc_css_parser/tests/recovery/selector/attribute/unclosed/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/selector/attribute/unclosed/span.swc-stderr @@ -19,7 +19,7 @@ : ^ `---- - x Delim(DelimToken { value: '.' }) + x Delim { value: '.' } ,-[$DIR/tests/recovery/selector/attribute/unclosed/input.css:1:1] 1 | .class[attr= { : ^ @@ -31,7 +31,7 @@ : ^^^^^ `---- - x Ident(IdentToken { value: Atom('class' type=static), raw: "class" }) + x Ident { value: Atom('class' type=static), raw: "class" } ,-[$DIR/tests/recovery/selector/attribute/unclosed/input.css:1:1] 1 | .class[attr= { : ^^^^^ @@ -63,7 +63,7 @@ : ^^^^ `---- - x Ident(IdentToken { value: Atom('attr' type=inline), raw: "attr" }) + x Ident { value: Atom('attr' type=inline), raw: "attr" } ,-[$DIR/tests/recovery/selector/attribute/unclosed/input.css:1:1] 1 | .class[attr= { : ^^^^ @@ -75,7 +75,7 @@ : ^ `---- - x Delim(DelimToken { value: '=' }) + x Delim { value: '=' } ,-[$DIR/tests/recovery/selector/attribute/unclosed/input.css:1:1] 1 | .class[attr= { : ^ diff --git a/crates/swc_css_parser/tests/recovery/selector/combinator/only/span.swc-stderr b/crates/swc_css_parser/tests/recovery/selector/combinator/only/span.swc-stderr index d3fa9346ac74..a887c1b15036 100644 --- a/crates/swc_css_parser/tests/recovery/selector/combinator/only/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/selector/combinator/only/span.swc-stderr @@ -26,7 +26,7 @@ : ^ `---- - x Delim(DelimToken { value: '>' }) + x Delim { value: '>' } ,-[$DIR/tests/recovery/selector/combinator/only/input.css:1:1] 1 | > { : ^ diff --git a/crates/swc_css_parser/tests/recovery/selector/combinator/two/span.swc-stderr b/crates/swc_css_parser/tests/recovery/selector/combinator/two/span.swc-stderr index 0103d6487b26..48af46492cf3 100644 --- a/crates/swc_css_parser/tests/recovery/selector/combinator/two/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/selector/combinator/two/span.swc-stderr @@ -23,7 +23,7 @@ : ^^^^ `---- - x Ident(IdentToken { value: Atom('span' type=static), raw: "span" }) + x Ident { value: Atom('span' type=static), raw: "span" } ,-[$DIR/tests/recovery/selector/combinator/two/input.css:1:1] 1 | span ~ + {} : ^^^^ @@ -47,7 +47,7 @@ : ^ `---- - x Delim(DelimToken { value: '~' }) + x Delim { value: '~' } ,-[$DIR/tests/recovery/selector/combinator/two/input.css:1:1] 1 | span ~ + {} : ^ @@ -71,7 +71,7 @@ : ^ `---- - x Delim(DelimToken { value: '+' }) + x Delim { value: '+' } ,-[$DIR/tests/recovery/selector/combinator/two/input.css:1:1] 1 | span ~ + {} : ^ diff --git a/crates/swc_css_parser/tests/recovery/selector/id/invalid/span.swc-stderr b/crates/swc_css_parser/tests/recovery/selector/id/invalid/span.swc-stderr index b561150bd8c9..ed166dfe4d48 100644 --- a/crates/swc_css_parser/tests/recovery/selector/id/invalid/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/selector/id/invalid/span.swc-stderr @@ -26,7 +26,7 @@ : ^^^^^ `---- - x Hash(HashToken { is_id: false, value: Atom('1234' type=inline), raw: "1234" }) + x Hash { is_id: false, value: Atom('1234' type=inline), raw: "1234" } ,-[$DIR/tests/recovery/selector/id/invalid/input.css:1:1] 1 | #1234 { : ^^^^^ diff --git a/crates/swc_css_parser/tests/recovery/selector/pseudo-class/an-plus-b/span.swc-stderr b/crates/swc_css_parser/tests/recovery/selector/pseudo-class/an-plus-b/span.swc-stderr index ca250c1cd4d4..a0c91692c3f3 100644 --- a/crates/swc_css_parser/tests/recovery/selector/pseudo-class/an-plus-b/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/selector/pseudo-class/an-plus-b/span.swc-stderr @@ -59,7 +59,7 @@ : ^^^^^^^ `---- - x Ident(IdentToken { value: Atom('unknown' type=static), raw: "unknown" }) + x Ident { value: Atom('unknown' type=static), raw: "unknown" } ,-[$DIR/tests/recovery/selector/pseudo-class/an-plus-b/input.css:1:1] 1 | :nth-child(unknown) {} : ^^^^^^^ diff --git a/crates/swc_css_parser/tests/recovery/selector/pseudo-class/invalid-function/span.swc-stderr b/crates/swc_css_parser/tests/recovery/selector/pseudo-class/invalid-function/span.swc-stderr index 1994da77f681..7e95401a0323 100644 --- a/crates/swc_css_parser/tests/recovery/selector/pseudo-class/invalid-function/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/selector/pseudo-class/invalid-function/span.swc-stderr @@ -68,7 +68,7 @@ : ^ `---- - x Number(NumberToken { value: 2.0, raw: "2", type_flag: Integer }) + x Number { value: 2.0, raw: "2", type_flag: Integer } ,-[$DIR/tests/recovery/selector/pseudo-class/invalid-function/input.css:1:1] 1 | : nth-child(2) { : ^ diff --git a/crates/swc_css_parser/tests/recovery/selector/pseudo-class/invalid-ident/span.swc-stderr b/crates/swc_css_parser/tests/recovery/selector/pseudo-class/invalid-ident/span.swc-stderr index fb28840e4e50..acbb87bb3195 100644 --- a/crates/swc_css_parser/tests/recovery/selector/pseudo-class/invalid-ident/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/selector/pseudo-class/invalid-ident/span.swc-stderr @@ -55,7 +55,7 @@ 2 | `---- - x Ident(IdentToken { value: Atom('first-child' type=static), raw: "first-child" }) + x Ident { value: Atom('first-child' type=static), raw: "first-child" } ,-[$DIR/tests/recovery/selector/pseudo-class/invalid-ident/input.css:1:1] 1 | : first-child { : ^^^^^^^^^^^ diff --git a/crates/swc_css_parser/tests/recovery/selector/pseudo-class/invalid/span.swc-stderr b/crates/swc_css_parser/tests/recovery/selector/pseudo-class/invalid/span.swc-stderr index e9c7fc5cb381..d6cb6aeb9567 100644 --- a/crates/swc_css_parser/tests/recovery/selector/pseudo-class/invalid/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/selector/pseudo-class/invalid/span.swc-stderr @@ -26,7 +26,7 @@ : ^ `---- - x Ident(IdentToken { value: Atom('a' type=static), raw: "a" }) + x Ident { value: Atom('a' type=static), raw: "a" } ,-[$DIR/tests/recovery/selector/pseudo-class/invalid/input.css:1:1] 1 | a: b {} : ^ @@ -62,7 +62,7 @@ : ^ `---- - x Ident(IdentToken { value: Atom('b' type=static), raw: "b" }) + x Ident { value: Atom('b' type=static), raw: "b" } ,-[$DIR/tests/recovery/selector/pseudo-class/invalid/input.css:1:1] 1 | a: b {} : ^ @@ -116,7 +116,7 @@ 4 | color: red; `---- - x Ident(IdentToken { value: Atom('a' type=static), raw: "a" }) + x Ident { value: Atom('a' type=static), raw: "a" } ,-[$DIR/tests/recovery/selector/pseudo-class/invalid/input.css:2:1] 2 | 3 | a: b { @@ -164,7 +164,7 @@ 4 | color: red; `---- - x Ident(IdentToken { value: Atom('b' type=static), raw: "b" }) + x Ident { value: Atom('b' type=static), raw: "b" } ,-[$DIR/tests/recovery/selector/pseudo-class/invalid/input.css:2:1] 2 | 3 | a: b { diff --git a/crates/swc_css_parser/tests/recovery/selector/pseudo-element/after/span.swc-stderr b/crates/swc_css_parser/tests/recovery/selector/pseudo-element/after/span.swc-stderr index 768e5528bedd..94380c911f0c 100644 --- a/crates/swc_css_parser/tests/recovery/selector/pseudo-element/after/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/selector/pseudo-element/after/span.swc-stderr @@ -69,7 +69,7 @@ 2 | `---- - x Ident(IdentToken { value: Atom('foo' type=inline), raw: "foo" }) + x Ident { value: Atom('foo' type=inline), raw: "foo" } ,-[$DIR/tests/recovery/selector/pseudo-element/after/input.css:1:1] 1 | :: foo { : ^^^ diff --git a/crates/swc_css_parser/tests/recovery/selector/pseudo-element/between/span.swc-stderr b/crates/swc_css_parser/tests/recovery/selector/pseudo-element/between/span.swc-stderr index a835f8cd47ea..aeb700e337f3 100644 --- a/crates/swc_css_parser/tests/recovery/selector/pseudo-element/between/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/selector/pseudo-element/between/span.swc-stderr @@ -69,7 +69,7 @@ 2 | `---- - x Ident(IdentToken { value: Atom('foo' type=inline), raw: "foo" }) + x Ident { value: Atom('foo' type=inline), raw: "foo" } ,-[$DIR/tests/recovery/selector/pseudo-element/between/input.css:1:1] 1 | : :foo { : ^^^ diff --git a/crates/swc_css_parser/tests/recovery/selector/pseudo-element/invalid/span.swc-stderr b/crates/swc_css_parser/tests/recovery/selector/pseudo-element/invalid/span.swc-stderr index 3d7ededd9062..ef7b7f4776b9 100644 --- a/crates/swc_css_parser/tests/recovery/selector/pseudo-element/invalid/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/selector/pseudo-element/invalid/span.swc-stderr @@ -24,7 +24,7 @@ 2 | } `---- - x Ident(IdentToken { value: Atom('a' type=static), raw: "a" }) + x Ident { value: Atom('a' type=static), raw: "a" } ,-[$DIR/tests/recovery/selector/pseudo-element/invalid/input.css:1:1] 1 | a::1 { : ^ @@ -66,7 +66,7 @@ 2 | } `---- - x Number(NumberToken { value: 1.0, raw: "1", type_flag: Integer }) + x Number { value: 1.0, raw: "1", type_flag: Integer } ,-[$DIR/tests/recovery/selector/pseudo-element/invalid/input.css:1:1] 1 | a::1 { : ^ diff --git a/crates/swc_css_parser/tests/recovery/style-blocks-contents/basic/span.swc-stderr b/crates/swc_css_parser/tests/recovery/style-blocks-contents/basic/span.swc-stderr index f76b4af878db..36e181e91ff9 100644 --- a/crates/swc_css_parser/tests/recovery/style-blocks-contents/basic/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/style-blocks-contents/basic/span.swc-stderr @@ -343,7 +343,7 @@ 6 | color: green; `---- - x Ident(IdentToken { value: Atom('ident' type=inline), raw: "ident" }) + x Ident { value: Atom('ident' type=inline), raw: "ident" } ,-[$DIR/tests/recovery/style-blocks-contents/basic/input.css:4:1] 4 | &.foo { 5 | ident @@ -375,7 +375,7 @@ 7 | } `---- - x Ident(IdentToken { value: Atom('color' type=static), raw: "color" }) + x Ident { value: Atom('color' type=static), raw: "color" } ,-[$DIR/tests/recovery/style-blocks-contents/basic/input.css:5:1] 5 | ident 6 | color: green; @@ -423,7 +423,7 @@ 7 | } `---- - x Ident(IdentToken { value: Atom('green' type=inline), raw: "green" }) + x Ident { value: Atom('green' type=inline), raw: "green" } ,-[$DIR/tests/recovery/style-blocks-contents/basic/input.css:5:1] 5 | ident 6 | color: green; @@ -818,7 +818,7 @@ 14 | color: red `---- - x Ident(IdentToken { value: Atom('ident' type=inline), raw: "ident" }) + x Ident { value: Atom('ident' type=inline), raw: "ident" } ,-[$DIR/tests/recovery/style-blocks-contents/basic/input.css:12:1] 12 | & .class { 13 | ident @@ -850,7 +850,7 @@ 15 | } `---- - x Ident(IdentToken { value: Atom('color' type=static), raw: "color" }) + x Ident { value: Atom('color' type=static), raw: "color" } ,-[$DIR/tests/recovery/style-blocks-contents/basic/input.css:13:1] 13 | ident 14 | color: red @@ -898,7 +898,7 @@ 15 | } `---- - x Ident(IdentToken { value: Atom('red' type=inline), raw: "red" }) + x Ident { value: Atom('red' type=inline), raw: "red" } ,-[$DIR/tests/recovery/style-blocks-contents/basic/input.css:13:1] 13 | ident 14 | color: red @@ -1225,7 +1225,7 @@ 24 | color: green; `---- - x Ident(IdentToken { value: Atom('ident' type=inline), raw: "ident" }) + x Ident { value: Atom('ident' type=inline), raw: "ident" } ,-[$DIR/tests/recovery/style-blocks-contents/basic/input.css:22:1] 22 | &.foo { 23 | ident; @@ -1674,7 +1674,7 @@ 32 | color: red `---- - x Ident(IdentToken { value: Atom('ident' type=inline), raw: "ident" }) + x Ident { value: Atom('ident' type=inline), raw: "ident" } ,-[$DIR/tests/recovery/style-blocks-contents/basic/input.css:30:1] 30 | & .class { 31 | ident; @@ -1917,7 +1917,7 @@ 40 | } `---- - x Delim(DelimToken { value: '&' }) + x Delim { value: '&' } ,-[$DIR/tests/recovery/style-blocks-contents/basic/input.css:38:1] 38 | color: red; 39 | & test; @@ -1949,7 +1949,7 @@ 40 | } `---- - x Ident(IdentToken { value: Atom('test' type=inline), raw: "test" }) + x Ident { value: Atom('test' type=inline), raw: "test" } ,-[$DIR/tests/recovery/style-blocks-contents/basic/input.css:38:1] 38 | color: red; 39 | & test; @@ -2191,7 +2191,7 @@ 46 | } `---- - x Ident(IdentToken { value: Atom('__ident__' type=dynamic), raw: "__ident__" }) + x Ident { value: Atom('__ident__' type=dynamic), raw: "__ident__" } ,-[$DIR/tests/recovery/style-blocks-contents/basic/input.css:44:1] 44 | &.foo { 45 | __ident__ diff --git a/crates/swc_css_parser/tests/recovery/style-blocks-contents/invalid-nested-1/span.swc-stderr b/crates/swc_css_parser/tests/recovery/style-blocks-contents/invalid-nested-1/span.swc-stderr index 9dceed9a1105..e52853f25e98 100644 --- a/crates/swc_css_parser/tests/recovery/style-blocks-contents/invalid-nested-1/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/style-blocks-contents/invalid-nested-1/span.swc-stderr @@ -174,7 +174,7 @@ 5 | margin: 1em; `---- - x Ident(IdentToken { value: Atom('input' type=static), raw: "input" }) + x Ident { value: Atom('input' type=static), raw: "input" } ,-[$DIR/tests/recovery/style-blocks-contents/invalid-nested-1/input.css:3:1] 3 | 4 | input { @@ -248,7 +248,7 @@ 6 | } `---- - x Ident(IdentToken { value: Atom('margin' type=static), raw: "margin" }) + x Ident { value: Atom('margin' type=static), raw: "margin" } ,-[$DIR/tests/recovery/style-blocks-contents/invalid-nested-1/input.css:4:1] 4 | input { 5 | margin: 1em; diff --git a/crates/swc_css_parser/tests/recovery/style-blocks-contents/invalid-nested-2/span.swc-stderr b/crates/swc_css_parser/tests/recovery/style-blocks-contents/invalid-nested-2/span.swc-stderr index 905071627a3a..27ff4f837baa 100644 --- a/crates/swc_css_parser/tests/recovery/style-blocks-contents/invalid-nested-2/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/style-blocks-contents/invalid-nested-2/span.swc-stderr @@ -171,7 +171,7 @@ 4 | background: red `---- - x Delim(DelimToken { value: '&' }) + x Delim { value: '&' } ,-[$DIR/tests/recovery/style-blocks-contents/invalid-nested-2/input.css:2:1] 2 | color: red; 3 | & test; @@ -203,7 +203,7 @@ 4 | background: red `---- - x Ident(IdentToken { value: Atom('test' type=inline), raw: "test" }) + x Ident { value: Atom('test' type=inline), raw: "test" } ,-[$DIR/tests/recovery/style-blocks-contents/invalid-nested-2/input.css:2:1] 2 | color: red; 3 | & test; diff --git a/crates/swc_css_parser/tests/recovery/style-blocks-contents/invalid-nested/span.swc-stderr b/crates/swc_css_parser/tests/recovery/style-blocks-contents/invalid-nested/span.swc-stderr index 6ffb6e566110..52f872b9da20 100644 --- a/crates/swc_css_parser/tests/recovery/style-blocks-contents/invalid-nested/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/style-blocks-contents/invalid-nested/span.swc-stderr @@ -171,7 +171,7 @@ 4 | background: red; `---- - x Delim(DelimToken { value: '&' }) + x Delim { value: '&' } ,-[$DIR/tests/recovery/style-blocks-contents/invalid-nested/input.css:2:1] 2 | color: red; 3 | & test; @@ -203,7 +203,7 @@ 4 | background: red; `---- - x Ident(IdentToken { value: Atom('test' type=inline), raw: "test" }) + x Ident { value: Atom('test' type=inline), raw: "test" } ,-[$DIR/tests/recovery/style-blocks-contents/invalid-nested/input.css:2:1] 2 | color: red; 3 | & test; diff --git a/crates/swc_css_parser/tests/recovery/styled-jsx/1/span.swc-stderr b/crates/swc_css_parser/tests/recovery/styled-jsx/1/span.swc-stderr index b8ef7199d8c8..f921ec8cdd7b 100644 --- a/crates/swc_css_parser/tests/recovery/styled-jsx/1/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/styled-jsx/1/span.swc-stderr @@ -389,7 +389,7 @@ 8 | padding: __styled-jsx-placeholder__1; `---- - x Delim(DelimToken { value: '>' }) + x Delim { value: '>' } ,-[$DIR/tests/recovery/styled-jsx/1/input.css:6:1] 6 | 7 | .removed-214123 :global(> .removed-214123-item) { @@ -421,7 +421,7 @@ 8 | padding: __styled-jsx-placeholder__1; `---- - x Delim(DelimToken { value: '.' }) + x Delim { value: '.' } ,-[$DIR/tests/recovery/styled-jsx/1/input.css:6:1] 6 | 7 | .removed-214123 :global(> .removed-214123-item) { @@ -437,7 +437,7 @@ 8 | padding: __styled-jsx-placeholder__1; `---- - x Ident(IdentToken { value: Atom('removed-214123-item' type=dynamic), raw: "removed-214123-item" }) + x Ident { value: Atom('removed-214123-item' type=dynamic), raw: "removed-214123-item" } ,-[$DIR/tests/recovery/styled-jsx/1/input.css:6:1] 6 | 7 | .removed-214123 :global(> .removed-214123-item) { @@ -624,7 +624,7 @@ 11 | min-width: 0; `---- - x Ident(IdentToken { value: Atom('__styled-jsx-placeholder__2' type=dynamic), raw: "__styled-jsx-placeholder__2" }) + x Ident { value: Atom('__styled-jsx-placeholder__2' type=dynamic), raw: "__styled-jsx-placeholder__2" } ,-[$DIR/tests/recovery/styled-jsx/1/input.css:9:1] 9 | flex-grow: 0; 10 | flex-basis: __styled-jsx-placeholder__2%; @@ -640,7 +640,7 @@ 11 | min-width: 0; `---- - x Delim(DelimToken { value: '%' }) + x Delim { value: '%' } ,-[$DIR/tests/recovery/styled-jsx/1/input.css:9:1] 9 | flex-grow: 0; 10 | flex-basis: __styled-jsx-placeholder__2%; @@ -913,7 +913,7 @@ 16 | flex-basis: __styled-jsx-placeholder__3%; `---- - x Delim(DelimToken { value: '>' }) + x Delim { value: '>' } ,-[$DIR/tests/recovery/styled-jsx/1/input.css:14:1] 14 | @media screen { 15 | .removed-214123 :global(> .removed-214123-item) { @@ -945,7 +945,7 @@ 16 | flex-basis: __styled-jsx-placeholder__3%; `---- - x Delim(DelimToken { value: '.' }) + x Delim { value: '.' } ,-[$DIR/tests/recovery/styled-jsx/1/input.css:14:1] 14 | @media screen { 15 | .removed-214123 :global(> .removed-214123-item) { @@ -961,7 +961,7 @@ 16 | flex-basis: __styled-jsx-placeholder__3%; `---- - x Ident(IdentToken { value: Atom('removed-214123-item' type=dynamic), raw: "removed-214123-item" }) + x Ident { value: Atom('removed-214123-item' type=dynamic), raw: "removed-214123-item" } ,-[$DIR/tests/recovery/styled-jsx/1/input.css:14:1] 14 | @media screen { 15 | .removed-214123 :global(> .removed-214123-item) { @@ -1034,7 +1034,7 @@ 17 | } `---- - x Ident(IdentToken { value: Atom('__styled-jsx-placeholder__3' type=dynamic), raw: "__styled-jsx-placeholder__3" }) + x Ident { value: Atom('__styled-jsx-placeholder__3' type=dynamic), raw: "__styled-jsx-placeholder__3" } ,-[$DIR/tests/recovery/styled-jsx/1/input.css:15:1] 15 | .removed-214123 :global(> .removed-214123-item) { 16 | flex-basis: __styled-jsx-placeholder__3%; @@ -1050,7 +1050,7 @@ 17 | } `---- - x Delim(DelimToken { value: '%' }) + x Delim { value: '%' } ,-[$DIR/tests/recovery/styled-jsx/1/input.css:15:1] 15 | .removed-214123 :global(> .removed-214123-item) { 16 | flex-basis: __styled-jsx-placeholder__3%; @@ -1267,7 +1267,7 @@ 22 | flex-basis: __styled-jsx-placeholder__4%; `---- - x Delim(DelimToken { value: '>' }) + x Delim { value: '>' } ,-[$DIR/tests/recovery/styled-jsx/1/input.css:20:1] 20 | @media screen { 21 | .removed-214123 :global(> .removed-214123-item) { @@ -1299,7 +1299,7 @@ 22 | flex-basis: __styled-jsx-placeholder__4%; `---- - x Delim(DelimToken { value: '.' }) + x Delim { value: '.' } ,-[$DIR/tests/recovery/styled-jsx/1/input.css:20:1] 20 | @media screen { 21 | .removed-214123 :global(> .removed-214123-item) { @@ -1315,7 +1315,7 @@ 22 | flex-basis: __styled-jsx-placeholder__4%; `---- - x Ident(IdentToken { value: Atom('removed-214123-item' type=dynamic), raw: "removed-214123-item" }) + x Ident { value: Atom('removed-214123-item' type=dynamic), raw: "removed-214123-item" } ,-[$DIR/tests/recovery/styled-jsx/1/input.css:20:1] 20 | @media screen { 21 | .removed-214123 :global(> .removed-214123-item) { @@ -1388,7 +1388,7 @@ 23 | } `---- - x Ident(IdentToken { value: Atom('__styled-jsx-placeholder__4' type=dynamic), raw: "__styled-jsx-placeholder__4" }) + x Ident { value: Atom('__styled-jsx-placeholder__4' type=dynamic), raw: "__styled-jsx-placeholder__4" } ,-[$DIR/tests/recovery/styled-jsx/1/input.css:21:1] 21 | .removed-214123 :global(> .removed-214123-item) { 22 | flex-basis: __styled-jsx-placeholder__4%; @@ -1404,7 +1404,7 @@ 23 | } `---- - x Delim(DelimToken { value: '%' }) + x Delim { value: '%' } ,-[$DIR/tests/recovery/styled-jsx/1/input.css:21:1] 21 | .removed-214123 :global(> .removed-214123-item) { 22 | flex-basis: __styled-jsx-placeholder__4%; diff --git a/crates/swc_css_parser/tests/recovery/styled-jsx/2/span.swc-stderr b/crates/swc_css_parser/tests/recovery/styled-jsx/2/span.swc-stderr index 3db8ee9de8e0..07a3cac14354 100644 --- a/crates/swc_css_parser/tests/recovery/styled-jsx/2/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/styled-jsx/2/span.swc-stderr @@ -104,7 +104,7 @@ 2 | flex-basis: __styled-jsx-placeholder__0%; `---- - x Delim(DelimToken { value: '>' }) + x Delim { value: '>' } ,-[$DIR/tests/recovery/styled-jsx/2/input.css:1:1] 1 | .a :global(> .b) { : ^ @@ -132,7 +132,7 @@ 2 | flex-basis: __styled-jsx-placeholder__0%; `---- - x Delim(DelimToken { value: '.' }) + x Delim { value: '.' } ,-[$DIR/tests/recovery/styled-jsx/2/input.css:1:1] 1 | .a :global(> .b) { : ^ @@ -146,7 +146,7 @@ 2 | flex-basis: __styled-jsx-placeholder__0%; `---- - x Ident(IdentToken { value: Atom('b' type=static), raw: "b" }) + x Ident { value: Atom('b' type=static), raw: "b" } ,-[$DIR/tests/recovery/styled-jsx/2/input.css:1:1] 1 | .a :global(> .b) { : ^ @@ -215,7 +215,7 @@ 3 | } `---- - x Ident(IdentToken { value: Atom('__styled-jsx-placeholder__0' type=dynamic), raw: "__styled-jsx-placeholder__0" }) + x Ident { value: Atom('__styled-jsx-placeholder__0' type=dynamic), raw: "__styled-jsx-placeholder__0" } ,-[$DIR/tests/recovery/styled-jsx/2/input.css:1:1] 1 | .a :global(> .b) { 2 | flex-basis: __styled-jsx-placeholder__0%; @@ -231,7 +231,7 @@ 3 | } `---- - x Delim(DelimToken { value: '%' }) + x Delim { value: '%' } ,-[$DIR/tests/recovery/styled-jsx/2/input.css:1:1] 1 | .a :global(> .b) { 2 | flex-basis: __styled-jsx-placeholder__0%; diff --git a/crates/swc_css_parser/tests/recovery/unicode-range/span.swc-stderr b/crates/swc_css_parser/tests/recovery/unicode-range/span.swc-stderr index 486934c1e9e0..80af171efa6c 100644 --- a/crates/swc_css_parser/tests/recovery/unicode-range/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/unicode-range/span.swc-stderr @@ -128,7 +128,7 @@ 3 | unicode-range: U+1e1ee1-FFZFFF; `---- - x Ident(IdentToken { value: Atom('U' type=inline), raw: "U" }) + x Ident { value: Atom('U' type=inline), raw: "U" } ,-[$DIR/tests/recovery/unicode-range/input.css:1:1] 1 | .class { 2 | unicode-range: U+1Z1ee1-FFFFFF; @@ -200,7 +200,7 @@ 4 | } `---- - x Ident(IdentToken { value: Atom('U' type=inline), raw: "U" }) + x Ident { value: Atom('U' type=inline), raw: "U" } ,-[$DIR/tests/recovery/unicode-range/input.css:2:1] 2 | unicode-range: U+1Z1ee1-FFFFFF; 3 | unicode-range: U+1e1ee1-FFZFFF; diff --git a/crates/swc_css_parser/tests/recovery/value/at-keyword/1/span.swc-stderr b/crates/swc_css_parser/tests/recovery/value/at-keyword/1/span.swc-stderr index 2b9f6dd130ac..76a1eae737bb 100644 --- a/crates/swc_css_parser/tests/recovery/value/at-keyword/1/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/value/at-keyword/1/span.swc-stderr @@ -107,7 +107,7 @@ : ^^^^^^ `---- - x AtKeyword(AtKeywordToken { value: Atom('x,' type=inline), raw: "x\\2c " }) + x AtKeyword { value: Atom('x,' type=inline), raw: "x\\2c " } ,-[$DIR/tests/recovery/value/at-keyword/1/input.css:1:1] 1 | a { value: @x\2c } : ^^^^^^ diff --git a/crates/swc_css_parser/tests/recovery/value/at-keyword/2/span.swc-stderr b/crates/swc_css_parser/tests/recovery/value/at-keyword/2/span.swc-stderr index 52943b7fd571..5d93116ba2ff 100644 --- a/crates/swc_css_parser/tests/recovery/value/at-keyword/2/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/value/at-keyword/2/span.swc-stderr @@ -107,7 +107,7 @@ : ^^^^ `---- - x AtKeyword(AtKeywordToken { value: Atom(',x' type=inline), raw: "\\,x" }) + x AtKeyword { value: Atom(',x' type=inline), raw: "\\,x" } ,-[$DIR/tests/recovery/value/at-keyword/2/input.css:1:1] 1 | a { value: @\,x } : ^^^^ diff --git a/crates/swc_css_parser/tests/recovery/value/at-keyword/3/span.swc-stderr b/crates/swc_css_parser/tests/recovery/value/at-keyword/3/span.swc-stderr index bb422739c2f2..3330e41ac38a 100644 --- a/crates/swc_css_parser/tests/recovery/value/at-keyword/3/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/value/at-keyword/3/span.swc-stderr @@ -107,7 +107,7 @@ : ^^^^^^^^^^ `---- - x AtKeyword(AtKeywordToken { value: Atom('keyword' type=inline), raw: "k\\65yword" }) + x AtKeyword { value: Atom('keyword' type=inline), raw: "k\\65yword" } ,-[$DIR/tests/recovery/value/at-keyword/3/input.css:1:1] 1 | a { value: @k\65yword } : ^^^^^^^^^^ diff --git a/crates/swc_css_parser/tests/recovery/value/at-keyword/4/span.swc-stderr b/crates/swc_css_parser/tests/recovery/value/at-keyword/4/span.swc-stderr index 29fd28e5a289..998465d6b6f8 100644 --- a/crates/swc_css_parser/tests/recovery/value/at-keyword/4/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/value/at-keyword/4/span.swc-stderr @@ -107,7 +107,7 @@ : ^^^^^ `---- - x AtKeyword(AtKeywordToken { value: Atom(',x' type=inline), raw: "\\2cx" }) + x AtKeyword { value: Atom(',x' type=inline), raw: "\\2cx" } ,-[$DIR/tests/recovery/value/at-keyword/4/input.css:1:1] 1 | a { value: @\2cx } : ^^^^^ diff --git a/crates/swc_css_parser/tests/recovery/value/at-keyword/5/span.swc-stderr b/crates/swc_css_parser/tests/recovery/value/at-keyword/5/span.swc-stderr index 35bb1f30004f..82528274820b 100644 --- a/crates/swc_css_parser/tests/recovery/value/at-keyword/5/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/value/at-keyword/5/span.swc-stderr @@ -107,7 +107,7 @@ : ^^^^ `---- - x AtKeyword(AtKeywordToken { value: Atom('x,' type=inline), raw: "x\\," }) + x AtKeyword { value: Atom('x,' type=inline), raw: "x\\," } ,-[$DIR/tests/recovery/value/at-keyword/5/input.css:1:1] 1 | a { value: @x\, } : ^^^^ diff --git a/crates/swc_css_parser/tests/recovery/value/at-keyword/6/span.swc-stderr b/crates/swc_css_parser/tests/recovery/value/at-keyword/6/span.swc-stderr index 9744b2b20e1a..a25308b078da 100644 --- a/crates/swc_css_parser/tests/recovery/value/at-keyword/6/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/value/at-keyword/6/span.swc-stderr @@ -107,7 +107,7 @@ : ^^^^^^^^^^ `---- - x AtKeyword(AtKeywordToken { value: Atom('ھyword' type=inline), raw: "\\6beyword" }) + x AtKeyword { value: Atom('ھyword' type=inline), raw: "\\6beyword" } ,-[$DIR/tests/recovery/value/at-keyword/6/input.css:1:1] 1 | a { value: @\6beyword } : ^^^^^^^^^^ diff --git a/crates/swc_css_parser/tests/recovery/value/at-keyword/7/span.swc-stderr b/crates/swc_css_parser/tests/recovery/value/at-keyword/7/span.swc-stderr index 3fe003badb16..242c59d431f6 100644 --- a/crates/swc_css_parser/tests/recovery/value/at-keyword/7/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/value/at-keyword/7/span.swc-stderr @@ -107,7 +107,7 @@ : ^^^^^^^^^^^ `---- - x AtKeyword(AtKeywordToken { value: Atom('keyword' type=inline), raw: "\\6b eyword" }) + x AtKeyword { value: Atom('keyword' type=inline), raw: "\\6b eyword" } ,-[$DIR/tests/recovery/value/at-keyword/7/input.css:1:1] 1 | a { value: @\6b eyword } : ^^^^^^^^^^^ diff --git a/crates/swc_css_parser/tests/recovery/value/custom-properties/exclamation/span.swc-stderr b/crates/swc_css_parser/tests/recovery/value/custom-properties/exclamation/span.swc-stderr index cd5bff0d4610..b5b85a0c609b 100644 --- a/crates/swc_css_parser/tests/recovery/value/custom-properties/exclamation/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/value/custom-properties/exclamation/span.swc-stderr @@ -120,7 +120,7 @@ : ^ `---- - x Delim(DelimToken { value: '!' }) + x Delim { value: '!' } ,-[$DIR/tests/recovery/value/custom-properties/exclamation/input.css:1:1] 1 | .class {--foo:!; } : ^ @@ -257,7 +257,7 @@ 5 | color: red; `---- - x Delim(DelimToken { value: '!' }) + x Delim { value: '!' } ,-[$DIR/tests/recovery/value/custom-properties/exclamation/input.css:3:1] 3 | .class-1 { 4 | --foo:!; @@ -508,7 +508,7 @@ 11 | } `---- - x Delim(DelimToken { value: '!' }) + x Delim { value: '!' } ,-[$DIR/tests/recovery/value/custom-properties/exclamation/input.css:9:1] 9 | color: red; 10 | --foo:!; @@ -647,7 +647,7 @@ 15 | --foo: bar; `---- - x Delim(DelimToken { value: '!' }) + x Delim { value: '!' } ,-[$DIR/tests/recovery/value/custom-properties/exclamation/input.css:13:1] 13 | .class-3 { 14 | --foo: !; @@ -703,7 +703,7 @@ 16 | } `---- - x Ident(IdentToken { value: Atom('bar' type=inline), raw: "bar" }) + x Ident { value: Atom('bar' type=inline), raw: "bar" } ,-[$DIR/tests/recovery/value/custom-properties/exclamation/input.css:14:1] 14 | --foo: !; 15 | --foo: bar; @@ -842,7 +842,7 @@ 20 | --foo: !; `---- - x Ident(IdentToken { value: Atom('bar' type=inline), raw: "bar" }) + x Ident { value: Atom('bar' type=inline), raw: "bar" } ,-[$DIR/tests/recovery/value/custom-properties/exclamation/input.css:18:1] 18 | .class-4 { 19 | --foo: bar; @@ -898,7 +898,7 @@ 21 | } `---- - x Delim(DelimToken { value: '!' }) + x Delim { value: '!' } ,-[$DIR/tests/recovery/value/custom-properties/exclamation/input.css:19:1] 19 | --foo: bar; 20 | --foo: !; diff --git a/crates/swc_css_parser/tests/recovery/value/custom-properties/only-dashed/span.swc-stderr b/crates/swc_css_parser/tests/recovery/value/custom-properties/only-dashed/span.swc-stderr index 38ce97af6c44..56083f80a545 100644 --- a/crates/swc_css_parser/tests/recovery/value/custom-properties/only-dashed/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/value/custom-properties/only-dashed/span.swc-stderr @@ -104,7 +104,7 @@ 3 | } `---- - x Ident(IdentToken { value: Atom('--' type=inline), raw: "--" }) + x Ident { value: Atom('--' type=inline), raw: "--" } ,-[$DIR/tests/recovery/value/custom-properties/only-dashed/input.css:1:1] 1 | :root { 2 | --:value; @@ -136,7 +136,7 @@ 3 | } `---- - x Ident(IdentToken { value: Atom('value' type=inline), raw: "value" }) + x Ident { value: Atom('value' type=inline), raw: "value" } ,-[$DIR/tests/recovery/value/custom-properties/only-dashed/input.css:1:1] 1 | :root { 2 | --:value; @@ -288,7 +288,7 @@ 7 | } `---- - x Ident(IdentToken { value: Atom('--' type=inline), raw: "--" }) + x Ident { value: Atom('--' type=inline), raw: "--" } ,-[$DIR/tests/recovery/value/custom-properties/only-dashed/input.css:5:1] 5 | .a { 6 | counter-reset: -- --a -a; @@ -320,7 +320,7 @@ 7 | } `---- - x Ident(IdentToken { value: Atom('--a' type=inline), raw: "--a" }) + x Ident { value: Atom('--a' type=inline), raw: "--a" } ,-[$DIR/tests/recovery/value/custom-properties/only-dashed/input.css:5:1] 5 | .a { 6 | counter-reset: -- --a -a; @@ -352,7 +352,7 @@ 7 | } `---- - x Ident(IdentToken { value: Atom('-a' type=inline), raw: "-a" }) + x Ident { value: Atom('-a' type=inline), raw: "-a" } ,-[$DIR/tests/recovery/value/custom-properties/only-dashed/input.css:5:1] 5 | .a { 6 | counter-reset: -- --a -a; diff --git a/crates/swc_css_parser/tests/recovery/value/hash/eof/span.swc-stderr b/crates/swc_css_parser/tests/recovery/value/hash/eof/span.swc-stderr index d5ba4da4f337..062d645c2394 100644 --- a/crates/swc_css_parser/tests/recovery/value/hash/eof/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/value/hash/eof/span.swc-stderr @@ -121,7 +121,7 @@ : ^ `---- - x Delim(DelimToken { value: '#' }) + x Delim { value: '#' } ,-[$DIR/tests/recovery/value/hash/eof/input.css:1:1] 1 | a { 2 | prop: # diff --git a/crates/swc_css_parser/tests/recovery/value/number/dot/span.swc-stderr b/crates/swc_css_parser/tests/recovery/value/number/dot/span.swc-stderr index aa24a6021840..5e42b576f76e 100644 --- a/crates/swc_css_parser/tests/recovery/value/number/dot/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/value/number/dot/span.swc-stderr @@ -107,7 +107,7 @@ : ^ `---- - x Number(NumberToken { value: 0.0, raw: "0", type_flag: Integer }) + x Number { value: 0.0, raw: "0", type_flag: Integer } ,-[$DIR/tests/recovery/value/number/dot/input.css:1:1] 1 | a { width: 0.; } : ^ @@ -119,7 +119,7 @@ : ^ `---- - x Delim(DelimToken { value: '.' }) + x Delim { value: '.' } ,-[$DIR/tests/recovery/value/number/dot/input.css:1:1] 1 | a { width: 0.; } : ^ diff --git a/crates/swc_css_parser/tests/recovery/value/number/minus-dot/span.swc-stderr b/crates/swc_css_parser/tests/recovery/value/number/minus-dot/span.swc-stderr index e77f55d574dd..0e1ef0d1d19e 100644 --- a/crates/swc_css_parser/tests/recovery/value/number/minus-dot/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/value/number/minus-dot/span.swc-stderr @@ -107,7 +107,7 @@ : ^^ `---- - x Number(NumberToken { value: -0.0, raw: "-0", type_flag: Integer }) + x Number { value: -0.0, raw: "-0", type_flag: Integer } ,-[$DIR/tests/recovery/value/number/minus-dot/input.css:1:1] 1 | a { width: -0.; } : ^^ @@ -119,7 +119,7 @@ : ^ `---- - x Delim(DelimToken { value: '.' }) + x Delim { value: '.' } ,-[$DIR/tests/recovery/value/number/minus-dot/input.css:1:1] 1 | a { width: -0.; } : ^ diff --git a/crates/swc_css_parser/tests/recovery/value/number/plus-dot/span.swc-stderr b/crates/swc_css_parser/tests/recovery/value/number/plus-dot/span.swc-stderr index 6a058c606fe3..aafa9163af9e 100644 --- a/crates/swc_css_parser/tests/recovery/value/number/plus-dot/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/value/number/plus-dot/span.swc-stderr @@ -107,7 +107,7 @@ : ^^ `---- - x Number(NumberToken { value: 0.0, raw: "+0", type_flag: Integer }) + x Number { value: 0.0, raw: "+0", type_flag: Integer } ,-[$DIR/tests/recovery/value/number/plus-dot/input.css:1:1] 1 | a { width: +0.; } : ^^ @@ -119,7 +119,7 @@ : ^ `---- - x Delim(DelimToken { value: '.' }) + x Delim { value: '.' } ,-[$DIR/tests/recovery/value/number/plus-dot/input.css:1:1] 1 | a { width: +0.; } : ^ diff --git a/crates/swc_css_parser/tests/recovery/value/percentage/dot/span.swc-stderr b/crates/swc_css_parser/tests/recovery/value/percentage/dot/span.swc-stderr index 21862819e903..1f552c700226 100644 --- a/crates/swc_css_parser/tests/recovery/value/percentage/dot/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/value/percentage/dot/span.swc-stderr @@ -107,7 +107,7 @@ : ^ `---- - x Number(NumberToken { value: 0.0, raw: "0", type_flag: Integer }) + x Number { value: 0.0, raw: "0", type_flag: Integer } ,-[$DIR/tests/recovery/value/percentage/dot/input.css:1:1] 1 | a { width: 0.%; } : ^ @@ -119,7 +119,7 @@ : ^ `---- - x Delim(DelimToken { value: '.' }) + x Delim { value: '.' } ,-[$DIR/tests/recovery/value/percentage/dot/input.css:1:1] 1 | a { width: 0.%; } : ^ @@ -131,7 +131,7 @@ : ^ `---- - x Delim(DelimToken { value: '%' }) + x Delim { value: '%' } ,-[$DIR/tests/recovery/value/percentage/dot/input.css:1:1] 1 | a { width: 0.%; } : ^ diff --git a/crates/swc_css_parser/tests/recovery/value/percentage/minus/span.swc-stderr b/crates/swc_css_parser/tests/recovery/value/percentage/minus/span.swc-stderr index 412dee3880c2..5312091e9c1e 100644 --- a/crates/swc_css_parser/tests/recovery/value/percentage/minus/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/value/percentage/minus/span.swc-stderr @@ -107,7 +107,7 @@ : ^^ `---- - x Number(NumberToken { value: -0.0, raw: "-0", type_flag: Integer }) + x Number { value: -0.0, raw: "-0", type_flag: Integer } ,-[$DIR/tests/recovery/value/percentage/minus/input.css:1:1] 1 | a { width: -0.%; } : ^^ @@ -119,7 +119,7 @@ : ^ `---- - x Delim(DelimToken { value: '.' }) + x Delim { value: '.' } ,-[$DIR/tests/recovery/value/percentage/minus/input.css:1:1] 1 | a { width: -0.%; } : ^ @@ -131,7 +131,7 @@ : ^ `---- - x Delim(DelimToken { value: '%' }) + x Delim { value: '%' } ,-[$DIR/tests/recovery/value/percentage/minus/input.css:1:1] 1 | a { width: -0.%; } : ^ diff --git a/crates/swc_css_parser/tests/recovery/value/percentage/plus/span.swc-stderr b/crates/swc_css_parser/tests/recovery/value/percentage/plus/span.swc-stderr index 64a0460b7b48..c9399608a9a2 100644 --- a/crates/swc_css_parser/tests/recovery/value/percentage/plus/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/value/percentage/plus/span.swc-stderr @@ -107,7 +107,7 @@ : ^^ `---- - x Number(NumberToken { value: 0.0, raw: "+0", type_flag: Integer }) + x Number { value: 0.0, raw: "+0", type_flag: Integer } ,-[$DIR/tests/recovery/value/percentage/plus/input.css:1:1] 1 | a { width: +0.%; } : ^^ @@ -119,7 +119,7 @@ : ^ `---- - x Delim(DelimToken { value: '.' }) + x Delim { value: '.' } ,-[$DIR/tests/recovery/value/percentage/plus/input.css:1:1] 1 | a { width: +0.%; } : ^ @@ -131,7 +131,7 @@ : ^ `---- - x Delim(DelimToken { value: '%' }) + x Delim { value: '%' } ,-[$DIR/tests/recovery/value/percentage/plus/input.css:1:1] 1 | a { width: +0.%; } : ^ diff --git a/crates/swc_css_parser/tests/recovery/value/quotes/span.swc-stderr b/crates/swc_css_parser/tests/recovery/value/quotes/span.swc-stderr index faea4a0f6589..cf33f6bda8e0 100644 --- a/crates/swc_css_parser/tests/recovery/value/quotes/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/value/quotes/span.swc-stderr @@ -156,7 +156,7 @@ 3 | t"; `---- - x BadString(BadStringToken { raw: "\"tes" }) + x BadString { raw: "\"tes" } ,-[$DIR/tests/recovery/value/quotes/input.css:1:1] 1 | p::before { 2 | content: "tes @@ -188,7 +188,7 @@ 4 | } `---- - x Ident(IdentToken { value: Atom('t' type=inline), raw: "t" }) + x Ident { value: Atom('t' type=inline), raw: "t" } ,-[$DIR/tests/recovery/value/quotes/input.css:2:1] 2 | content: "tes 3 | t"; @@ -204,7 +204,7 @@ 4 | } `---- - x BadString(BadStringToken { raw: "\";" }) + x BadString { raw: "\";" } ,-[$DIR/tests/recovery/value/quotes/input.css:2:1] 2 | content: "tes 3 | t"; diff --git a/crates/swc_css_parser/tests/recovery/value/string/escaped/eof/span.swc-stderr b/crates/swc_css_parser/tests/recovery/value/string/escaped/eof/span.swc-stderr index 2b03f15a38cb..e9f2ae53a218 100644 --- a/crates/swc_css_parser/tests/recovery/value/string/escaped/eof/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/value/string/escaped/eof/span.swc-stderr @@ -135,7 +135,7 @@ 3 | ; `---- - x Delim(DelimToken { value: '\\' }) + x Delim { value: '\\' } ,-[$DIR/tests/recovery/value/string/escaped/eof/input.css:1:1] 1 | a { 2 | color: \ diff --git a/crates/swc_css_parser/tests/recovery/value/string/newline/span.swc-stderr b/crates/swc_css_parser/tests/recovery/value/string/newline/span.swc-stderr index d5a8d958441c..892a68ceb02e 100644 --- a/crates/swc_css_parser/tests/recovery/value/string/newline/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/value/string/newline/span.swc-stderr @@ -121,7 +121,7 @@ : ^ `---- - x BadString(BadStringToken { raw: "\"" }) + x BadString { raw: "\"" } ,-[$DIR/tests/recovery/value/string/newline/input.css:1:1] 1 | a { 2 | prop: " diff --git a/crates/swc_css_parser/tests/recovery/value/url/basic/span.swc-stderr b/crates/swc_css_parser/tests/recovery/value/url/basic/span.swc-stderr index c0939ab340dd..652dc6aab765 100644 --- a/crates/swc_css_parser/tests/recovery/value/url/basic/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/value/url/basic/span.swc-stderr @@ -167,7 +167,7 @@ 3 | background: url(var(--foo)); `---- - x String(StringToken { value: Atom('http://www.example.com/pinkish.gif' type=dynamic), raw: "\"http://www.example.com/pinkish.gif\"" }) + x String { value: Atom('http://www.example.com/pinkish.gif' type=dynamic), raw: "\"http://www.example.com/pinkish.gif\"" } ,-[$DIR/tests/recovery/value/url/basic/input.css:1:1] 1 | div { 2 | --foo: "http://www.example.com/pinkish.gif"; @@ -223,7 +223,7 @@ 4 | background: url(image.png\999999); `---- - x BadUrl(BadUrlToken { raw: ("url", "var(--foo") }) + x BadUrl { raw: ("url", "var(--foo") } ,-[$DIR/tests/recovery/value/url/basic/input.css:2:1] 2 | --foo: "http://www.example.com/pinkish.gif"; 3 | background: url(var(--foo)); @@ -831,7 +831,7 @@ 14 | } `---- - x BadUrl(BadUrlToken { raw: ("url", "image.png param(var(--url") }) + x BadUrl { raw: ("url", "image.png param(var(--url") } ,-[$DIR/tests/recovery/value/url/basic/input.css:12:1] 12 | .foo { 13 | background: url(image.png param(var(--url))); @@ -1023,7 +1023,7 @@ 18 | } `---- - x String(StringToken { value: Atom('foo' type=inline), raw: "\"foo\"" }) + x String { value: Atom('foo' type=inline), raw: "\"foo\"" } ,-[$DIR/tests/recovery/value/url/basic/input.css:16:1] 16 | .style { 17 | background: url("foo", "bar"); @@ -1071,7 +1071,7 @@ 18 | } `---- - x String(StringToken { value: Atom('bar' type=inline), raw: "\"bar\"" }) + x String { value: Atom('bar' type=inline), raw: "\"bar\"" } ,-[$DIR/tests/recovery/value/url/basic/input.css:16:1] 16 | .style { 17 | background: url("foo", "bar"); diff --git a/crates/swc_css_parser/tests/recovery/value/url/parenthesis/span.swc-stderr b/crates/swc_css_parser/tests/recovery/value/url/parenthesis/span.swc-stderr index c5c4ad626294..e871257cf39f 100644 --- a/crates/swc_css_parser/tests/recovery/value/url/parenthesis/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/value/url/parenthesis/span.swc-stderr @@ -127,7 +127,7 @@ 3 | `-> } `---- - x BadUrl(BadUrlToken { raw: ("url", "test\\);\n}") }) + x BadUrl { raw: ("url", "test\\);\n}") } ,-[$DIR/tests/recovery/value/url/parenthesis/input.css:1:1] 1 | a { 2 | ,-> background: url(test\); diff --git a/crates/swc_css_parser/tests/recovery/vercel/001/span.swc-stderr b/crates/swc_css_parser/tests/recovery/vercel/001/span.swc-stderr index a02b20df9dc2..334cca927c7a 100644 --- a/crates/swc_css_parser/tests/recovery/vercel/001/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/vercel/001/span.swc-stderr @@ -1033,7 +1033,7 @@ 15 | } `---- - x Ident(IdentToken { value: Atom('__styled-jsx-placeholder__7' type=dynamic), raw: "__styled-jsx-placeholder__7" }) + x Ident { value: Atom('__styled-jsx-placeholder__7' type=dynamic), raw: "__styled-jsx-placeholder__7" } ,-[$DIR/tests/recovery/vercel/001/input.css:13:1] 13 | } 14 | __styled-jsx-placeholder__7 diff --git a/crates/swc_css_parser/tests/recovery/vercel/002/span.swc-stderr b/crates/swc_css_parser/tests/recovery/vercel/002/span.swc-stderr index 43d42abbdd88..4fff597df25d 100644 --- a/crates/swc_css_parser/tests/recovery/vercel/002/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/vercel/002/span.swc-stderr @@ -312,7 +312,7 @@ 5 | border-radius: 7px; `---- - x Ident(IdentToken { value: Atom('__styled-jsx-placeholder__7vw' type=dynamic), raw: "__styled-jsx-placeholder__7vw" }) + x Ident { value: Atom('__styled-jsx-placeholder__7vw' type=dynamic), raw: "__styled-jsx-placeholder__7vw" } ,-[$DIR/tests/recovery/vercel/002/input.css:3:1] 3 | height: __styled-jsx-placeholder__7px; 4 | margin: 0 calc(__styled-jsx-placeholder__7vw - __styled-jsx-placeholder__7px); @@ -344,7 +344,7 @@ 5 | border-radius: 7px; `---- - x Delim(DelimToken { value: '-' }) + x Delim { value: '-' } ,-[$DIR/tests/recovery/vercel/002/input.css:3:1] 3 | height: __styled-jsx-placeholder__7px; 4 | margin: 0 calc(__styled-jsx-placeholder__7vw - __styled-jsx-placeholder__7px); @@ -376,7 +376,7 @@ 5 | border-radius: 7px; `---- - x Ident(IdentToken { value: Atom('__styled-jsx-placeholder__7px' type=dynamic), raw: "__styled-jsx-placeholder__7px" }) + x Ident { value: Atom('__styled-jsx-placeholder__7px' type=dynamic), raw: "__styled-jsx-placeholder__7px" } ,-[$DIR/tests/recovery/vercel/002/input.css:3:1] 3 | height: __styled-jsx-placeholder__7px; 4 | margin: 0 calc(__styled-jsx-placeholder__7vw - __styled-jsx-placeholder__7px); diff --git a/crates/swc_css_parser/tests/recovery/vercel/003/span.swc-stderr b/crates/swc_css_parser/tests/recovery/vercel/003/span.swc-stderr index 1a93d038e2e8..61a010e8c258 100644 --- a/crates/swc_css_parser/tests/recovery/vercel/003/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/vercel/003/span.swc-stderr @@ -439,7 +439,7 @@ 8 | padding: __ident__; `---- - x Delim(DelimToken { value: '>' }) + x Delim { value: '>' } ,-[$DIR/tests/recovery/vercel/003/input.css:6:1] 6 | } 7 | .geist-list :global(> .geist-list-item) { @@ -471,7 +471,7 @@ 8 | padding: __ident__; `---- - x Delim(DelimToken { value: '.' }) + x Delim { value: '.' } ,-[$DIR/tests/recovery/vercel/003/input.css:6:1] 6 | } 7 | .geist-list :global(> .geist-list-item) { @@ -487,7 +487,7 @@ 8 | padding: __ident__; `---- - x Ident(IdentToken { value: Atom('geist-list-item' type=dynamic), raw: "geist-list-item" }) + x Ident { value: Atom('geist-list-item' type=dynamic), raw: "geist-list-item" } ,-[$DIR/tests/recovery/vercel/003/input.css:6:1] 6 | } 7 | .geist-list :global(> .geist-list-item) { @@ -674,7 +674,7 @@ 11 | min-width: 0; `---- - x Ident(IdentToken { value: Atom('__ident__' type=dynamic), raw: "__ident__" }) + x Ident { value: Atom('__ident__' type=dynamic), raw: "__ident__" } ,-[$DIR/tests/recovery/vercel/003/input.css:9:1] 9 | flex-grow: 0; 10 | flex-basis: __ident__%; @@ -690,7 +690,7 @@ 11 | min-width: 0; `---- - x Delim(DelimToken { value: '%' }) + x Delim { value: '%' } ,-[$DIR/tests/recovery/vercel/003/input.css:9:1] 9 | flex-grow: 0; 10 | flex-basis: __ident__%; diff --git a/crates/swc_css_parser/tests/recovery/vercel/004/span.swc-stderr b/crates/swc_css_parser/tests/recovery/vercel/004/span.swc-stderr index f13a19d212da..3eebab1a35ed 100644 --- a/crates/swc_css_parser/tests/recovery/vercel/004/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/vercel/004/span.swc-stderr @@ -208,7 +208,7 @@ 4 | border-radius: 7px; `---- - x Ident(IdentToken { value: Atom('__ident__' type=dynamic), raw: "__ident__" }) + x Ident { value: Atom('__ident__' type=dynamic), raw: "__ident__" } ,-[$DIR/tests/recovery/vercel/004/input.css:2:1] 2 | margin: 0; 3 | __ident__ @@ -240,7 +240,7 @@ 5 | color: white; `---- - x Ident(IdentToken { value: Atom('border-radius' type=dynamic), raw: "border-radius" }) + x Ident { value: Atom('border-radius' type=dynamic), raw: "border-radius" } ,-[$DIR/tests/recovery/vercel/004/input.css:3:1] 3 | __ident__ 4 | border-radius: 7px; @@ -448,7 +448,7 @@ 8 | __ident__ `---- - x Ident(IdentToken { value: Atom('__ident__' type=dynamic), raw: "__ident__" }) + x Ident { value: Atom('__ident__' type=dynamic), raw: "__ident__" } ,-[$DIR/tests/recovery/vercel/004/input.css:6:1] 6 | background: __ident__; 7 | __ident__ @@ -480,7 +480,7 @@ 9 | } `---- - x Ident(IdentToken { value: Atom('__ident__' type=dynamic), raw: "__ident__" }) + x Ident { value: Atom('__ident__' type=dynamic), raw: "__ident__" } ,-[$DIR/tests/recovery/vercel/004/input.css:7:1] 7 | __ident__ 8 | __ident__ diff --git a/crates/swc_css_parser/tests/recovery/vercel/005/span.swc-stderr b/crates/swc_css_parser/tests/recovery/vercel/005/span.swc-stderr index 578bb3196e38..a9bc46609307 100644 --- a/crates/swc_css_parser/tests/recovery/vercel/005/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/vercel/005/span.swc-stderr @@ -136,7 +136,7 @@ 4 | border-radius: 7px; `---- - x Ident(IdentToken { value: Atom('__ident__' type=dynamic), raw: "__ident__" }) + x Ident { value: Atom('__ident__' type=dynamic), raw: "__ident__" } ,-[$DIR/tests/recovery/vercel/005/input.css:2:1] 2 | margin: 0; 3 | __ident__ @@ -168,7 +168,7 @@ 5 | color: white; `---- - x Ident(IdentToken { value: Atom('border-radius' type=dynamic), raw: "border-radius" }) + x Ident { value: Atom('border-radius' type=dynamic), raw: "border-radius" } ,-[$DIR/tests/recovery/vercel/005/input.css:3:1] 3 | __ident__ 4 | border-radius: 7px; @@ -352,7 +352,7 @@ 8 | __ident__ `---- - x Ident(IdentToken { value: Atom('__ident__' type=dynamic), raw: "__ident__" }) + x Ident { value: Atom('__ident__' type=dynamic), raw: "__ident__" } ,-[$DIR/tests/recovery/vercel/005/input.css:6:1] 6 | background: __ident__; 7 | __ident__ @@ -384,7 +384,7 @@ 9 | } `---- - x Ident(IdentToken { value: Atom('__ident__' type=dynamic), raw: "__ident__" }) + x Ident { value: Atom('__ident__' type=dynamic), raw: "__ident__" } ,-[$DIR/tests/recovery/vercel/005/input.css:7:1] 7 | __ident__ 8 | __ident__ From 5e1b929afc3e29819fc29b47159ba6d5cd0ff1ca Mon Sep 17 00:00:00 2001 From: "alexander.akait" Date: Mon, 5 Dec 2022 04:54:30 +0300 Subject: [PATCH 38/42] refactor: url token --- crates/swc_css_ast/src/token.rs | 29 ++++++------------- crates/swc_css_codegen/src/lib.rs | 8 ++--- .../tests/fixture/values/url/1/output.min.css | 2 +- crates/swc_css_minifier/src/compressor/mod.rs | 2 +- crates/swc_css_parser/src/lexer/mod.rs | 20 +++++-------- .../src/parser/values_and_units/mod.rs | 5 ++-- .../tests/fixture/at-rule/import/output.json | 4 +-- .../selector/pseudo-class/unknown/output.json | 1 - .../pseudo-class/unknown/span.swc-stderr | 2 +- .../pseudo-element/unknown/output.json | 1 - .../pseudo-element/unknown/span.swc-stderr | 2 +- .../tests/fixture/value/url/output.json | 6 ++-- 12 files changed, 33 insertions(+), 49 deletions(-) diff --git a/crates/swc_css_ast/src/token.rs b/crates/swc_css_ast/src/token.rs index 3b05833e4403..7fffb2ba9e39 100644 --- a/crates/swc_css_ast/src/token.rs +++ b/crates/swc_css_ast/src/token.rs @@ -35,21 +35,6 @@ pub enum NumberType { Number, } -/// `url(value)` -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, EqIgnoreSpan)] -#[cfg_attr( - feature = "rkyv", - derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize) -)] -pub struct UrlToken { - #[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))] - pub name: JsWord, - #[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))] - pub value: JsWord, - /// Name and value - pub raw: Box<(Atom, Atom)>, -} - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, EqIgnoreSpan)] #[cfg_attr( feature = "rkyv", @@ -111,7 +96,12 @@ pub enum Token { raw: Atom, }, /// `url(value)` - Url(Box), + Url { + #[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))] + value: JsWord, + /// Name and value + raw: Box<(Atom, Atom)>, + }, BadUrl { raw: Box<(Atom, Atom)>, }, @@ -200,10 +190,9 @@ impl Hash for Token { raw.hash(state); is_id.hash(state); } - Token::Url(url) => { - url.name.hash(state); - url.value.hash(state); - url.raw.hash(state); + Token::Url { value, raw } => { + value.hash(state); + raw.hash(state); } Token::BadUrl { raw, .. } => { raw.hash(state); diff --git a/crates/swc_css_codegen/src/lib.rs b/crates/swc_css_codegen/src/lib.rs index c57b319ec3cd..1e89115c9726 100644 --- a/crates/swc_css_codegen/src/lib.rs +++ b/crates/swc_css_codegen/src/lib.rs @@ -2015,12 +2015,12 @@ where Token::String { raw, .. } => { write_str!(self, span, raw); } - Token::Url(token) => { - let mut url = String::with_capacity(token.raw.0.len() + token.raw.1.len() + 2); + Token::Url { raw, .. } => { + let mut url = String::with_capacity(raw.0.len() + raw.1.len() + 2); - url.push_str(&token.raw.0); + url.push_str(&raw.0); url.push('('); - url.push_str(&token.raw.1); + url.push_str(&raw.1); url.push(')'); write_str!(self, span, &url); diff --git a/crates/swc_css_codegen/tests/fixture/values/url/1/output.min.css b/crates/swc_css_codegen/tests/fixture/values/url/1/output.min.css index f83e944c74a9..bfea1c135295 100644 --- a/crates/swc_css_codegen/tests/fixture/values/url/1/output.min.css +++ b/crates/swc_css_codegen/tests/fixture/values/url/1/output.min.css @@ -1 +1 @@ -div{background:url(https://example.com/image.png);background:url(https://example.com/image.png);background:url(https://example.com/image.png);background:url("https://example.com/image.png");background:url("https://example.com/image.png");background:url("https://example.com/image.png");background:url("https://example.com/image.png");background:url(data:image/png;base64,iRxVB0);background:url(#IDofSVGpath);background:url("//aa.com/img.svg"prefetch);background:url("//aa.com/img.svg"foo bar baz func(test));background:url("http://example.com/image.svg"param(--color var(--primary-color)));background:url();background:url("");background:url("");--foo:"http://www.example.com/pinkish.gif";background:src("http://www.example.com/pinkish.gif");background:src("http://www.example.com/pinkish.gif");background:src(var(--foo));background:url(https://example.com/image.png);background:url(https://example.com/image.png);background:url(https://example.com/image.png);background:url(https://example.com/image.png);background:url(image.png힙)}div{background:url(foo.img)red}*{background:url("foo");background:url("f o");background:url("f o");background:url("foo)");background:url("(foo");background:url("(foo)");background:url('"foo"')}.bar{background:url(http://example.com/image.svg param(--color var(--primary-color)))}.baz{background:url("http://example.com/image.svg"param(--color var(--primary-color)))}.foo{background:url(__ident__)} +div{background:url(https://example.com/image.png);background:url(https://example.com/image.png);background:\\url(https://example.com/image.png);background:url("https://example.com/image.png");background:url("https://example.com/image.png");background:url("https://example.com/image.png");background:url("https://example.com/image.png");background:url(data:image/png;base64,iRxVB0);background:url(#IDofSVGpath);background:url("//aa.com/img.svg"prefetch);background:url("//aa.com/img.svg"foo bar baz func(test));background:url("http://example.com/image.svg"param(--color var(--primary-color)));background:url();background:url("");background:url("");--foo:"http://www.example.com/pinkish.gif";background:src("http://www.example.com/pinkish.gif");background:src("http://www.example.com/pinkish.gif");background:src(var(--foo));background:url(https://example.com/image.png);background:u\\rl(https://example.com/image.png);background:url(https://example.com/image.png);background:url(https://example.com/image.png);background:url(image.png힙)}div{background:url(foo.img)red}*{background:url("foo");background:url("f o");background:url("f o");background:url("foo)");background:url("(foo");background:url("(foo)");background:url('"foo"')}.bar{background:url(http://example.com/image.svg param(--color var(--primary-color)))}.baz{background:url("http://example.com/image.svg"param(--color var(--primary-color)))}.foo{background:url(__ident__)} diff --git a/crates/swc_css_minifier/src/compressor/mod.rs b/crates/swc_css_minifier/src/compressor/mod.rs index 2acbed210a5c..a5cb67033d0d 100644 --- a/crates/swc_css_minifier/src/compressor/mod.rs +++ b/crates/swc_css_minifier/src/compressor/mod.rs @@ -400,7 +400,7 @@ impl VisitMut for Compressor { | Token::Function { value, .. } | Token::AtKeyword { value, .. } | Token::String { value, .. } - | Token::Url(box UrlToken { value, .. }) + | Token::Url { value, .. } if !contains_only_ascii_characters(value) => { self.need_utf8_at_rule = true; diff --git a/crates/swc_css_parser/src/lexer/mod.rs b/crates/swc_css_parser/src/lexer/mod.rs index 2e43260dc451..5ed943ae7ec1 100644 --- a/crates/swc_css_parser/src/lexer/mod.rs +++ b/crates/swc_css_parser/src/lexer/mod.rs @@ -789,11 +789,10 @@ where // U+0029 RIGHT PARENTHESIS ()) // Return the . Some(')') => { - return Ok(Token::Url(Box::new(swc_css_ast::UrlToken { - name: name.0, + return Ok(Token::Url { value: (&**out).into(), raw: Box::new((name.1, (&**raw).into())), - }))); + }); } // EOF @@ -801,11 +800,10 @@ where None => { l.emit_error(ErrorKind::UnterminatedUrl); - return Ok(Token::Url(Box::new(swc_css_ast::UrlToken { - name: name.0, + return Ok(Token::Url { value: (&**out).into(), raw: Box::new((name.1, (&**raw).into())), - }))); + }); } // whitespace @@ -836,22 +834,20 @@ where raw.push_str(&whitespaces); - return Ok(Token::Url(Box::new(swc_css_ast::UrlToken { - name: name.0, + return Ok(Token::Url { value: (&**out).into(), raw: Box::new((name.1, (&**raw).into())), - }))); + }); } None => { l.emit_error(ErrorKind::UnterminatedUrl); raw.push_str(&whitespaces); - return Ok(Token::Url(Box::new(swc_css_ast::UrlToken { - name: name.0, + return Ok(Token::Url { value: (&**out).into(), raw: Box::new((name.1, (&**raw).into())), - }))); + }); } _ => {} } diff --git a/crates/swc_css_parser/src/parser/values_and_units/mod.rs b/crates/swc_css_parser/src/parser/values_and_units/mod.rs index e8dbf266dcf9..308e722e8bc2 100644 --- a/crates/swc_css_parser/src/parser/values_and_units/mod.rs +++ b/crates/swc_css_parser/src/parser/values_and_units/mod.rs @@ -1,3 +1,4 @@ +use swc_atoms::js_word; use swc_common::{BytePos, Span}; use swc_css_ast::*; @@ -2507,11 +2508,11 @@ where } match bump!(self) { - Token::Url(box UrlToken { name, value, raw }) => { + Token::Url { value, raw } => { let name_length = raw.0.len() as u32; let name = Ident { span: Span::new(span.lo, span.lo + BytePos(name_length), Default::default()), - value: name, + value: js_word!("url"), raw: Some(raw.0), }; let value = Some(Box::new(UrlValue::Raw(UrlValueRaw { diff --git a/crates/swc_css_parser/tests/fixture/at-rule/import/output.json b/crates/swc_css_parser/tests/fixture/at-rule/import/output.json index 37f0119b50c1..0251ea8ee94d 100644 --- a/crates/swc_css_parser/tests/fixture/at-rule/import/output.json +++ b/crates/swc_css_parser/tests/fixture/at-rule/import/output.json @@ -354,7 +354,7 @@ "end": 168, "ctxt": 0 }, - "value": "URL", + "value": "url", "raw": "URL" }, "value": { @@ -2098,7 +2098,7 @@ "end": 931, "ctxt": 0 }, - "value": "URL", + "value": "url", "raw": "URL" }, "value": { diff --git a/crates/swc_css_parser/tests/fixture/selector/pseudo-class/unknown/output.json b/crates/swc_css_parser/tests/fixture/selector/pseudo-class/unknown/output.json index e3850f5b6ff0..71a4535db3af 100644 --- a/crates/swc_css_parser/tests/fixture/selector/pseudo-class/unknown/output.json +++ b/crates/swc_css_parser/tests/fixture/selector/pseudo-class/unknown/output.json @@ -1769,7 +1769,6 @@ }, "token": { "Url": { - "name": "url", "value": "foo.png", "raw": [ "url", diff --git a/crates/swc_css_parser/tests/fixture/selector/pseudo-class/unknown/span.swc-stderr b/crates/swc_css_parser/tests/fixture/selector/pseudo-class/unknown/span.swc-stderr index 5715583945f7..d194e17558d2 100644 --- a/crates/swc_css_parser/tests/fixture/selector/pseudo-class/unknown/span.swc-stderr +++ b/crates/swc_css_parser/tests/fixture/selector/pseudo-class/unknown/span.swc-stderr @@ -2037,7 +2037,7 @@ 16 | :unknown({!}) {} `---- - x Url(UrlToken { name: Atom('url' type=static), value: Atom('foo.png' type=inline), raw: ("url", "foo.png") }) + x Url { value: Atom('foo.png' type=inline), raw: ("url", "foo.png") } ,-[$DIR/tests/fixture/selector/pseudo-class/unknown/input.css:14:1] 14 | :unknown('string') {} 15 | :unknown(url(foo.png)) {} diff --git a/crates/swc_css_parser/tests/fixture/selector/pseudo-element/unknown/output.json b/crates/swc_css_parser/tests/fixture/selector/pseudo-element/unknown/output.json index 70438cc9d916..7d9e18785a86 100644 --- a/crates/swc_css_parser/tests/fixture/selector/pseudo-element/unknown/output.json +++ b/crates/swc_css_parser/tests/fixture/selector/pseudo-element/unknown/output.json @@ -1769,7 +1769,6 @@ }, "token": { "Url": { - "name": "url", "value": "foo.png", "raw": [ "url", diff --git a/crates/swc_css_parser/tests/fixture/selector/pseudo-element/unknown/span.swc-stderr b/crates/swc_css_parser/tests/fixture/selector/pseudo-element/unknown/span.swc-stderr index d47a045e8e96..35f4a040668f 100644 --- a/crates/swc_css_parser/tests/fixture/selector/pseudo-element/unknown/span.swc-stderr +++ b/crates/swc_css_parser/tests/fixture/selector/pseudo-element/unknown/span.swc-stderr @@ -2036,7 +2036,7 @@ 16 | ::unknown({!}) {} `---- - x Url(UrlToken { name: Atom('url' type=static), value: Atom('foo.png' type=inline), raw: ("url", "foo.png") }) + x Url { value: Atom('foo.png' type=inline), raw: ("url", "foo.png") } ,-[$DIR/tests/fixture/selector/pseudo-element/unknown/input.css:14:1] 14 | ::unknown('string') {} 15 | ::unknown(url(foo.png)) {} diff --git a/crates/swc_css_parser/tests/fixture/value/url/output.json b/crates/swc_css_parser/tests/fixture/value/url/output.json index 5150246736df..d680a6cefad5 100644 --- a/crates/swc_css_parser/tests/fixture/value/url/output.json +++ b/crates/swc_css_parser/tests/fixture/value/url/output.json @@ -169,7 +169,7 @@ "end": 78, "ctxt": 0 }, - "value": "URL", + "value": "url", "raw": "URL" }, "value": { @@ -219,7 +219,7 @@ "end": 131, "ctxt": 0 }, - "value": "URL", + "value": "url", "raw": "\\URL" }, "value": { @@ -1409,7 +1409,7 @@ "end": 1299, "ctxt": 0 }, - "value": "URL", + "value": "url", "raw": "URL" }, "value": { From e2816dc99b5a820c81375cdacf3ae35d7bcaee4a Mon Sep 17 00:00:00 2001 From: "alexander.akait" Date: Mon, 5 Dec 2022 05:20:54 +0300 Subject: [PATCH 39/42] refactor: tokens --- crates/swc_css_ast/src/token.rs | 7 +- crates/swc_css_codegen/src/lib.rs | 9 +- .../tests/fixture/values/url/1/output.min.css | 2 +- crates/swc_css_parser/src/lexer/mod.rs | 3 +- .../src/parser/selectors/mod.rs | 5 +- .../src/parser/values_and_units/mod.rs | 96 +++++++++++++------ .../tests/fixture/at-rule/media/output.json | 24 ++--- .../fixture/at-rule/media/span.swc-stderr | 8 +- .../tests/fixture/function/calc/output.json | 6 +- .../fixture/function/calc/span.swc-stderr | 2 +- .../tests/fixture/style-block/output.json | 18 ++-- .../tests/fixture/style-block/span.swc-stderr | 6 +- .../fixture/value/custom-property/output.json | 18 ++-- .../value/custom-property/span.swc-stderr | 6 +- .../vendor/rome/custom-properties/output.json | 12 +-- .../rome/custom-properties/span.swc-stderr | 4 +- .../fixture/vendor/rome/functions/output.json | 6 +- .../vendor/rome/functions/span.swc-stderr | 2 +- .../media/condition-and-or/output.json | 12 +-- .../media/condition-and-or/span.swc-stderr | 4 +- .../at-rule/media/feature-name-1/output.json | 12 +-- .../media/feature-name-1/span.swc-stderr | 4 +- .../at-rule/media/feature-name/output.json | 6 +- .../media/feature-name/span.swc-stderr | 2 +- .../at-rule/media/feature-range-2/output.json | 12 +-- .../media/feature-range-2/span.swc-stderr | 4 +- .../at-rule/media/feature-range-3/output.json | 12 +-- .../media/feature-range-3/span.swc-stderr | 4 +- .../at-rule/media/feature-range-4/output.json | 12 +-- .../media/feature-range-4/span.swc-stderr | 4 +- .../at-rule/media/feature-range-5/output.json | 12 +-- .../media/feature-range-5/span.swc-stderr | 4 +- .../at-rule/media/feature-range-6/output.json | 12 +-- .../media/feature-range-6/span.swc-stderr | 4 +- .../at-rule/media/invalid-nesting/output.json | 6 +- .../media/invalid-nesting/span.swc-stderr | 2 +- .../at-rule/supports/wrong-or-and/output.json | 6 +- .../supports/wrong-or-and/span.swc-stderr | 2 +- .../declaration/wrong-name-3/output.json | 6 +- .../declaration/wrong-name-3/span.swc-stderr | 2 +- .../recovery/function/calc/space/output.json | 12 +-- .../function/calc/space/span.swc-stderr | 4 +- .../recovery/function/unclosed-2/output.json | 6 +- .../function/unclosed-2/span.swc-stderr | 2 +- .../recovery/function/unclosed/output.json | 6 +- .../function/unclosed/span.swc-stderr | 2 +- .../tests/recovery/number/output.json | 12 +-- .../tests/recovery/number/span.swc-stderr | 4 +- .../invalid-nested-1/output.json | 6 +- .../invalid-nested-1/span.swc-stderr | 2 +- .../tests/recovery/unicode-range/output.json | 12 +-- .../recovery/unicode-range/span.swc-stderr | 4 +- .../tests/recovery/vercel/004/output.json | 6 +- .../tests/recovery/vercel/004/span.swc-stderr | 2 +- .../tests/recovery/vercel/005/output.json | 6 +- .../tests/recovery/vercel/005/span.swc-stderr | 2 +- 56 files changed, 209 insertions(+), 257 deletions(-) diff --git a/crates/swc_css_ast/src/token.rs b/crates/swc_css_ast/src/token.rs index 7fffb2ba9e39..268d605ccbda 100644 --- a/crates/swc_css_ast/src/token.rs +++ b/crates/swc_css_ast/src/token.rs @@ -42,12 +42,12 @@ pub enum NumberType { )] pub struct DimensionToken { pub value: f64, + pub raw_value: Atom, #[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))] pub unit: JsWord, #[serde(rename = "type")] pub type_flag: NumberType, - /// Value and unit - pub raw: Box<(Atom, Atom)>, + pub raw_unit: Atom, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, EqIgnoreSpan)] @@ -217,7 +217,8 @@ impl Hash for Token { integer_decode(dimension.value).hash(state); dimension.unit.hash(state); dimension.type_flag.hash(state); - dimension.raw.hash(state); + dimension.raw_value.hash(state); + dimension.raw_unit.hash(state); } Token::WhiteSpace { value, .. } => { value.hash(state); diff --git a/crates/swc_css_codegen/src/lib.rs b/crates/swc_css_codegen/src/lib.rs index 1e89115c9726..b1ecf862c0a0 100644 --- a/crates/swc_css_codegen/src/lib.rs +++ b/crates/swc_css_codegen/src/lib.rs @@ -1985,16 +1985,17 @@ where Token::Percentage { raw, .. } => { let mut percentage = String::with_capacity(raw.len() + 1); - percentage.push_str(&raw); + percentage.push_str(raw); percentage.push('%'); write_raw!(self, span, &percentage); } Token::Dimension(token) => { - let mut dimension = String::with_capacity(token.raw.0.len() + token.raw.1.len()); + let mut dimension = + String::with_capacity(token.raw_value.len() + token.raw_unit.len()); - dimension.push_str(&token.raw.0); - dimension.push_str(&token.raw.1); + dimension.push_str(&token.raw_value); + dimension.push_str(&token.raw_unit); write_raw!(self, span, &dimension); } diff --git a/crates/swc_css_codegen/tests/fixture/values/url/1/output.min.css b/crates/swc_css_codegen/tests/fixture/values/url/1/output.min.css index bfea1c135295..f83e944c74a9 100644 --- a/crates/swc_css_codegen/tests/fixture/values/url/1/output.min.css +++ b/crates/swc_css_codegen/tests/fixture/values/url/1/output.min.css @@ -1 +1 @@ -div{background:url(https://example.com/image.png);background:url(https://example.com/image.png);background:\\url(https://example.com/image.png);background:url("https://example.com/image.png");background:url("https://example.com/image.png");background:url("https://example.com/image.png");background:url("https://example.com/image.png");background:url(data:image/png;base64,iRxVB0);background:url(#IDofSVGpath);background:url("//aa.com/img.svg"prefetch);background:url("//aa.com/img.svg"foo bar baz func(test));background:url("http://example.com/image.svg"param(--color var(--primary-color)));background:url();background:url("");background:url("");--foo:"http://www.example.com/pinkish.gif";background:src("http://www.example.com/pinkish.gif");background:src("http://www.example.com/pinkish.gif");background:src(var(--foo));background:url(https://example.com/image.png);background:u\\rl(https://example.com/image.png);background:url(https://example.com/image.png);background:url(https://example.com/image.png);background:url(image.png힙)}div{background:url(foo.img)red}*{background:url("foo");background:url("f o");background:url("f o");background:url("foo)");background:url("(foo");background:url("(foo)");background:url('"foo"')}.bar{background:url(http://example.com/image.svg param(--color var(--primary-color)))}.baz{background:url("http://example.com/image.svg"param(--color var(--primary-color)))}.foo{background:url(__ident__)} +div{background:url(https://example.com/image.png);background:url(https://example.com/image.png);background:url(https://example.com/image.png);background:url("https://example.com/image.png");background:url("https://example.com/image.png");background:url("https://example.com/image.png");background:url("https://example.com/image.png");background:url(data:image/png;base64,iRxVB0);background:url(#IDofSVGpath);background:url("//aa.com/img.svg"prefetch);background:url("//aa.com/img.svg"foo bar baz func(test));background:url("http://example.com/image.svg"param(--color var(--primary-color)));background:url();background:url("");background:url("");--foo:"http://www.example.com/pinkish.gif";background:src("http://www.example.com/pinkish.gif");background:src("http://www.example.com/pinkish.gif");background:src(var(--foo));background:url(https://example.com/image.png);background:url(https://example.com/image.png);background:url(https://example.com/image.png);background:url(https://example.com/image.png);background:url(image.png힙)}div{background:url(foo.img)red}*{background:url("foo");background:url("f o");background:url("f o");background:url("foo)");background:url("(foo");background:url("(foo)");background:url('"foo"')}.bar{background:url(http://example.com/image.svg param(--color var(--primary-color)))}.baz{background:url("http://example.com/image.svg"param(--color var(--primary-color)))}.foo{background:url(__ident__)} diff --git a/crates/swc_css_parser/src/lexer/mod.rs b/crates/swc_css_parser/src/lexer/mod.rs index 5ed943ae7ec1..dadcd9584dc2 100644 --- a/crates/swc_css_parser/src/lexer/mod.rs +++ b/crates/swc_css_parser/src/lexer/mod.rs @@ -563,9 +563,10 @@ where // unit set initially to the empty string. let token = Token::Dimension(Box::new(DimensionToken { value: number.0, + raw_value: number.1, unit: ident_sequence.0, + raw_unit: ident_sequence.1, type_flag: number.2, - raw: Box::new((number.1, ident_sequence.1)), })); // Return the . diff --git a/crates/swc_css_parser/src/parser/selectors/mod.rs b/crates/swc_css_parser/src/parser/selectors/mod.rs index 5da5c0b2c948..c318e09c38e5 100644 --- a/crates/swc_css_parser/src/parser/selectors/mod.rs +++ b/crates/swc_css_parser/src/parser/selectors/mod.rs @@ -1268,7 +1268,7 @@ where } tok!("dimension") => { let dimension = match bump!(self) { - Token::Dimension(box DimensionToken { value, unit, raw, .. }) => (value, raw, unit), + Token::Dimension(box DimensionToken { value, raw_value, unit, .. }) => (value, raw_value, unit), _ => { unreachable!(); } @@ -1284,8 +1284,7 @@ where } a = Some(dimension.0 as i32); - a_raw = Some(dimension.1.0); - + a_raw = Some(dimension.1); n_value = (*dimension.2).to_string(); } _ => { diff --git a/crates/swc_css_parser/src/parser/values_and_units/mod.rs b/crates/swc_css_parser/src/parser/values_and_units/mod.rs index 308e722e8bc2..d5566b6be551 100644 --- a/crates/swc_css_parser/src/parser/values_and_units/mod.rs +++ b/crates/swc_css_parser/src/parser/values_and_units/mod.rs @@ -1982,23 +1982,27 @@ where match bump!(self) { Token::Dimension(box DimensionToken { - value, unit, raw, .. + value, + unit, + raw_value, + raw_unit, + .. }) => { // TODO validate - let unit_len = raw.1.len() as u32; + let unit_len = raw_unit.len() as u32; Ok(Length { span, value: Number { span: Span::new(span.lo, span.hi - BytePos(unit_len), Default::default()), value, - raw: Some(raw.0), + raw: Some(raw_value), }, unit: Ident { span: Span::new(span.hi - BytePos(unit_len), span.hi, Default::default()), value: unit, - raw: Some(raw.1), + raw: Some(raw_unit), }, }) } @@ -2022,7 +2026,11 @@ where match bump!(self) { Token::Dimension(box DimensionToken { - value, unit, raw, .. + value, + unit, + raw_value, + raw_unit, + .. }) => { if !is_angle_unit(&unit) { return Err(Error::new( @@ -2031,19 +2039,19 @@ where )); } - let unit_len = raw.1.len() as u32; + let unit_len = raw_unit.len() as u32; Ok(Angle { span, value: Number { span: Span::new(span.lo, span.hi - BytePos(unit_len), Default::default()), value, - raw: Some(raw.0), + raw: Some(raw_value), }, unit: Ident { span: Span::new(span.hi - BytePos(unit_len), span.hi, Default::default()), value: unit, - raw: Some(raw.1), + raw: Some(raw_unit), }, }) } @@ -2067,25 +2075,29 @@ where match bump!(self) { Token::Dimension(box DimensionToken { - value, unit, raw, .. + value, + unit, + raw_value, + raw_unit, + .. }) => { if !is_time_unit(&unit) { return Err(Error::new(span, ErrorKind::Expected("'s' or 'ms' units"))); } - let unit_len = raw.1.len() as u32; + let unit_len = raw_unit.len() as u32; Ok(Time { span, value: Number { span: Span::new(span.lo, span.hi - BytePos(unit_len), Default::default()), value, - raw: Some(raw.0), + raw: Some(raw_value), }, unit: Ident { span: Span::new(span.hi - BytePos(unit_len), span.hi, Default::default()), value: unit, - raw: Some(raw.1), + raw: Some(raw_unit), }, }) } @@ -2109,25 +2121,29 @@ where match bump!(self) { Token::Dimension(box DimensionToken { - value, unit, raw, .. + value, + unit, + raw_value, + raw_unit, + .. }) => { if !is_frequency_unit(&unit) { return Err(Error::new(span, ErrorKind::Expected("'Hz' or 'kHz' units"))); } - let unit_len = raw.1.len() as u32; + let unit_len = raw_unit.len() as u32; Ok(Frequency { span, value: Number { span: Span::new(span.lo, span.hi - BytePos(unit_len), Default::default()), value, - raw: Some(raw.0), + raw: Some(raw_value), }, unit: Ident { span: Span::new(span.hi - BytePos(unit_len), span.hi, Default::default()), value: unit, - raw: Some(raw.1), + raw: Some(raw_unit), }, }) } @@ -2151,7 +2167,11 @@ where match bump!(self) { Token::Dimension(box DimensionToken { - value, unit, raw, .. + value, + unit, + raw_value, + raw_unit, + .. }) => { if !is_resolution_unit(&unit) { return Err(Error::new( @@ -2160,19 +2180,19 @@ where )); } - let unit_len = raw.1.len() as u32; + let unit_len = raw_unit.len() as u32; Ok(Resolution { span, value: Number { span: Span::new(span.lo, span.hi - BytePos(unit_len), Default::default()), value, - raw: Some(raw.0), + raw: Some(raw_value), }, unit: Ident { span: Span::new(span.hi - BytePos(unit_len), span.hi, Default::default()), value: unit, - raw: Some(raw.1), + raw: Some(raw_unit), }, }) } @@ -2196,25 +2216,29 @@ where match bump!(self) { Token::Dimension(box DimensionToken { - value, unit, raw, .. + value, + unit, + raw_value, + raw_unit, + .. }) => { if !is_flex_unit(&unit) { return Err(Error::new(span, ErrorKind::Expected("'fr' unit"))); } - let unit_len = raw.1.len() as u32; + let unit_len = raw_unit.len() as u32; Ok(Flex { span, value: Number { span: Span::new(span.lo, span.hi - BytePos(unit_len), Default::default()), value, - raw: Some(raw.0), + raw: Some(raw_value), }, unit: Ident { span: Span::new(span.hi - BytePos(unit_len), span.hi, Default::default()), value: unit, - raw: Some(raw.1), + raw: Some(raw_unit), }, }) } @@ -2238,21 +2262,25 @@ where match bump!(self) { Token::Dimension(box DimensionToken { - value, unit, raw, .. + value, + unit, + raw_value, + raw_unit, + .. }) => { - let unit_len = raw.1.len() as u32; + let unit_len = raw_unit.len() as u32; Ok(UnknownDimension { span, value: Number { span: Span::new(span.lo, span.hi - BytePos(unit_len), Default::default()), value, - raw: Some(raw.0), + raw: Some(raw_value), }, unit: Ident { span: Span::new(span.hi - BytePos(unit_len), span.hi, Default::default()), value: unit, - raw: Some(raw.1), + raw: Some(raw_unit), }, }) } @@ -2737,7 +2765,11 @@ where } tok!("dimension") => { let raw = match bump!(self) { - Token::Dimension(box DimensionToken { raw, .. }) => raw, + Token::Dimension(box DimensionToken { + raw_value, + raw_unit, + .. + }) => (raw_value, raw_unit), _ => { unreachable!(); } @@ -2763,7 +2795,11 @@ where // u '?'* tok!("dimension") => { let raw = match bump!(self) { - Token::Dimension(box DimensionToken { raw, .. }) => raw, + Token::Dimension(box DimensionToken { + raw_value, + raw_unit, + .. + }) => (raw_value, raw_unit), _ => { unreachable!(); } diff --git a/crates/swc_css_parser/tests/fixture/at-rule/media/output.json b/crates/swc_css_parser/tests/fixture/at-rule/media/output.json index fdc8d1649fa1..49aac26b5c3c 100644 --- a/crates/swc_css_parser/tests/fixture/at-rule/media/output.json +++ b/crates/swc_css_parser/tests/fixture/at-rule/media/output.json @@ -15242,12 +15242,10 @@ "token": { "Dimension": { "value": 600.0, + "raw_value": "600", "unit": "px", "type": "integer", - "raw": [ - "600", - "px" - ] + "raw_unit": "px" } } } @@ -15701,12 +15699,10 @@ "token": { "Dimension": { "value": 600.0, + "raw_value": "600", "unit": "px", "type": "integer", - "raw": [ - "600", - "px" - ] + "raw_unit": "px" } } } @@ -16097,12 +16093,10 @@ "token": { "Dimension": { "value": 100.0, + "raw_value": "100", "unit": "px", "type": "integer", - "raw": [ - "100", - "px" - ] + "raw_unit": "px" } } } @@ -16221,12 +16215,10 @@ "token": { "Dimension": { "value": 100.0, + "raw_value": "100", "unit": "px", "type": "integer", - "raw": [ - "100", - "px" - ] + "raw_unit": "px" } } } diff --git a/crates/swc_css_parser/tests/fixture/at-rule/media/span.swc-stderr b/crates/swc_css_parser/tests/fixture/at-rule/media/span.swc-stderr index c8b39c2f0951..4e9523e657b7 100644 --- a/crates/swc_css_parser/tests/fixture/at-rule/media/span.swc-stderr +++ b/crates/swc_css_parser/tests/fixture/at-rule/media/span.swc-stderr @@ -21443,7 +21443,7 @@ 143 | @media (height foo bar) {} `---- - x Dimension(DimensionToken { value: 600.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("600", "px") }) + x Dimension(DimensionToken { value: 600.0, raw_value: "600", unit: Atom('px' type=static), type_flag: Integer, raw_unit: "px" }) ,-[$DIR/tests/fixture/at-rule/media/input.css:141:1] 141 | 142 | @media (height << 600px) {} @@ -21987,7 +21987,7 @@ 146 | @media screen and (min-width: ) {} `---- - x Dimension(DimensionToken { value: 600.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("600", "px") }) + x Dimension(DimensionToken { value: 600.0, raw_value: "600", unit: Atom('px' type=static), type_flag: Integer, raw_unit: "px" }) ,-[$DIR/tests/fixture/at-rule/media/input.css:144:1] 144 | @media (height foo("bar")) {} 145 | @media (height + 600px) {} @@ -22467,7 +22467,7 @@ 149 | @media screen and func(100px) {} `---- - x Dimension(DimensionToken { value: 100.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("100", "px") }) + x Dimension(DimensionToken { value: 100.0, raw_value: "100", unit: Atom('px' type=static), type_flag: Integer, raw_unit: "px" }) ,-[$DIR/tests/fixture/at-rule/media/input.css:147:1] 147 | @media (aspect-ratio: 12/) {} 148 | @media func(100px) {} @@ -22611,7 +22611,7 @@ 150 | @media(min-width:calc(10px + 10px)) {} `---- - x Dimension(DimensionToken { value: 100.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("100", "px") }) + x Dimension(DimensionToken { value: 100.0, raw_value: "100", unit: Atom('px' type=static), type_flag: Integer, raw_unit: "px" }) ,-[$DIR/tests/fixture/at-rule/media/input.css:148:1] 148 | @media func(100px) {} 149 | @media screen and func(100px) {} diff --git a/crates/swc_css_parser/tests/fixture/function/calc/output.json b/crates/swc_css_parser/tests/fixture/function/calc/output.json index 064003be736c..ebbef9ab2284 100644 --- a/crates/swc_css_parser/tests/fixture/function/calc/output.json +++ b/crates/swc_css_parser/tests/fixture/function/calc/output.json @@ -372,12 +372,10 @@ "token": { "Dimension": { "value": 30.0, + "raw_value": "30", "unit": "px", "type": "integer", - "raw": [ - "30", - "px" - ] + "raw_unit": "px" } } } diff --git a/crates/swc_css_parser/tests/fixture/function/calc/span.swc-stderr b/crates/swc_css_parser/tests/fixture/function/calc/span.swc-stderr index 3dddf0b67c04..2d93fe1be54c 100644 --- a/crates/swc_css_parser/tests/fixture/function/calc/span.swc-stderr +++ b/crates/swc_css_parser/tests/fixture/function/calc/span.swc-stderr @@ -685,7 +685,7 @@ : ^^^^ `---- - x Dimension(DimensionToken { value: 30.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("30", "px") }) + x Dimension(DimensionToken { value: 30.0, raw_value: "30", unit: Atom('px' type=static), type_flag: Integer, raw_unit: "px" }) ,-[$DIR/tests/fixture/function/calc/input.css:5:1] 5 | div { 6 | --width: calc(10% + 30px); diff --git a/crates/swc_css_parser/tests/fixture/style-block/output.json b/crates/swc_css_parser/tests/fixture/style-block/output.json index 5ea670864037..0496b0a2b704 100644 --- a/crates/swc_css_parser/tests/fixture/style-block/output.json +++ b/crates/swc_css_parser/tests/fixture/style-block/output.json @@ -3459,12 +3459,10 @@ "token": { "Dimension": { "value": 100.0, + "raw_value": "100", "unit": "px", "type": "integer", - "raw": [ - "100", - "px" - ] + "raw_unit": "px" } } }, @@ -4382,12 +4380,10 @@ "token": { "Dimension": { "value": 16.0, + "raw_value": "16", "unit": "px", "type": "integer", - "raw": [ - "16", - "px" - ] + "raw_unit": "px" } } }, @@ -4459,12 +4455,10 @@ "token": { "Dimension": { "value": 16.0, + "raw_value": "16", "unit": "px", "type": "integer", - "raw": [ - "16", - "px" - ] + "raw_unit": "px" } } }, diff --git a/crates/swc_css_parser/tests/fixture/style-block/span.swc-stderr b/crates/swc_css_parser/tests/fixture/style-block/span.swc-stderr index 60ae7d4a02c5..29643a091773 100644 --- a/crates/swc_css_parser/tests/fixture/style-block/span.swc-stderr +++ b/crates/swc_css_parser/tests/fixture/style-block/span.swc-stderr @@ -4843,7 +4843,7 @@ 93 | } `---- - x Dimension(DimensionToken { value: 100.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("100", "px") }) + x Dimension(DimensionToken { value: 100.0, raw_value: "100", unit: Atom('px' type=static), type_flag: Integer, raw_unit: "px" }) ,-[$DIR/tests/fixture/style-block/input.css:91:1] 91 | @mixin mobile { 92 | height: 100px; @@ -5950,7 +5950,7 @@ 112 | height: 16px; `---- - x Dimension(DimensionToken { value: 16.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("16", "px") }) + x Dimension(DimensionToken { value: 16.0, raw_value: "16", unit: Atom('px' type=static), type_flag: Integer, raw_unit: "px" }) ,-[$DIR/tests/fixture/style-block/input.css:110:1] 110 | --small-icon: { 111 | width: 16px; @@ -6046,7 +6046,7 @@ 113 | } `---- - x Dimension(DimensionToken { value: 16.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("16", "px") }) + x Dimension(DimensionToken { value: 16.0, raw_value: "16", unit: Atom('px' type=static), type_flag: Integer, raw_unit: "px" }) ,-[$DIR/tests/fixture/style-block/input.css:111:1] 111 | width: 16px; 112 | height: 16px; diff --git a/crates/swc_css_parser/tests/fixture/value/custom-property/output.json b/crates/swc_css_parser/tests/fixture/value/custom-property/output.json index 74d11fdb9e94..c4b16b637314 100644 --- a/crates/swc_css_parser/tests/fixture/value/custom-property/output.json +++ b/crates/swc_css_parser/tests/fixture/value/custom-property/output.json @@ -630,12 +630,10 @@ "token": { "Dimension": { "value": 100.0, + "raw_value": "100", "unit": "vw", "type": "integer", - "raw": [ - "100", - "vw" - ] + "raw_unit": "vw" } } } @@ -2811,12 +2809,10 @@ "token": { "Dimension": { "value": 16.0, + "raw_value": "16", "unit": "px", "type": "integer", - "raw": [ - "16", - "px" - ] + "raw_unit": "px" } } }, @@ -2888,12 +2884,10 @@ "token": { "Dimension": { "value": 16.0, + "raw_value": "16", "unit": "px", "type": "integer", - "raw": [ - "16", - "px" - ] + "raw_unit": "px" } } }, diff --git a/crates/swc_css_parser/tests/fixture/value/custom-property/span.swc-stderr b/crates/swc_css_parser/tests/fixture/value/custom-property/span.swc-stderr index 0ecc4c307f19..ac780685d12d 100644 --- a/crates/swc_css_parser/tests/fixture/value/custom-property/span.swc-stderr +++ b/crates/swc_css_parser/tests/fixture/value/custom-property/span.swc-stderr @@ -1110,7 +1110,7 @@ 19 | --color: #06c; `---- - x Dimension(DimensionToken { value: 100.0, unit: Atom('vw' type=static), type_flag: Integer, raw: ("100", "vw") }) + x Dimension(DimensionToken { value: 100.0, raw_value: "100", unit: Atom('vw' type=static), type_flag: Integer, raw_unit: "vw" }) ,-[$DIR/tests/fixture/value/custom-property/input.css:17:1] 17 | --number: 1; 18 | --unit: 100vw; @@ -4154,7 +4154,7 @@ 54 | height: 16px; `---- - x Dimension(DimensionToken { value: 16.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("16", "px") }) + x Dimension(DimensionToken { value: 16.0, raw_value: "16", unit: Atom('px' type=static), type_flag: Integer, raw_unit: "px" }) ,-[$DIR/tests/fixture/value/custom-property/input.css:52:1] 52 | --small-icon: { 53 | width: 16px; @@ -4250,7 +4250,7 @@ 55 | } `---- - x Dimension(DimensionToken { value: 16.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("16", "px") }) + x Dimension(DimensionToken { value: 16.0, raw_value: "16", unit: Atom('px' type=static), type_flag: Integer, raw_unit: "px" }) ,-[$DIR/tests/fixture/value/custom-property/input.css:53:1] 53 | width: 16px; 54 | height: 16px; diff --git a/crates/swc_css_parser/tests/fixture/vendor/rome/custom-properties/output.json b/crates/swc_css_parser/tests/fixture/vendor/rome/custom-properties/output.json index bb139bc7f426..acd26f25221d 100644 --- a/crates/swc_css_parser/tests/fixture/vendor/rome/custom-properties/output.json +++ b/crates/swc_css_parser/tests/fixture/vendor/rome/custom-properties/output.json @@ -320,12 +320,10 @@ "token": { "Dimension": { "value": 12.0, + "raw_value": "12", "unit": "em", "type": "integer", - "raw": [ - "12", - "em" - ] + "raw_unit": "em" } } } @@ -360,12 +358,10 @@ "token": { "Dimension": { "value": 75.0, + "raw_value": "75", "unit": "ms", "type": "integer", - "raw": [ - "75", - "ms" - ] + "raw_unit": "ms" } } } diff --git a/crates/swc_css_parser/tests/fixture/vendor/rome/custom-properties/span.swc-stderr b/crates/swc_css_parser/tests/fixture/vendor/rome/custom-properties/span.swc-stderr index 8d197e5f7634..01a68ef825e7 100644 --- a/crates/swc_css_parser/tests/fixture/vendor/rome/custom-properties/span.swc-stderr +++ b/crates/swc_css_parser/tests/fixture/vendor/rome/custom-properties/span.swc-stderr @@ -540,7 +540,7 @@ 9 | --time: 75ms; `---- - x Dimension(DimensionToken { value: 12.0, unit: Atom('em' type=static), type_flag: Integer, raw: ("12", "em") }) + x Dimension(DimensionToken { value: 12.0, raw_value: "12", unit: Atom('em' type=static), type_flag: Integer, raw_unit: "em" }) ,-[$DIR/tests/fixture/vendor/rome/custom-properties/input.css:7:1] 7 | --number: 37; 8 | --length: 12em; @@ -596,7 +596,7 @@ 10 | --function: foo(); `---- - x Dimension(DimensionToken { value: 75.0, unit: Atom('ms' type=static), type_flag: Integer, raw: ("75", "ms") }) + x Dimension(DimensionToken { value: 75.0, raw_value: "75", unit: Atom('ms' type=static), type_flag: Integer, raw_unit: "ms" }) ,-[$DIR/tests/fixture/vendor/rome/custom-properties/input.css:8:1] 8 | --length: 12em; 9 | --time: 75ms; diff --git a/crates/swc_css_parser/tests/fixture/vendor/rome/functions/output.json b/crates/swc_css_parser/tests/fixture/vendor/rome/functions/output.json index 48c85b23b014..b498570daf25 100644 --- a/crates/swc_css_parser/tests/fixture/vendor/rome/functions/output.json +++ b/crates/swc_css_parser/tests/fixture/vendor/rome/functions/output.json @@ -108,12 +108,10 @@ "token": { "Dimension": { "value": 2.0, + "raw_value": "2", "unit": "px", "type": "integer", - "raw": [ - "2", - "px" - ] + "raw_unit": "px" } } } diff --git a/crates/swc_css_parser/tests/fixture/vendor/rome/functions/span.swc-stderr b/crates/swc_css_parser/tests/fixture/vendor/rome/functions/span.swc-stderr index e9f37b6728ab..d9179edbec9b 100644 --- a/crates/swc_css_parser/tests/fixture/vendor/rome/functions/span.swc-stderr +++ b/crates/swc_css_parser/tests/fixture/vendor/rome/functions/span.swc-stderr @@ -144,7 +144,7 @@ 3 | border: var(--fancy); `---- - x Dimension(DimensionToken { value: 2.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("2", "px") }) + x Dimension(DimensionToken { value: 2.0, raw_value: "2", unit: Atom('px' type=static), type_flag: Integer, raw_unit: "px" }) ,-[$DIR/tests/fixture/vendor/rome/functions/input.css:1:1] 1 | .style { 2 | --fancy: 2px; diff --git a/crates/swc_css_parser/tests/recovery/at-rule/media/condition-and-or/output.json b/crates/swc_css_parser/tests/recovery/at-rule/media/condition-and-or/output.json index 26a69d0a7194..034b55a2a34d 100644 --- a/crates/swc_css_parser/tests/recovery/at-rule/media/condition-and-or/output.json +++ b/crates/swc_css_parser/tests/recovery/at-rule/media/condition-and-or/output.json @@ -161,12 +161,10 @@ "token": { "Dimension": { "value": 900.0, + "raw_value": "900", "unit": "px", "type": "integer", - "raw": [ - "900", - "px" - ] + "raw_unit": "px" } } } @@ -275,12 +273,10 @@ "token": { "Dimension": { "value": 1200.0, + "raw_value": "1200", "unit": "px", "type": "integer", - "raw": [ - "1200", - "px" - ] + "raw_unit": "px" } } } diff --git a/crates/swc_css_parser/tests/recovery/at-rule/media/condition-and-or/span.swc-stderr b/crates/swc_css_parser/tests/recovery/at-rule/media/condition-and-or/span.swc-stderr index 7a6801d22ce8..797d467f8ab1 100644 --- a/crates/swc_css_parser/tests/recovery/at-rule/media/condition-and-or/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/at-rule/media/condition-and-or/span.swc-stderr @@ -149,7 +149,7 @@ : ^^^^^ `---- - x Dimension(DimensionToken { value: 900.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("900", "px") }) + x Dimension(DimensionToken { value: 900.0, raw_value: "900", unit: Atom('px' type=static), type_flag: Integer, raw_unit: "px" }) ,-[$DIR/tests/recovery/at-rule/media/condition-and-or/input.css:1:1] 1 | @media screen and (min-width: 900px) or (min-width: 1200px) {} : ^^^^^ @@ -251,7 +251,7 @@ : ^^^^^^ `---- - x Dimension(DimensionToken { value: 1200.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("1200", "px") }) + x Dimension(DimensionToken { value: 1200.0, raw_value: "1200", unit: Atom('px' type=static), type_flag: Integer, raw_unit: "px" }) ,-[$DIR/tests/recovery/at-rule/media/condition-and-or/input.css:1:1] 1 | @media screen and (min-width: 900px) or (min-width: 1200px) {} : ^^^^^^ diff --git a/crates/swc_css_parser/tests/recovery/at-rule/media/feature-name-1/output.json b/crates/swc_css_parser/tests/recovery/at-rule/media/feature-name-1/output.json index c7a4a96badfd..252edfd51ef4 100644 --- a/crates/swc_css_parser/tests/recovery/at-rule/media/feature-name-1/output.json +++ b/crates/swc_css_parser/tests/recovery/at-rule/media/feature-name-1/output.json @@ -71,12 +71,10 @@ "token": { "Dimension": { "value": 20.0, + "raw_value": "20", "unit": "px", "type": "integer", - "raw": [ - "20", - "px" - ] + "raw_unit": "px" } } }, @@ -112,12 +110,10 @@ "token": { "Dimension": { "value": 20.0, + "raw_value": "20", "unit": "px", "type": "integer", - "raw": [ - "20", - "px" - ] + "raw_unit": "px" } } } diff --git a/crates/swc_css_parser/tests/recovery/at-rule/media/feature-name-1/span.swc-stderr b/crates/swc_css_parser/tests/recovery/at-rule/media/feature-name-1/span.swc-stderr index 1d2598dfb2b3..71450206a19f 100644 --- a/crates/swc_css_parser/tests/recovery/at-rule/media/feature-name-1/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/at-rule/media/feature-name-1/span.swc-stderr @@ -65,7 +65,7 @@ : ^^^^ `---- - x Dimension(DimensionToken { value: 20.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("20", "px") }) + x Dimension(DimensionToken { value: 20.0, raw_value: "20", unit: Atom('px' type=static), type_flag: Integer, raw_unit: "px" }) ,-[$DIR/tests/recovery/at-rule/media/feature-name-1/input.css:1:1] 1 | @media (20px: 20px) {} : ^^^^ @@ -101,7 +101,7 @@ : ^^^^ `---- - x Dimension(DimensionToken { value: 20.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("20", "px") }) + x Dimension(DimensionToken { value: 20.0, raw_value: "20", unit: Atom('px' type=static), type_flag: Integer, raw_unit: "px" }) ,-[$DIR/tests/recovery/at-rule/media/feature-name-1/input.css:1:1] 1 | @media (20px: 20px) {} : ^^^^ diff --git a/crates/swc_css_parser/tests/recovery/at-rule/media/feature-name/output.json b/crates/swc_css_parser/tests/recovery/at-rule/media/feature-name/output.json index d40ea2c7704e..c480334823dc 100644 --- a/crates/swc_css_parser/tests/recovery/at-rule/media/feature-name/output.json +++ b/crates/swc_css_parser/tests/recovery/at-rule/media/feature-name/output.json @@ -107,12 +107,10 @@ "token": { "Dimension": { "value": 20.0, + "raw_value": "20", "unit": "px", "type": "integer", - "raw": [ - "20", - "px" - ] + "raw_unit": "px" } } } diff --git a/crates/swc_css_parser/tests/recovery/at-rule/media/feature-name/span.swc-stderr b/crates/swc_css_parser/tests/recovery/at-rule/media/feature-name/span.swc-stderr index 733c083169b2..408c7229c75e 100644 --- a/crates/swc_css_parser/tests/recovery/at-rule/media/feature-name/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/at-rule/media/feature-name/span.swc-stderr @@ -101,7 +101,7 @@ : ^^^^ `---- - x Dimension(DimensionToken { value: 20.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("20", "px") }) + x Dimension(DimensionToken { value: 20.0, raw_value: "20", unit: Atom('px' type=static), type_flag: Integer, raw_unit: "px" }) ,-[$DIR/tests/recovery/at-rule/media/feature-name/input.css:1:1] 1 | @media ("min-width": 20px) {} : ^^^^ diff --git a/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-2/output.json b/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-2/output.json index eb82625f8c18..cc5ec0879ed5 100644 --- a/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-2/output.json +++ b/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-2/output.json @@ -71,12 +71,10 @@ "token": { "Dimension": { "value": 400.0, + "raw_value": "400", "unit": "px", "type": "integer", - "raw": [ - "400", - "px" - ] + "raw_unit": "px" } } }, @@ -182,12 +180,10 @@ "token": { "Dimension": { "value": 700.0, + "raw_value": "700", "unit": "px", "type": "integer", - "raw": [ - "700", - "px" - ] + "raw_unit": "px" } } } diff --git a/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-2/span.swc-stderr b/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-2/span.swc-stderr index d34abe9eefb1..3c0e790f1af6 100644 --- a/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-2/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-2/span.swc-stderr @@ -65,7 +65,7 @@ : ^^^^^ `---- - x Dimension(DimensionToken { value: 400.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("400", "px") }) + x Dimension(DimensionToken { value: 400.0, raw_value: "400", unit: Atom('px' type=static), type_flag: Integer, raw_unit: "px" }) ,-[$DIR/tests/recovery/at-rule/media/feature-range-2/input.css:1:1] 1 | @media (400px > "width" > 700px) {} : ^^^^^ @@ -161,7 +161,7 @@ : ^^^^^ `---- - x Dimension(DimensionToken { value: 700.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("700", "px") }) + x Dimension(DimensionToken { value: 700.0, raw_value: "700", unit: Atom('px' type=static), type_flag: Integer, raw_unit: "px" }) ,-[$DIR/tests/recovery/at-rule/media/feature-range-2/input.css:1:1] 1 | @media (400px > "width" > 700px) {} : ^^^^^ diff --git a/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-3/output.json b/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-3/output.json index 1c1ff3e4379d..635829644101 100644 --- a/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-3/output.json +++ b/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-3/output.json @@ -71,12 +71,10 @@ "token": { "Dimension": { "value": 400.0, + "raw_value": "400", "unit": "px", "type": "integer", - "raw": [ - "400", - "px" - ] + "raw_unit": "px" } } }, @@ -234,12 +232,10 @@ "token": { "Dimension": { "value": 700.0, + "raw_value": "700", "unit": "px", "type": "integer", - "raw": [ - "700", - "px" - ] + "raw_unit": "px" } } } diff --git a/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-3/span.swc-stderr b/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-3/span.swc-stderr index d8461a5e3f42..dbc7f21250ea 100644 --- a/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-3/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-3/span.swc-stderr @@ -65,7 +65,7 @@ : ^^^^^ `---- - x Dimension(DimensionToken { value: 400.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("400", "px") }) + x Dimension(DimensionToken { value: 400.0, raw_value: "400", unit: Atom('px' type=static), type_flag: Integer, raw_unit: "px" }) ,-[$DIR/tests/recovery/at-rule/media/feature-range-3/input.css:1:1] 1 | @media (400px > = width > = 700px) {} : ^^^^^ @@ -209,7 +209,7 @@ : ^^^^^ `---- - x Dimension(DimensionToken { value: 700.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("700", "px") }) + x Dimension(DimensionToken { value: 700.0, raw_value: "700", unit: Atom('px' type=static), type_flag: Integer, raw_unit: "px" }) ,-[$DIR/tests/recovery/at-rule/media/feature-range-3/input.css:1:1] 1 | @media (400px > = width > = 700px) {} : ^^^^^ diff --git a/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-4/output.json b/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-4/output.json index a80e590d80cb..19c04c403706 100644 --- a/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-4/output.json +++ b/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-4/output.json @@ -71,12 +71,10 @@ "token": { "Dimension": { "value": 400.0, + "raw_value": "400", "unit": "px", "type": "integer", - "raw": [ - "400", - "px" - ] + "raw_unit": "px" } } }, @@ -195,12 +193,10 @@ "token": { "Dimension": { "value": 700.0, + "raw_value": "700", "unit": "px", "type": "integer", - "raw": [ - "700", - "px" - ] + "raw_unit": "px" } } } diff --git a/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-4/span.swc-stderr b/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-4/span.swc-stderr index 4bd1e545cc6b..26de2732496e 100644 --- a/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-4/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-4/span.swc-stderr @@ -65,7 +65,7 @@ : ^^^^^ `---- - x Dimension(DimensionToken { value: 400.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("400", "px") }) + x Dimension(DimensionToken { value: 400.0, raw_value: "400", unit: Atom('px' type=static), type_flag: Integer, raw_unit: "px" }) ,-[$DIR/tests/recovery/at-rule/media/feature-range-4/input.css:1:1] 1 | @media (400px >= width ! 700px) {} : ^^^^^ @@ -173,7 +173,7 @@ : ^^^^^ `---- - x Dimension(DimensionToken { value: 700.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("700", "px") }) + x Dimension(DimensionToken { value: 700.0, raw_value: "700", unit: Atom('px' type=static), type_flag: Integer, raw_unit: "px" }) ,-[$DIR/tests/recovery/at-rule/media/feature-range-4/input.css:1:1] 1 | @media (400px >= width ! 700px) {} : ^^^^^ diff --git a/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-5/output.json b/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-5/output.json index 68c5ba1ba485..417c643e8066 100644 --- a/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-5/output.json +++ b/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-5/output.json @@ -71,12 +71,10 @@ "token": { "Dimension": { "value": 400.0, + "raw_value": "400", "unit": "px", "type": "integer", - "raw": [ - "400", - "px" - ] + "raw_unit": "px" } } }, @@ -208,12 +206,10 @@ "token": { "Dimension": { "value": 700.0, + "raw_value": "700", "unit": "px", "type": "integer", - "raw": [ - "700", - "px" - ] + "raw_unit": "px" } } } diff --git a/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-5/span.swc-stderr b/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-5/span.swc-stderr index 768852f007ea..0889c36b2617 100644 --- a/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-5/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-5/span.swc-stderr @@ -65,7 +65,7 @@ : ^^^^^ `---- - x Dimension(DimensionToken { value: 400.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("400", "px") }) + x Dimension(DimensionToken { value: 400.0, raw_value: "400", unit: Atom('px' type=static), type_flag: Integer, raw_unit: "px" }) ,-[$DIR/tests/recovery/at-rule/media/feature-range-5/input.css:1:1] 1 | @media (400px <= width >= 700px) {} : ^^^^^ @@ -185,7 +185,7 @@ : ^^^^^ `---- - x Dimension(DimensionToken { value: 700.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("700", "px") }) + x Dimension(DimensionToken { value: 700.0, raw_value: "700", unit: Atom('px' type=static), type_flag: Integer, raw_unit: "px" }) ,-[$DIR/tests/recovery/at-rule/media/feature-range-5/input.css:1:1] 1 | @media (400px <= width >= 700px) {} : ^^^^^ diff --git a/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-6/output.json b/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-6/output.json index e3b93d489d37..fb120ee98874 100644 --- a/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-6/output.json +++ b/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-6/output.json @@ -71,12 +71,10 @@ "token": { "Dimension": { "value": 400.0, + "raw_value": "400", "unit": "px", "type": "integer", - "raw": [ - "400", - "px" - ] + "raw_unit": "px" } } }, @@ -208,12 +206,10 @@ "token": { "Dimension": { "value": 700.0, + "raw_value": "700", "unit": "px", "type": "integer", - "raw": [ - "700", - "px" - ] + "raw_unit": "px" } } } diff --git a/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-6/span.swc-stderr b/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-6/span.swc-stderr index f4918d81cabd..9a92dc3b2682 100644 --- a/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-6/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/at-rule/media/feature-range-6/span.swc-stderr @@ -65,7 +65,7 @@ : ^^^^^ `---- - x Dimension(DimensionToken { value: 400.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("400", "px") }) + x Dimension(DimensionToken { value: 400.0, raw_value: "400", unit: Atom('px' type=static), type_flag: Integer, raw_unit: "px" }) ,-[$DIR/tests/recovery/at-rule/media/feature-range-6/input.css:1:1] 1 | @media (400px >= width <= 700px) {} : ^^^^^ @@ -185,7 +185,7 @@ : ^^^^^ `---- - x Dimension(DimensionToken { value: 700.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("700", "px") }) + x Dimension(DimensionToken { value: 700.0, raw_value: "700", unit: Atom('px' type=static), type_flag: Integer, raw_unit: "px" }) ,-[$DIR/tests/recovery/at-rule/media/feature-range-6/input.css:1:1] 1 | @media (400px >= width <= 700px) {} : ^^^^^ diff --git a/crates/swc_css_parser/tests/recovery/at-rule/media/invalid-nesting/output.json b/crates/swc_css_parser/tests/recovery/at-rule/media/invalid-nesting/output.json index 2292830b1a8f..81b0cdc677b1 100644 --- a/crates/swc_css_parser/tests/recovery/at-rule/media/invalid-nesting/output.json +++ b/crates/swc_css_parser/tests/recovery/at-rule/media/invalid-nesting/output.json @@ -171,12 +171,10 @@ "token": { "Dimension": { "value": 1024.0, + "raw_value": "1024", "unit": "px", "type": "integer", - "raw": [ - "1024", - "px" - ] + "raw_unit": "px" } } }, diff --git a/crates/swc_css_parser/tests/recovery/at-rule/media/invalid-nesting/span.swc-stderr b/crates/swc_css_parser/tests/recovery/at-rule/media/invalid-nesting/span.swc-stderr index 2aa7dc62c0b6..ae5c79cc669d 100644 --- a/crates/swc_css_parser/tests/recovery/at-rule/media/invalid-nesting/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/at-rule/media/invalid-nesting/span.swc-stderr @@ -218,7 +218,7 @@ 3 | } `---- - x Dimension(DimensionToken { value: 1024.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("1024", "px") }) + x Dimension(DimensionToken { value: 1024.0, raw_value: "1024", unit: Atom('px' type=static), type_flag: Integer, raw_unit: "px" }) ,-[$DIR/tests/recovery/at-rule/media/invalid-nesting/input.css:1:1] 1 | @media (min-width: 480px) { 2 | max-inline-size: 1024px; diff --git a/crates/swc_css_parser/tests/recovery/at-rule/supports/wrong-or-and/output.json b/crates/swc_css_parser/tests/recovery/at-rule/supports/wrong-or-and/output.json index 0ccd958b2cc0..c2e554ec09cf 100644 --- a/crates/swc_css_parser/tests/recovery/at-rule/supports/wrong-or-and/output.json +++ b/crates/swc_css_parser/tests/recovery/at-rule/supports/wrong-or-and/output.json @@ -343,12 +343,10 @@ "token": { "Dimension": { "value": 10.0, + "raw_value": "10", "unit": "deg", "type": "integer", - "raw": [ - "10", - "deg" - ] + "raw_unit": "deg" } } } diff --git a/crates/swc_css_parser/tests/recovery/at-rule/supports/wrong-or-and/span.swc-stderr b/crates/swc_css_parser/tests/recovery/at-rule/supports/wrong-or-and/span.swc-stderr index 7dd7bd16563c..71998d91140d 100644 --- a/crates/swc_css_parser/tests/recovery/at-rule/supports/wrong-or-and/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/at-rule/supports/wrong-or-and/span.swc-stderr @@ -323,7 +323,7 @@ : ^^^^^ `---- - x Dimension(DimensionToken { value: 10.0, unit: Atom('deg' type=static), type_flag: Integer, raw: ("10", "deg") }) + x Dimension(DimensionToken { value: 10.0, raw_value: "10", unit: Atom('deg' type=static), type_flag: Integer, raw_unit: "deg" }) ,-[$DIR/tests/recovery/at-rule/supports/wrong-or-and/input.css:1:1] 1 | @supports (transition-property: color) or (animation-name: foo) and (transform: rotate(10deg)) {} : ^^^^^ diff --git a/crates/swc_css_parser/tests/recovery/declaration/wrong-name-3/output.json b/crates/swc_css_parser/tests/recovery/declaration/wrong-name-3/output.json index 6668d38dd39b..5bf718998369 100644 --- a/crates/swc_css_parser/tests/recovery/declaration/wrong-name-3/output.json +++ b/crates/swc_css_parser/tests/recovery/declaration/wrong-name-3/output.json @@ -123,12 +123,10 @@ "token": { "Dimension": { "value": 20.0, + "raw_value": "20", "unit": "px", "type": "integer", - "raw": [ - "20", - "px" - ] + "raw_unit": "px" } } } diff --git a/crates/swc_css_parser/tests/recovery/declaration/wrong-name-3/span.swc-stderr b/crates/swc_css_parser/tests/recovery/declaration/wrong-name-3/span.swc-stderr index 2ecf408320e6..388dc0a7b7f5 100644 --- a/crates/swc_css_parser/tests/recovery/declaration/wrong-name-3/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/declaration/wrong-name-3/span.swc-stderr @@ -131,7 +131,7 @@ 3 | } `---- - x Dimension(DimensionToken { value: 20.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("20", "px") }) + x Dimension(DimensionToken { value: 20.0, raw_value: "20", unit: Atom('px' type=static), type_flag: Integer, raw_unit: "px" }) ,-[$DIR/tests/recovery/declaration/wrong-name-3/input.css:1:1] 1 | a { 2 | func(20px); diff --git a/crates/swc_css_parser/tests/recovery/function/calc/space/output.json b/crates/swc_css_parser/tests/recovery/function/calc/space/output.json index 4a1eb7d2acb6..307873d04b9b 100644 --- a/crates/swc_css_parser/tests/recovery/function/calc/space/output.json +++ b/crates/swc_css_parser/tests/recovery/function/calc/space/output.json @@ -126,12 +126,10 @@ "token": { "Dimension": { "value": 2.0, + "raw_value": "2", "unit": "px", "type": "integer", - "raw": [ - "2", - "px" - ] + "raw_unit": "px" } } }, @@ -145,12 +143,10 @@ "token": { "Dimension": { "value": 1.0, + "raw_value": "+1", "unit": "px", "type": "integer", - "raw": [ - "+1", - "px" - ] + "raw_unit": "px" } } } diff --git a/crates/swc_css_parser/tests/recovery/function/calc/space/span.swc-stderr b/crates/swc_css_parser/tests/recovery/function/calc/space/span.swc-stderr index eecc56b85a0b..bc6d9ef72a1d 100644 --- a/crates/swc_css_parser/tests/recovery/function/calc/space/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/function/calc/space/span.swc-stderr @@ -148,7 +148,7 @@ 3 | } `---- - x Dimension(DimensionToken { value: 2.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("2", "px") }) + x Dimension(DimensionToken { value: 2.0, raw_value: "2", unit: Atom('px' type=static), type_flag: Integer, raw_unit: "px" }) ,-[$DIR/tests/recovery/function/calc/space/input.css:1:1] 1 | .style { 2 | width: calc(2px+1px); @@ -164,7 +164,7 @@ 3 | } `---- - x Dimension(DimensionToken { value: 1.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("+1", "px") }) + x Dimension(DimensionToken { value: 1.0, raw_value: "+1", unit: Atom('px' type=static), type_flag: Integer, raw_unit: "px" }) ,-[$DIR/tests/recovery/function/calc/space/input.css:1:1] 1 | .style { 2 | width: calc(2px+1px); diff --git a/crates/swc_css_parser/tests/recovery/function/unclosed-2/output.json b/crates/swc_css_parser/tests/recovery/function/unclosed-2/output.json index fd24e6194461..56a715cbfdb8 100644 --- a/crates/swc_css_parser/tests/recovery/function/unclosed-2/output.json +++ b/crates/swc_css_parser/tests/recovery/function/unclosed-2/output.json @@ -209,12 +209,10 @@ "token": { "Dimension": { "value": 12.0, + "raw_value": "12", "unit": "px", "type": "integer", - "raw": [ - "12", - "px" - ] + "raw_unit": "px" } } }, diff --git a/crates/swc_css_parser/tests/recovery/function/unclosed-2/span.swc-stderr b/crates/swc_css_parser/tests/recovery/function/unclosed-2/span.swc-stderr index 2d8837624e04..faf8f291a07c 100644 --- a/crates/swc_css_parser/tests/recovery/function/unclosed-2/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/function/unclosed-2/span.swc-stderr @@ -247,7 +247,7 @@ 3 | } `---- - x Dimension(DimensionToken { value: 12.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("12", "px") }) + x Dimension(DimensionToken { value: 12.0, raw_value: "12", unit: Atom('px' type=static), type_flag: Integer, raw_unit: "px" }) ,-[$DIR/tests/recovery/function/unclosed-2/input.css:1:1] 1 | .style { 2 | grid-template-columns: repeat(4, [col-start] 12px diff --git a/crates/swc_css_parser/tests/recovery/function/unclosed/output.json b/crates/swc_css_parser/tests/recovery/function/unclosed/output.json index 8b7b54e6f9cb..ebfeb75ce3c9 100644 --- a/crates/swc_css_parser/tests/recovery/function/unclosed/output.json +++ b/crates/swc_css_parser/tests/recovery/function/unclosed/output.json @@ -126,12 +126,10 @@ "token": { "Dimension": { "value": 500.0, + "raw_value": "500", "unit": "px", "type": "integer", - "raw": [ - "500", - "px" - ] + "raw_unit": "px" } } }, diff --git a/crates/swc_css_parser/tests/recovery/function/unclosed/span.swc-stderr b/crates/swc_css_parser/tests/recovery/function/unclosed/span.swc-stderr index 0b36ed615215..5bdda11cb671 100644 --- a/crates/swc_css_parser/tests/recovery/function/unclosed/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/function/unclosed/span.swc-stderr @@ -143,7 +143,7 @@ 3 | } `---- - x Dimension(DimensionToken { value: 500.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("500", "px") }) + x Dimension(DimensionToken { value: 500.0, raw_value: "500", unit: Atom('px' type=static), type_flag: Integer, raw_unit: "px" }) ,-[$DIR/tests/recovery/function/unclosed/input.css:1:1] 1 | .style { 2 | width: min(500px; diff --git a/crates/swc_css_parser/tests/recovery/number/output.json b/crates/swc_css_parser/tests/recovery/number/output.json index d8a88bf60d37..4002a7bd6c1c 100644 --- a/crates/swc_css_parser/tests/recovery/number/output.json +++ b/crates/swc_css_parser/tests/recovery/number/output.json @@ -115,12 +115,10 @@ "token": { "Dimension": { "value": 10.1, + "raw_value": "10.10", "unit": "px", "type": "number", - "raw": [ - "10.10", - "px" - ] + "raw_unit": "px" } } }, @@ -183,12 +181,10 @@ "token": { "Dimension": { "value": 10.0, + "raw_value": "10", "unit": "px", "type": "integer", - "raw": [ - "10", - "px" - ] + "raw_unit": "px" } } }, diff --git a/crates/swc_css_parser/tests/recovery/number/span.swc-stderr b/crates/swc_css_parser/tests/recovery/number/span.swc-stderr index 5d5cc60b6678..e8e45ce8648d 100644 --- a/crates/swc_css_parser/tests/recovery/number/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/number/span.swc-stderr @@ -149,7 +149,7 @@ 3 | prop1: 10px `---- - x Dimension(DimensionToken { value: 10.1, unit: Atom('px' type=static), type_flag: Number, raw: ("10.10", "px") }) + x Dimension(DimensionToken { value: 10.1, raw_value: "10.10", unit: Atom('px' type=static), type_flag: Number, raw_unit: "px" }) ,-[$DIR/tests/recovery/number/input.css:1:1] 1 | a { 2 | prop: 10.10px @@ -229,7 +229,7 @@ 4 | prop2: 10 `---- - x Dimension(DimensionToken { value: 10.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("10", "px") }) + x Dimension(DimensionToken { value: 10.0, raw_value: "10", unit: Atom('px' type=static), type_flag: Integer, raw_unit: "px" }) ,-[$DIR/tests/recovery/number/input.css:2:1] 2 | prop: 10.10px 3 | prop1: 10px diff --git a/crates/swc_css_parser/tests/recovery/style-blocks-contents/invalid-nested-1/output.json b/crates/swc_css_parser/tests/recovery/style-blocks-contents/invalid-nested-1/output.json index 6b73dfd2f8c9..f3f8a360c520 100644 --- a/crates/swc_css_parser/tests/recovery/style-blocks-contents/invalid-nested-1/output.json +++ b/crates/swc_css_parser/tests/recovery/style-blocks-contents/invalid-nested-1/output.json @@ -229,12 +229,10 @@ "token": { "Dimension": { "value": 1.0, + "raw_value": "1", "unit": "em", "type": "integer", - "raw": [ - "1", - "em" - ] + "raw_unit": "em" } } }, diff --git a/crates/swc_css_parser/tests/recovery/style-blocks-contents/invalid-nested-1/span.swc-stderr b/crates/swc_css_parser/tests/recovery/style-blocks-contents/invalid-nested-1/span.swc-stderr index e52853f25e98..fca6ca34985b 100644 --- a/crates/swc_css_parser/tests/recovery/style-blocks-contents/invalid-nested-1/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/style-blocks-contents/invalid-nested-1/span.swc-stderr @@ -296,7 +296,7 @@ 6 | } `---- - x Dimension(DimensionToken { value: 1.0, unit: Atom('em' type=static), type_flag: Integer, raw: ("1", "em") }) + x Dimension(DimensionToken { value: 1.0, raw_value: "1", unit: Atom('em' type=static), type_flag: Integer, raw_unit: "em" }) ,-[$DIR/tests/recovery/style-blocks-contents/invalid-nested-1/input.css:4:1] 4 | input { 5 | margin: 1em; diff --git a/crates/swc_css_parser/tests/recovery/unicode-range/output.json b/crates/swc_css_parser/tests/recovery/unicode-range/output.json index 1ca2e4deec7e..d1a4dbdd859e 100644 --- a/crates/swc_css_parser/tests/recovery/unicode-range/output.json +++ b/crates/swc_css_parser/tests/recovery/unicode-range/output.json @@ -122,12 +122,10 @@ "token": { "Dimension": { "value": 1.0, + "raw_value": "+1", "unit": "Z1ee1-FFFFFF", "type": "integer", - "raw": [ - "+1", - "Z1ee1-FFFFFF" - ] + "raw_unit": "Z1ee1-FFFFFF" } } } @@ -176,12 +174,10 @@ "token": { "Dimension": { "value": 10.0, + "raw_value": "+1e1", "unit": "ee1-FFZFFF", "type": "number", - "raw": [ - "+1e1", - "ee1-FFZFFF" - ] + "raw_unit": "ee1-FFZFFF" } } } diff --git a/crates/swc_css_parser/tests/recovery/unicode-range/span.swc-stderr b/crates/swc_css_parser/tests/recovery/unicode-range/span.swc-stderr index 80af171efa6c..ab506c7e570c 100644 --- a/crates/swc_css_parser/tests/recovery/unicode-range/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/unicode-range/span.swc-stderr @@ -144,7 +144,7 @@ 3 | unicode-range: U+1e1ee1-FFZFFF; `---- - x Dimension(DimensionToken { value: 1.0, unit: Atom('Z1ee1-FFFFFF' type=dynamic), type_flag: Integer, raw: ("+1", "Z1ee1-FFFFFF") }) + x Dimension(DimensionToken { value: 1.0, raw_value: "+1", unit: Atom('Z1ee1-FFFFFF' type=dynamic), type_flag: Integer, raw_unit: "Z1ee1-FFFFFF" }) ,-[$DIR/tests/recovery/unicode-range/input.css:1:1] 1 | .class { 2 | unicode-range: U+1Z1ee1-FFFFFF; @@ -216,7 +216,7 @@ 4 | } `---- - x Dimension(DimensionToken { value: 10.0, unit: Atom('ee1-FFZFFF' type=dynamic), type_flag: Number, raw: ("+1e1", "ee1-FFZFFF") }) + x Dimension(DimensionToken { value: 10.0, raw_value: "+1e1", unit: Atom('ee1-FFZFFF' type=dynamic), type_flag: Number, raw_unit: "ee1-FFZFFF" }) ,-[$DIR/tests/recovery/unicode-range/input.css:2:1] 2 | unicode-range: U+1Z1ee1-FFFFFF; 3 | unicode-range: U+1e1ee1-FFZFFF; diff --git a/crates/swc_css_parser/tests/recovery/vercel/004/output.json b/crates/swc_css_parser/tests/recovery/vercel/004/output.json index f4de07deb0b5..0aa03c837ba4 100644 --- a/crates/swc_css_parser/tests/recovery/vercel/004/output.json +++ b/crates/swc_css_parser/tests/recovery/vercel/004/output.json @@ -218,12 +218,10 @@ "token": { "Dimension": { "value": 7.0, + "raw_value": "7", "unit": "px", "type": "integer", - "raw": [ - "7", - "px" - ] + "raw_unit": "px" } } }, diff --git a/crates/swc_css_parser/tests/recovery/vercel/004/span.swc-stderr b/crates/swc_css_parser/tests/recovery/vercel/004/span.swc-stderr index 3eebab1a35ed..8f93ebf6c26e 100644 --- a/crates/swc_css_parser/tests/recovery/vercel/004/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/vercel/004/span.swc-stderr @@ -288,7 +288,7 @@ 5 | color: white; `---- - x Dimension(DimensionToken { value: 7.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("7", "px") }) + x Dimension(DimensionToken { value: 7.0, raw_value: "7", unit: Atom('px' type=static), type_flag: Integer, raw_unit: "px" }) ,-[$DIR/tests/recovery/vercel/004/input.css:3:1] 3 | __ident__ 4 | border-radius: 7px; diff --git a/crates/swc_css_parser/tests/recovery/vercel/005/output.json b/crates/swc_css_parser/tests/recovery/vercel/005/output.json index 26a089aadf08..a3c55442a090 100644 --- a/crates/swc_css_parser/tests/recovery/vercel/005/output.json +++ b/crates/swc_css_parser/tests/recovery/vercel/005/output.json @@ -153,12 +153,10 @@ "token": { "Dimension": { "value": 7.0, + "raw_value": "7", "unit": "px", "type": "integer", - "raw": [ - "7", - "px" - ] + "raw_unit": "px" } } }, diff --git a/crates/swc_css_parser/tests/recovery/vercel/005/span.swc-stderr b/crates/swc_css_parser/tests/recovery/vercel/005/span.swc-stderr index a9bc46609307..4a6e2949e60d 100644 --- a/crates/swc_css_parser/tests/recovery/vercel/005/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/vercel/005/span.swc-stderr @@ -216,7 +216,7 @@ 5 | color: white; `---- - x Dimension(DimensionToken { value: 7.0, unit: Atom('px' type=static), type_flag: Integer, raw: ("7", "px") }) + x Dimension(DimensionToken { value: 7.0, raw_value: "7", unit: Atom('px' type=static), type_flag: Integer, raw_unit: "px" }) ,-[$DIR/tests/recovery/vercel/005/input.css:3:1] 3 | __ident__ 4 | border-radius: 7px; From f2360a6b8d19a07bdb32229a0b845360260b651f Mon Sep 17 00:00:00 2001 From: "alexander.akait" Date: Mon, 5 Dec 2022 06:24:26 +0300 Subject: [PATCH 40/42] refactor: bad url token + fix bugs --- crates/swc_css_ast/src/token.rs | 2 +- crates/swc_css_codegen/src/lib.rs | 9 +- .../tests/fixture/values/url/1/input.css | 4 + .../tests/fixture/values/url/1/output.css | 3 + .../tests/fixture/values/url/1/output.min.css | 2 +- crates/swc_css_minifier/src/compressor/mod.rs | 2 +- crates/swc_css_parser/src/lexer/mod.rs | 47 ++----- .../bad-url-token/double-quotes/output.json | 5 +- .../double-quotes/span.swc-stderr | 2 +- .../bad-url-token/escaped/output.json | 5 +- .../bad-url-token/escaped/span.swc-stderr | 2 +- .../bad-url-token/invalid-escape/output.json | 5 +- .../invalid-escape/span.swc-stderr | 2 +- .../left-parenthesis/output.json | 5 +- .../left-parenthesis/span.swc-stderr | 2 +- .../bad-url-token/single-quotes/output.json | 5 +- .../single-quotes/span.swc-stderr | 2 +- .../recovery/bad-url-token/unclosed/input.css | 3 + .../bad-url-token/unclosed/output.json | 121 +++++++++++++++++ .../bad-url-token/unclosed/output.swc-stderr | 14 ++ .../bad-url-token/unclosed/span.swc-stderr | 128 ++++++++++++++++++ .../whitespace-in-middle/output.json | 5 +- .../whitespace-in-middle/span.swc-stderr | 2 +- .../bad-url-token/whitespace/output.json | 5 +- .../bad-url-token/whitespace/span.swc-stderr | 2 +- .../declaration/bad-value/output.json | 5 +- .../declaration/bad-value/span.swc-stderr | 2 +- .../function/bad-comment-2/output.json | 5 +- .../function/bad-comment-2/span.swc-stderr | 2 +- .../recovery/function/bad-comment/output.json | 5 +- .../function/bad-comment/span.swc-stderr | 2 +- .../recovery/value/url/basic/output.json | 10 +- .../recovery/value/url/basic/span.swc-stderr | 4 +- .../value/url/parenthesis/output.json | 5 +- .../value/url/parenthesis/span.swc-stderr | 2 +- 35 files changed, 315 insertions(+), 111 deletions(-) create mode 100644 crates/swc_css_parser/tests/recovery/bad-url-token/unclosed/input.css create mode 100644 crates/swc_css_parser/tests/recovery/bad-url-token/unclosed/output.json create mode 100644 crates/swc_css_parser/tests/recovery/bad-url-token/unclosed/output.swc-stderr create mode 100644 crates/swc_css_parser/tests/recovery/bad-url-token/unclosed/span.swc-stderr diff --git a/crates/swc_css_ast/src/token.rs b/crates/swc_css_ast/src/token.rs index 268d605ccbda..cba51899df7c 100644 --- a/crates/swc_css_ast/src/token.rs +++ b/crates/swc_css_ast/src/token.rs @@ -103,7 +103,7 @@ pub enum Token { raw: Box<(Atom, Atom)>, }, BadUrl { - raw: Box<(Atom, Atom)>, + raw: Atom, }, Delim { value: char, diff --git a/crates/swc_css_codegen/src/lib.rs b/crates/swc_css_codegen/src/lib.rs index b1ecf862c0a0..9ea66f945e89 100644 --- a/crates/swc_css_codegen/src/lib.rs +++ b/crates/swc_css_codegen/src/lib.rs @@ -2027,14 +2027,7 @@ where write_str!(self, span, &url); } Token::BadUrl { raw, .. } => { - let mut bad_url = String::with_capacity(raw.0.len() + raw.1.len() + 2); - - bad_url.push_str(&raw.0); - bad_url.push('('); - bad_url.push_str(&raw.1); - bad_url.push(')'); - - write_str!(self, span, &bad_url); + write_str!(self, span, &raw); } Token::Comma => { write_raw!(self, span, ","); diff --git a/crates/swc_css_codegen/tests/fixture/values/url/1/input.css b/crates/swc_css_codegen/tests/fixture/values/url/1/input.css index a01c4913e9e0..d89c6d8dfefb 100644 --- a/crates/swc_css_codegen/tests/fixture/values/url/1/input.css +++ b/crates/swc_css_codegen/tests/fixture/values/url/1/input.css @@ -63,3 +63,7 @@ div { .foo { background: url(__ident__); } + +.foo { + background: url(foo bar); +} diff --git a/crates/swc_css_codegen/tests/fixture/values/url/1/output.css b/crates/swc_css_codegen/tests/fixture/values/url/1/output.css index c30d0aa65477..5c87d7219ba0 100644 --- a/crates/swc_css_codegen/tests/fixture/values/url/1/output.css +++ b/crates/swc_css_codegen/tests/fixture/values/url/1/output.css @@ -53,3 +53,6 @@ div { .foo { background: url(__ident__); } +.foo { + background: url(foo bar); +} diff --git a/crates/swc_css_codegen/tests/fixture/values/url/1/output.min.css b/crates/swc_css_codegen/tests/fixture/values/url/1/output.min.css index f83e944c74a9..bc74529286bb 100644 --- a/crates/swc_css_codegen/tests/fixture/values/url/1/output.min.css +++ b/crates/swc_css_codegen/tests/fixture/values/url/1/output.min.css @@ -1 +1 @@ -div{background:url(https://example.com/image.png);background:url(https://example.com/image.png);background:url(https://example.com/image.png);background:url("https://example.com/image.png");background:url("https://example.com/image.png");background:url("https://example.com/image.png");background:url("https://example.com/image.png");background:url(data:image/png;base64,iRxVB0);background:url(#IDofSVGpath);background:url("//aa.com/img.svg"prefetch);background:url("//aa.com/img.svg"foo bar baz func(test));background:url("http://example.com/image.svg"param(--color var(--primary-color)));background:url();background:url("");background:url("");--foo:"http://www.example.com/pinkish.gif";background:src("http://www.example.com/pinkish.gif");background:src("http://www.example.com/pinkish.gif");background:src(var(--foo));background:url(https://example.com/image.png);background:url(https://example.com/image.png);background:url(https://example.com/image.png);background:url(https://example.com/image.png);background:url(image.png힙)}div{background:url(foo.img)red}*{background:url("foo");background:url("f o");background:url("f o");background:url("foo)");background:url("(foo");background:url("(foo)");background:url('"foo"')}.bar{background:url(http://example.com/image.svg param(--color var(--primary-color)))}.baz{background:url("http://example.com/image.svg"param(--color var(--primary-color)))}.foo{background:url(__ident__)} +div{background:url(https://example.com/image.png);background:url(https://example.com/image.png);background:url(https://example.com/image.png);background:url("https://example.com/image.png");background:url("https://example.com/image.png");background:url("https://example.com/image.png");background:url("https://example.com/image.png");background:url(data:image/png;base64,iRxVB0);background:url(#IDofSVGpath);background:url("//aa.com/img.svg"prefetch);background:url("//aa.com/img.svg"foo bar baz func(test));background:url("http://example.com/image.svg"param(--color var(--primary-color)));background:url();background:url("");background:url("");--foo:"http://www.example.com/pinkish.gif";background:src("http://www.example.com/pinkish.gif");background:src("http://www.example.com/pinkish.gif");background:src(var(--foo));background:url(https://example.com/image.png);background:url(https://example.com/image.png);background:url(https://example.com/image.png);background:url(https://example.com/image.png);background:url(image.png힙)}div{background:url(foo.img)red}*{background:url("foo");background:url("f o");background:url("f o");background:url("foo)");background:url("(foo");background:url("(foo)");background:url('"foo"')}.bar{background:url(http://example.com/image.svg param(--color var(--primary-color)))}.baz{background:url("http://example.com/image.svg"param(--color var(--primary-color)))}.foo{background:url(__ident__)}.foo{background:url(foo bar)} diff --git a/crates/swc_css_minifier/src/compressor/mod.rs b/crates/swc_css_minifier/src/compressor/mod.rs index a5cb67033d0d..380c11d99beb 100644 --- a/crates/swc_css_minifier/src/compressor/mod.rs +++ b/crates/swc_css_minifier/src/compressor/mod.rs @@ -408,7 +408,7 @@ impl VisitMut for Compressor { Token::BadString { raw: value, .. } if !contains_only_ascii_characters(value) => { self.need_utf8_at_rule = true; } - Token::BadUrl { raw: value, .. } if !contains_only_ascii_characters(&value.1) => { + Token::BadUrl { raw: value, .. } if !contains_only_ascii_characters(value) => { self.need_utf8_at_rule = true; } Token::Dimension(box DimensionToken { unit: value, .. }) diff --git a/crates/swc_css_parser/src/lexer/mod.rs b/crates/swc_css_parser/src/lexer/mod.rs index dadcd9584dc2..e4b39cdf7df8 100644 --- a/crates/swc_css_parser/src/lexer/mod.rs +++ b/crates/swc_css_parser/src/lexer/mod.rs @@ -26,7 +26,6 @@ where buf: Rc>, raw_buf: Rc>, sub_buf: Rc>, - sub_raw_buf: Rc>, errors: Rc>>, } @@ -47,7 +46,6 @@ where buf: Rc::new(RefCell::new(String::with_capacity(256))), raw_buf: Rc::new(RefCell::new(String::with_capacity(256))), sub_buf: Rc::new(RefCell::new(String::with_capacity(32))), - sub_raw_buf: Rc::new(RefCell::new(String::with_capacity(32))), errors: Default::default(), } } @@ -90,21 +88,6 @@ where op(self, &mut buf, &mut raw) } - - fn with_sub_buf_and_raw_buf(&mut self, op: F) -> LexResult - where - F: for<'any> FnOnce(&mut Lexer, &mut String, &mut String) -> LexResult, - { - let b = self.sub_buf.clone(); - let r = self.sub_raw_buf.clone(); - let mut sub_buf = b.borrow_mut(); - let mut sub_raw_buf = r.borrow_mut(); - - sub_buf.clear(); - sub_raw_buf.clear(); - - op(self, &mut sub_buf, &mut sub_raw_buf) - } } impl Iterator for Lexer { @@ -855,16 +838,14 @@ where // otherwise, consume the remnants of a bad url, create a , // and return it. - out.push_str(&whitespaces); raw.push_str(&whitespaces); let remnants = l.read_bad_url_remnants()?; - out.push_str(&remnants.0); - raw.push_str(&remnants.1); + raw.push_str(&remnants); return Ok(Token::BadUrl { - raw: Box::new((name.1, (&**raw).into())), + raw: Atom::new(format!("{}{}{}", name.1, "(", raw)), }); } @@ -879,13 +860,11 @@ where let remnants = l.read_bad_url_remnants()?; - out.push(c); - out.push_str(&remnants.0); raw.push(c); - raw.push_str(&remnants.1); + raw.push_str(&remnants); return Ok(Token::BadUrl { - raw: Box::new((name.1, (&**raw).into())), + raw: Atom::new(format!("{}{}{}", name.1, "(", raw)), }); } @@ -908,13 +887,11 @@ where let remnants = l.read_bad_url_remnants()?; - out.push(c); - out.push_str(&remnants.0); raw.push(c); - raw.push_str(&remnants.1); + raw.push_str(&remnants); return Ok(Token::BadUrl { - raw: Box::new((name.1, (&**raw).into())), + raw: Atom::new(format!("{}{}{}", name.1, "(", raw)), }); } } @@ -1310,8 +1287,8 @@ where // its sole use is to consume enough of the input stream to reach a recovery // point where normal tokenizing can resume. But for recovery purpose we return // bad URL remnants. - fn read_bad_url_remnants(&mut self) -> LexResult<(String, String)> { - self.with_sub_buf_and_raw_buf(|l, buf, raw| { + fn read_bad_url_remnants(&mut self) -> LexResult { + self.with_sub_buf(|l, raw| { // Repeatedly consume the next input code point from the stream: loop { l.consume(); @@ -1320,7 +1297,9 @@ where // U+0029 RIGHT PARENTHESIS ()) // EOF // Return. - Some(')') => { + Some(c @ ')') => { + raw.push(c); + break; } None => { @@ -1332,20 +1311,18 @@ where // ("\)") to be encountered without ending the . let escaped = l.read_escape()?; - buf.push(escaped.0); raw.push(c); raw.push_str(&escaped.1); } // anything else // Do nothing. Some(c) => { - buf.push(c); raw.push(c); } } } - Ok(((&**buf).into(), (&**raw).into())) + Ok((&**raw).into()) }) } } diff --git a/crates/swc_css_parser/tests/recovery/bad-url-token/double-quotes/output.json b/crates/swc_css_parser/tests/recovery/bad-url-token/double-quotes/output.json index 9f039e1f7385..885559d880d0 100644 --- a/crates/swc_css_parser/tests/recovery/bad-url-token/double-quotes/output.json +++ b/crates/swc_css_parser/tests/recovery/bad-url-token/double-quotes/output.json @@ -114,10 +114,7 @@ }, "token": { "BadUrl": { - "raw": [ - "url", - "image\".png" - ] + "raw": "url(image\".png)" } } } diff --git a/crates/swc_css_parser/tests/recovery/bad-url-token/double-quotes/span.swc-stderr b/crates/swc_css_parser/tests/recovery/bad-url-token/double-quotes/span.swc-stderr index 2bce68a0dca2..9c86c2e8210b 100644 --- a/crates/swc_css_parser/tests/recovery/bad-url-token/double-quotes/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/bad-url-token/double-quotes/span.swc-stderr @@ -135,7 +135,7 @@ 3 | color: red; `---- - x BadUrl { raw: ("url", "image\".png") } + x BadUrl { raw: "url(image\".png)" } ,-[$DIR/tests/recovery/bad-url-token/double-quotes/input.css:1:1] 1 | div { 2 | background: url(image".png); diff --git a/crates/swc_css_parser/tests/recovery/bad-url-token/escaped/output.json b/crates/swc_css_parser/tests/recovery/bad-url-token/escaped/output.json index 28d4b083c84e..2e8d24fc3165 100644 --- a/crates/swc_css_parser/tests/recovery/bad-url-token/escaped/output.json +++ b/crates/swc_css_parser/tests/recovery/bad-url-token/escaped/output.json @@ -114,10 +114,7 @@ }, "token": { "BadUrl": { - "raw": [ - "\\url", - "te st" - ] + "raw": "\\url(te st)" } } } diff --git a/crates/swc_css_parser/tests/recovery/bad-url-token/escaped/span.swc-stderr b/crates/swc_css_parser/tests/recovery/bad-url-token/escaped/span.swc-stderr index b1575b0dc1c3..8b066554e811 100644 --- a/crates/swc_css_parser/tests/recovery/bad-url-token/escaped/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/bad-url-token/escaped/span.swc-stderr @@ -131,7 +131,7 @@ 3 | } `---- - x BadUrl { raw: ("\\url", "te st") } + x BadUrl { raw: "\\url(te st)" } ,-[$DIR/tests/recovery/bad-url-token/escaped/input.css:1:1] 1 | a { 2 | background: \url(te st); diff --git a/crates/swc_css_parser/tests/recovery/bad-url-token/invalid-escape/output.json b/crates/swc_css_parser/tests/recovery/bad-url-token/invalid-escape/output.json index 84ff8c412bc3..ddea93b7de3e 100644 --- a/crates/swc_css_parser/tests/recovery/bad-url-token/invalid-escape/output.json +++ b/crates/swc_css_parser/tests/recovery/bad-url-token/invalid-escape/output.json @@ -114,10 +114,7 @@ }, "token": { "BadUrl": { - "raw": [ - "url", - "image.png\\\n " - ] + "raw": "url(image.png\\\n )" } } } diff --git a/crates/swc_css_parser/tests/recovery/bad-url-token/invalid-escape/span.swc-stderr b/crates/swc_css_parser/tests/recovery/bad-url-token/invalid-escape/span.swc-stderr index b9c173a85d47..871b0ca9b5c8 100644 --- a/crates/swc_css_parser/tests/recovery/bad-url-token/invalid-escape/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/bad-url-token/invalid-escape/span.swc-stderr @@ -135,7 +135,7 @@ 4 | } `---- - x BadUrl { raw: ("url", "image.png\\\n ") } + x BadUrl { raw: "url(image.png\\\n )" } ,-[$DIR/tests/recovery/bad-url-token/invalid-escape/input.css:1:1] 1 | div { 2 | ,-> background: url(image.png\ diff --git a/crates/swc_css_parser/tests/recovery/bad-url-token/left-parenthesis/output.json b/crates/swc_css_parser/tests/recovery/bad-url-token/left-parenthesis/output.json index 98f7ececc3eb..44ba1348cd52 100644 --- a/crates/swc_css_parser/tests/recovery/bad-url-token/left-parenthesis/output.json +++ b/crates/swc_css_parser/tests/recovery/bad-url-token/left-parenthesis/output.json @@ -114,10 +114,7 @@ }, "token": { "BadUrl": { - "raw": [ - "url", - "image(.png" - ] + "raw": "url(image(.png)" } } } diff --git a/crates/swc_css_parser/tests/recovery/bad-url-token/left-parenthesis/span.swc-stderr b/crates/swc_css_parser/tests/recovery/bad-url-token/left-parenthesis/span.swc-stderr index a122cc30c14c..ee877a4586cc 100644 --- a/crates/swc_css_parser/tests/recovery/bad-url-token/left-parenthesis/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/bad-url-token/left-parenthesis/span.swc-stderr @@ -135,7 +135,7 @@ 3 | color: red; `---- - x BadUrl { raw: ("url", "image(.png") } + x BadUrl { raw: "url(image(.png)" } ,-[$DIR/tests/recovery/bad-url-token/left-parenthesis/input.css:1:1] 1 | div { 2 | background: url(image(.png); diff --git a/crates/swc_css_parser/tests/recovery/bad-url-token/single-quotes/output.json b/crates/swc_css_parser/tests/recovery/bad-url-token/single-quotes/output.json index b61fd8957dd3..820bf4a4290b 100644 --- a/crates/swc_css_parser/tests/recovery/bad-url-token/single-quotes/output.json +++ b/crates/swc_css_parser/tests/recovery/bad-url-token/single-quotes/output.json @@ -114,10 +114,7 @@ }, "token": { "BadUrl": { - "raw": [ - "url", - "image'.png" - ] + "raw": "url(image'.png)" } } } diff --git a/crates/swc_css_parser/tests/recovery/bad-url-token/single-quotes/span.swc-stderr b/crates/swc_css_parser/tests/recovery/bad-url-token/single-quotes/span.swc-stderr index 9de9bb2d0a9c..b364d479238c 100644 --- a/crates/swc_css_parser/tests/recovery/bad-url-token/single-quotes/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/bad-url-token/single-quotes/span.swc-stderr @@ -135,7 +135,7 @@ 3 | color: red; `---- - x BadUrl { raw: ("url", "image'.png") } + x BadUrl { raw: "url(image'.png)" } ,-[$DIR/tests/recovery/bad-url-token/single-quotes/input.css:1:1] 1 | div { 2 | background: url(image'.png); diff --git a/crates/swc_css_parser/tests/recovery/bad-url-token/unclosed/input.css b/crates/swc_css_parser/tests/recovery/bad-url-token/unclosed/input.css new file mode 100644 index 000000000000..bf1e56dbb11d --- /dev/null +++ b/crates/swc_css_parser/tests/recovery/bad-url-token/unclosed/input.css @@ -0,0 +1,3 @@ +.foo { + background: url(foo bar; +} \ No newline at end of file diff --git a/crates/swc_css_parser/tests/recovery/bad-url-token/unclosed/output.json b/crates/swc_css_parser/tests/recovery/bad-url-token/unclosed/output.json new file mode 100644 index 000000000000..6e4c44dfa8d5 --- /dev/null +++ b/crates/swc_css_parser/tests/recovery/bad-url-token/unclosed/output.json @@ -0,0 +1,121 @@ +{ + "type": "Stylesheet", + "span": { + "start": 1, + "end": 38, + "ctxt": 0 + }, + "rules": [ + { + "type": "QualifiedRule", + "span": { + "start": 1, + "end": 38, + "ctxt": 0 + }, + "prelude": { + "type": "SelectorList", + "span": { + "start": 1, + "end": 5, + "ctxt": 0 + }, + "children": [ + { + "type": "ComplexSelector", + "span": { + "start": 1, + "end": 5, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", + "span": { + "start": 1, + "end": 5, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": null, + "subclassSelectors": [ + { + "type": "ClassSelector", + "span": { + "start": 1, + "end": 5, + "ctxt": 0 + }, + "text": { + "type": "Ident", + "span": { + "start": 2, + "end": 5, + "ctxt": 0 + }, + "value": "foo", + "raw": "foo" + } + } + ] + } + ] + } + ] + }, + "block": { + "type": "SimpleBlock", + "span": { + "start": 6, + "end": 38, + "ctxt": 0 + }, + "name": { + "type": "PreservedToken", + "span": { + "start": 6, + "end": 7, + "ctxt": 0 + }, + "token": "LBrace" + }, + "value": [ + { + "type": "Declaration", + "span": { + "start": 12, + "end": 38, + "ctxt": 0 + }, + "name": { + "type": "Ident", + "span": { + "start": 12, + "end": 22, + "ctxt": 0 + }, + "value": "background", + "raw": "background" + }, + "value": [ + { + "type": "PreservedToken", + "span": { + "start": 24, + "end": 38, + "ctxt": 0 + }, + "token": { + "BadUrl": { + "raw": "url(foo bar;\n}" + } + } + } + ], + "important": null + } + ] + } + } + ] +} diff --git a/crates/swc_css_parser/tests/recovery/bad-url-token/unclosed/output.swc-stderr b/crates/swc_css_parser/tests/recovery/bad-url-token/unclosed/output.swc-stderr new file mode 100644 index 000000000000..f582ea8ccc4e --- /dev/null +++ b/crates/swc_css_parser/tests/recovery/bad-url-token/unclosed/output.swc-stderr @@ -0,0 +1,14 @@ + + x Unexpected bad url in declaration value + ,-[$DIR/tests/recovery/bad-url-token/unclosed/input.css:1:1] + 1 | .foo { + 2 | ,-> background: url(foo bar; + 3 | `-> } + `---- + + x Unexpected end of file, but expected '}' + ,-[$DIR/tests/recovery/bad-url-token/unclosed/input.css:1:1] + 1 | ,-> .foo { + 2 | | background: url(foo bar; + 3 | `-> } + `---- diff --git a/crates/swc_css_parser/tests/recovery/bad-url-token/unclosed/span.swc-stderr b/crates/swc_css_parser/tests/recovery/bad-url-token/unclosed/span.swc-stderr new file mode 100644 index 000000000000..00fc387bff73 --- /dev/null +++ b/crates/swc_css_parser/tests/recovery/bad-url-token/unclosed/span.swc-stderr @@ -0,0 +1,128 @@ + + x Stylesheet + ,-[$DIR/tests/recovery/bad-url-token/unclosed/input.css:1:1] + 1 | ,-> .foo { + 2 | | background: url(foo bar; + 3 | `-> } + `---- + + x Rule + ,-[$DIR/tests/recovery/bad-url-token/unclosed/input.css:1:1] + 1 | ,-> .foo { + 2 | | background: url(foo bar; + 3 | `-> } + `---- + + x QualifiedRule + ,-[$DIR/tests/recovery/bad-url-token/unclosed/input.css:1:1] + 1 | ,-> .foo { + 2 | | background: url(foo bar; + 3 | `-> } + `---- + + x SelectorList + ,-[$DIR/tests/recovery/bad-url-token/unclosed/input.css:1:1] + 1 | .foo { + : ^^^^ + 2 | background: url(foo bar; + `---- + + x ComplexSelector + ,-[$DIR/tests/recovery/bad-url-token/unclosed/input.css:1:1] + 1 | .foo { + : ^^^^ + 2 | background: url(foo bar; + `---- + + x CompoundSelector + ,-[$DIR/tests/recovery/bad-url-token/unclosed/input.css:1:1] + 1 | .foo { + : ^^^^ + 2 | background: url(foo bar; + `---- + + x SubclassSelector + ,-[$DIR/tests/recovery/bad-url-token/unclosed/input.css:1:1] + 1 | .foo { + : ^^^^ + 2 | background: url(foo bar; + `---- + + x ClassSelector + ,-[$DIR/tests/recovery/bad-url-token/unclosed/input.css:1:1] + 1 | .foo { + : ^^^^ + 2 | background: url(foo bar; + `---- + + x Ident + ,-[$DIR/tests/recovery/bad-url-token/unclosed/input.css:1:1] + 1 | .foo { + : ^^^ + 2 | background: url(foo bar; + `---- + + x SimpleBlock + ,-[$DIR/tests/recovery/bad-url-token/unclosed/input.css:1:1] + 1 | ,-> .foo { + 2 | | background: url(foo bar; + 3 | `-> } + `---- + + x LBrace + ,-[$DIR/tests/recovery/bad-url-token/unclosed/input.css:1:1] + 1 | .foo { + : ^ + 2 | background: url(foo bar; + `---- + + x ComponentValue + ,-[$DIR/tests/recovery/bad-url-token/unclosed/input.css:1:1] + 1 | .foo { + 2 | ,-> background: url(foo bar; + 3 | `-> } + `---- + + x StyleBlock + ,-[$DIR/tests/recovery/bad-url-token/unclosed/input.css:1:1] + 1 | .foo { + 2 | ,-> background: url(foo bar; + 3 | `-> } + `---- + + x Declaration + ,-[$DIR/tests/recovery/bad-url-token/unclosed/input.css:1:1] + 1 | .foo { + 2 | ,-> background: url(foo bar; + 3 | `-> } + `---- + + x DeclarationName + ,-[$DIR/tests/recovery/bad-url-token/unclosed/input.css:1:1] + 1 | .foo { + 2 | background: url(foo bar; + : ^^^^^^^^^^ + 3 | } + `---- + + x Ident + ,-[$DIR/tests/recovery/bad-url-token/unclosed/input.css:1:1] + 1 | .foo { + 2 | background: url(foo bar; + : ^^^^^^^^^^ + 3 | } + `---- + + x ComponentValue + ,-[$DIR/tests/recovery/bad-url-token/unclosed/input.css:1:1] + 1 | .foo { + 2 | ,-> background: url(foo bar; + 3 | `-> } + `---- + + x BadUrl { raw: "url(foo bar;\n}" } + ,-[$DIR/tests/recovery/bad-url-token/unclosed/input.css:1:1] + 1 | .foo { + 2 | ,-> background: url(foo bar; + 3 | `-> } + `---- diff --git a/crates/swc_css_parser/tests/recovery/bad-url-token/whitespace-in-middle/output.json b/crates/swc_css_parser/tests/recovery/bad-url-token/whitespace-in-middle/output.json index 2ef725b75a2b..5a1e5f9354e4 100644 --- a/crates/swc_css_parser/tests/recovery/bad-url-token/whitespace-in-middle/output.json +++ b/crates/swc_css_parser/tests/recovery/bad-url-token/whitespace-in-middle/output.json @@ -114,10 +114,7 @@ }, "token": { "BadUrl": { - "raw": [ - "url", - " ./image.jpg a " - ] + "raw": "url( ./image.jpg a )" } } } diff --git a/crates/swc_css_parser/tests/recovery/bad-url-token/whitespace-in-middle/span.swc-stderr b/crates/swc_css_parser/tests/recovery/bad-url-token/whitespace-in-middle/span.swc-stderr index b8028d995c80..0822c2ef1b05 100644 --- a/crates/swc_css_parser/tests/recovery/bad-url-token/whitespace-in-middle/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/bad-url-token/whitespace-in-middle/span.swc-stderr @@ -131,7 +131,7 @@ 3 | } `---- - x BadUrl { raw: ("url", " ./image.jpg a ") } + x BadUrl { raw: "url( ./image.jpg a )" } ,-[$DIR/tests/recovery/bad-url-token/whitespace-in-middle/input.css:1:1] 1 | a { 2 | background-image: url( ./image.jpg a ); diff --git a/crates/swc_css_parser/tests/recovery/bad-url-token/whitespace/output.json b/crates/swc_css_parser/tests/recovery/bad-url-token/whitespace/output.json index 7c8f4fc0b07b..a9f30fb5252f 100644 --- a/crates/swc_css_parser/tests/recovery/bad-url-token/whitespace/output.json +++ b/crates/swc_css_parser/tests/recovery/bad-url-token/whitespace/output.json @@ -114,10 +114,7 @@ }, "token": { "BadUrl": { - "raw": [ - "url", - "image.\n png" - ] + "raw": "url(image.\n png)" } } } diff --git a/crates/swc_css_parser/tests/recovery/bad-url-token/whitespace/span.swc-stderr b/crates/swc_css_parser/tests/recovery/bad-url-token/whitespace/span.swc-stderr index e2f00c674c48..52f5c9e56c4b 100644 --- a/crates/swc_css_parser/tests/recovery/bad-url-token/whitespace/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/bad-url-token/whitespace/span.swc-stderr @@ -139,7 +139,7 @@ 4 | color: red; `---- - x BadUrl { raw: ("url", "image.\n png") } + x BadUrl { raw: "url(image.\n png)" } ,-[$DIR/tests/recovery/bad-url-token/whitespace/input.css:1:1] 1 | div { 2 | ,-> background: url(image. diff --git a/crates/swc_css_parser/tests/recovery/declaration/bad-value/output.json b/crates/swc_css_parser/tests/recovery/declaration/bad-value/output.json index 29d7873d2ab2..9f9709d2052b 100644 --- a/crates/swc_css_parser/tests/recovery/declaration/bad-value/output.json +++ b/crates/swc_css_parser/tests/recovery/declaration/bad-value/output.json @@ -174,10 +174,7 @@ }, "token": { "BadUrl": { - "raw": [ - "url", - "test test" - ] + "raw": "url(test test)" } } } diff --git a/crates/swc_css_parser/tests/recovery/declaration/bad-value/span.swc-stderr b/crates/swc_css_parser/tests/recovery/declaration/bad-value/span.swc-stderr index 15e5f454ac22..a5660defa59a 100644 --- a/crates/swc_css_parser/tests/recovery/declaration/bad-value/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/declaration/bad-value/span.swc-stderr @@ -287,7 +287,7 @@ 5 | --foo: !; `---- - x BadUrl { raw: ("url", "test test") } + x BadUrl { raw: "url(test test)" } ,-[$DIR/tests/recovery/declaration/bad-value/input.css:3:1] 3 | value: ]; 4 | value: url(test test); diff --git a/crates/swc_css_parser/tests/recovery/function/bad-comment-2/output.json b/crates/swc_css_parser/tests/recovery/function/bad-comment-2/output.json index 37a5d152c1b3..1cef4b7d27a7 100644 --- a/crates/swc_css_parser/tests/recovery/function/bad-comment-2/output.json +++ b/crates/swc_css_parser/tests/recovery/function/bad-comment-2/output.json @@ -114,10 +114,7 @@ }, "token": { "BadUrl": { - "raw": [ - "url", - "\n /* test */\n \"test.png\"\n " - ] + "raw": "url(\n /* test */\n \"test.png\"\n )" } } } diff --git a/crates/swc_css_parser/tests/recovery/function/bad-comment-2/span.swc-stderr b/crates/swc_css_parser/tests/recovery/function/bad-comment-2/span.swc-stderr index 3f6c7277c931..7afabb946705 100644 --- a/crates/swc_css_parser/tests/recovery/function/bad-comment-2/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/function/bad-comment-2/span.swc-stderr @@ -151,7 +151,7 @@ 6 | } `---- - x BadUrl { raw: ("url", "\n /* test */\n \"test.png\"\n ") } + x BadUrl { raw: "url(\n /* test */\n \"test.png\"\n )" } ,-[$DIR/tests/recovery/function/bad-comment-2/input.css:1:1] 1 | a { 2 | ,-> background: url( diff --git a/crates/swc_css_parser/tests/recovery/function/bad-comment/output.json b/crates/swc_css_parser/tests/recovery/function/bad-comment/output.json index bffc9da4d234..c68a72f53d43 100644 --- a/crates/swc_css_parser/tests/recovery/function/bad-comment/output.json +++ b/crates/swc_css_parser/tests/recovery/function/bad-comment/output.json @@ -114,10 +114,7 @@ }, "token": { "BadUrl": { - "raw": [ - "url", - "\n /* test */\n test.png\n " - ] + "raw": "url(\n /* test */\n test.png\n )" } } } diff --git a/crates/swc_css_parser/tests/recovery/function/bad-comment/span.swc-stderr b/crates/swc_css_parser/tests/recovery/function/bad-comment/span.swc-stderr index 1fe352ff235d..4f853d7ad4b6 100644 --- a/crates/swc_css_parser/tests/recovery/function/bad-comment/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/function/bad-comment/span.swc-stderr @@ -151,7 +151,7 @@ 6 | } `---- - x BadUrl { raw: ("url", "\n /* test */\n test.png\n ") } + x BadUrl { raw: "url(\n /* test */\n test.png\n )" } ,-[$DIR/tests/recovery/function/bad-comment/input.css:1:1] 1 | a { 2 | ,-> background: url( diff --git a/crates/swc_css_parser/tests/recovery/value/url/basic/output.json b/crates/swc_css_parser/tests/recovery/value/url/basic/output.json index ec468c20ec20..479730e0ece7 100644 --- a/crates/swc_css_parser/tests/recovery/value/url/basic/output.json +++ b/crates/swc_css_parser/tests/recovery/value/url/basic/output.json @@ -149,10 +149,7 @@ }, "token": { "BadUrl": { - "raw": [ - "url", - "var(--foo" - ] + "raw": "url(var(--foo)" } } }, @@ -553,10 +550,7 @@ }, "token": { "BadUrl": { - "raw": [ - "url", - "image.png param(var(--url" - ] + "raw": "url(image.png param(var(--url)" } } }, diff --git a/crates/swc_css_parser/tests/recovery/value/url/basic/span.swc-stderr b/crates/swc_css_parser/tests/recovery/value/url/basic/span.swc-stderr index 652dc6aab765..7ed7693180c9 100644 --- a/crates/swc_css_parser/tests/recovery/value/url/basic/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/value/url/basic/span.swc-stderr @@ -223,7 +223,7 @@ 4 | background: url(image.png\999999); `---- - x BadUrl { raw: ("url", "var(--foo") } + x BadUrl { raw: "url(var(--foo)" } ,-[$DIR/tests/recovery/value/url/basic/input.css:2:1] 2 | --foo: "http://www.example.com/pinkish.gif"; 3 | background: url(var(--foo)); @@ -831,7 +831,7 @@ 14 | } `---- - x BadUrl { raw: ("url", "image.png param(var(--url") } + x BadUrl { raw: "url(image.png param(var(--url)" } ,-[$DIR/tests/recovery/value/url/basic/input.css:12:1] 12 | .foo { 13 | background: url(image.png param(var(--url))); diff --git a/crates/swc_css_parser/tests/recovery/value/url/parenthesis/output.json b/crates/swc_css_parser/tests/recovery/value/url/parenthesis/output.json index 811ca5724a67..90a70cf4fcc1 100644 --- a/crates/swc_css_parser/tests/recovery/value/url/parenthesis/output.json +++ b/crates/swc_css_parser/tests/recovery/value/url/parenthesis/output.json @@ -114,10 +114,7 @@ }, "token": { "BadUrl": { - "raw": [ - "url", - "test\\);\n}" - ] + "raw": "url(test\\);\n}" } } } diff --git a/crates/swc_css_parser/tests/recovery/value/url/parenthesis/span.swc-stderr b/crates/swc_css_parser/tests/recovery/value/url/parenthesis/span.swc-stderr index e871257cf39f..02c1bd5b83c1 100644 --- a/crates/swc_css_parser/tests/recovery/value/url/parenthesis/span.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/value/url/parenthesis/span.swc-stderr @@ -127,7 +127,7 @@ 3 | `-> } `---- - x BadUrl { raw: ("url", "test\\);\n}") } + x BadUrl { raw: "url(test\\);\n}" } ,-[$DIR/tests/recovery/value/url/parenthesis/input.css:1:1] 1 | a { 2 | ,-> background: url(test\); From b2ba3400522abdb905d0728f2b64647c44c14fd2 Mon Sep 17 00:00:00 2001 From: "alexander.akait" Date: Mon, 5 Dec 2022 06:35:17 +0300 Subject: [PATCH 41/42] fix: clippy --- crates/swc_css_codegen/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/swc_css_codegen/src/lib.rs b/crates/swc_css_codegen/src/lib.rs index 9ea66f945e89..1cdbbc16396a 100644 --- a/crates/swc_css_codegen/src/lib.rs +++ b/crates/swc_css_codegen/src/lib.rs @@ -2027,7 +2027,7 @@ where write_str!(self, span, &url); } Token::BadUrl { raw, .. } => { - write_str!(self, span, &raw); + write_str!(self, span, raw); } Token::Comma => { write_raw!(self, span, ","); From d3bf83353c10f3dcadd0953736f9ece43b485f2f Mon Sep 17 00:00:00 2001 From: "alexander.akait" Date: Tue, 6 Dec 2022 03:55:43 +0300 Subject: [PATCH 42/42] refactor: code --- .../rules/font_family_no_duplicate_names.rs | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/crates/swc_css_lints/src/rules/font_family_no_duplicate_names.rs b/crates/swc_css_lints/src/rules/font_family_no_duplicate_names.rs index 4f9baebc6ec3..a7ebf0838756 100644 --- a/crates/swc_css_lints/src/rules/font_family_no_duplicate_names.rs +++ b/crates/swc_css_lints/src/rules/font_family_no_duplicate_names.rs @@ -56,19 +56,18 @@ impl FontFamilyNoDuplicateNames { (fonts, Some((value.to_string(), *span))) } } - ComponentValue::Str(value) if value.raw.is_some() => { - fonts.push((FontNameKind::from(value.raw.as_ref().unwrap()), value.span)); + ComponentValue::Str(box Str { + raw: Some(raw), + span, + .. + }) => { + fonts.push((FontNameKind::from(raw), *span)); (fonts, None) } - ComponentValue::Delimiter(delimiter) - if matches!( - **delimiter, - Delimiter { - value: DelimiterValue::Comma, - .. - } - ) => - { + ComponentValue::Delimiter(box Delimiter { + value: DelimiterValue::Comma, + .. + }) => { if let Some((identifier, span)) = last_identifier { fonts.push((FontNameKind::from(identifier), span)); }