fix(css/parser): Fix various issues (#6281)

This commit is contained in:
Alexander Akait 2022-10-28 07:34:23 +03:00 committed by GitHub
parent ecba41691d
commit 2813acccc2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
157 changed files with 8675 additions and 6600 deletions

View File

@ -1473,7 +1473,11 @@ where
}
if is_custom_property {
self.emit_list(&n.value, ListFormat::NotDelimited)?;
self.with_ctx(Ctx {
in_list_of_component_values: true,
..self.ctx
})
.emit_list(&n.value, ListFormat::NotDelimited)?;
} else {
self.emit_list_of_component_values_inner(
&n.value,

View File

@ -1,4 +1,4 @@
@supports (--x: y , z ) {
@supports (--x: y , z) {
a {
color: red;
}

View File

@ -1 +1 @@
@supports(--x:y , z ){a{color:red}}@supports(--x: ){a{color:red}}@supports(--x: ){a{color:red}}@supports ( --x y , z ) {a{color:red}}@supports ( --x ) {a{color:red}}@supports ( ) {a{color:red}}@supports ( . --x : y , z ) {a{color:red}}
@supports(--x:y , z){a{color:red}}@supports(--x: ){a{color:red}}@supports(--x: ){a{color:red}}@supports ( --x y , z ) {a{color:red}}@supports ( --x ) {a{color:red}}@supports ( ) {a{color:red}}@supports ( . --x : y , z ) {a{color:red}}

View File

@ -1,11 +1,11 @@
div {
--y: ;
--x: var(--y) ;
--x: var(--y);
--z: 0px;
--foo: if(x > 5) this.width = 10;
--bar: ;
--bar2: ;
--yz: foo !important;
--yz: foo!important;
}
div {
width: var(--a,);
@ -59,10 +59,10 @@ div {
--x: y;
}
* {
--x: y ;
--x: y;
}
* {
--x: y, ;
--x: y,;
}
* {
--x: var(y,);
@ -74,7 +74,7 @@ div {
--x: (y);
}
* {
--x: (y) ;
--x: (y);
}
* {
--x: (y);
@ -89,7 +89,7 @@ div {
--x: f(y);
}
* {
--x: f(y) ;
--x: f(y);
}
* {
--x: f(y);
@ -104,7 +104,7 @@ div {
--x: [y];
}
* {
--x: [y] ;
--x: [y];
}
* {
--x: [y];
@ -119,7 +119,7 @@ div {
--x: {y};
}
* {
--x: {y} ;
--x: {y};
}
* {
--x: {y};
@ -130,7 +130,7 @@ div {
* {
--x: { y};
}
@supports (--x: y , z ) {
@supports (--x: y , z) {
a {
color: red;
}

View File

@ -1,2 +1,2 @@
div{--y: ;--x:var(--y) ;--z:0px;--foo:if(x > 5) this.width = 10;--bar: ;--bar2: ;--yz:foo !important}div{width:var(--a,)}.motion-safe\:shadow-md{--tw-shadow:0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);--tw-shadow-1:0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),
0 2px 4px -2px var(--tw-shadow-color)}*{--x: }*{--x: }*{--x: }*{--x: }*{--x: !important}*{--x: !important}*{--x: !important}*{--x: !important}*{--x: !important}*{--x: !important}*{--x: !important}*{--x: !important}*{--x:y}*{--x:y}*{--x:y }*{--x:y, }*{--x:var(y,)}*{--x:var(y, )}*{--x:(y)}*{--x:(y) }*{--x:(y)}*{--x:(y )}*{--x:( y)}*{--x:f(y)}*{--x:f(y) }*{--x:f(y)}*{--x:f(y )}*{--x:f( y)}*{--x:[y]}*{--x:[y] }*{--x:[y]}*{--x:[y ]}*{--x:[ y]}*{--x:{y}}*{--x:{y} }*{--x:{y}}*{--x:{y }}*{--x:{ y}}@supports(--x:y , z ){a{color:red}}@supports(--x: ){a{color:red}}@supports(--x: ){a{color:red}}@supports ( --x ) {a{color:red}}@supports ( ) {a{color:red}}@supports ( . --x : y , z ) {a{color:red}}*{counter-reset:--a --a -a;--dash:-}#test_1 span::before{counter-increment:var(--dash)-;content:counter(--)}#test_2 span::before{counter-increment:var(--dash)-a;content:counter(--a)}#test_3 span::before{counter-increment:var(--dash)a;content:counter(-a)}#control_1 span::before{counter-increment:--;content:counter(--)}#control_2 span::before{counter-increment:--a;content:counter(--a)}#control_3 span::before{counter-increment:-a;content:counter(-a)}*{counter-reset:--a"string"}
div{--y: ;--x:var(--y);--z:0px;--foo:if(x > 5) this.width = 10;--bar: ;--bar2: ;--yz:foo!important}div{width:var(--a,)}.motion-safe\:shadow-md{--tw-shadow:0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);--tw-shadow-1:0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),
0 2px 4px -2px var(--tw-shadow-color)}*{--x: }*{--x: }*{--x: }*{--x: }*{--x: !important}*{--x: !important}*{--x: !important}*{--x: !important}*{--x: !important}*{--x: !important}*{--x: !important}*{--x: !important}*{--x:y}*{--x:y}*{--x:y}*{--x:y,}*{--x:var(y,)}*{--x:var(y, )}*{--x:(y)}*{--x:(y)}*{--x:(y)}*{--x:(y )}*{--x:( y)}*{--x:f(y)}*{--x:f(y)}*{--x:f(y)}*{--x:f(y )}*{--x:f( y)}*{--x:[y]}*{--x:[y]}*{--x:[y]}*{--x:[y ]}*{--x:[ y]}*{--x:{y}}*{--x:{y}}*{--x:{y}}*{--x:{y }}*{--x:{ y}}@supports(--x:y , z){a{color:red}}@supports(--x: ){a{color:red}}@supports(--x: ){a{color:red}}@supports ( --x ) {a{color:red}}@supports ( ) {a{color:red}}@supports ( . --x : y , z ) {a{color:red}}*{counter-reset:--a --a -a;--dash:-}#test_1 span::before{counter-increment:var(--dash)-;content:counter(--)}#test_2 span::before{counter-increment:var(--dash)-a;content:counter(--a)}#test_3 span::before{counter-increment:var(--dash)a;content:counter(-a)}#control_1 span::before{counter-increment:--;content:counter(--)}#control_2 span::before{counter-increment:--a;content:counter(--a)}#control_3 span::before{counter-increment:-a;content:counter(-a)}*{counter-reset:--a"string"}

View File

@ -1,5 +1,5 @@
:root {
--foo: red !important;
--foo: red!important;
--foo: red!important;
}
div {
@ -24,7 +24,8 @@ a {
}
}
.foo {
color: red !ie;}
color: red !ie;
}
* {
--x: !important;
}

View File

@ -1 +1 @@
:root{--foo:red !important;--foo:red!important}div{color:red!important;color:red!important;color:red!important;color:red!important;color:red!important;color:red!important}a{b:c!important}.class{& div{color:red!important}}.class{& div{color:red!important}}.foo{color: red !ie;}*{--x: !important}*{--x: !important}*{--x: !important}*{--x: !important}*{--x: !important}
:root{--foo:red!important;--foo:red!important}div{color:red!important;color:red!important;color:red!important;color:red!important;color:red!important;color:red!important}a{b:c!important}.class{& div{color:red!important}}.class{& div{color:red!important}}.foo{color:red !ie}*{--x: !important}*{--x: !important}*{--x: !important}*{--x: !important}*{--x: !important}

View File

@ -17,10 +17,10 @@
--x: y;
}
* {
--x: y ;
--x: y;
}
* {
--x: y, ;
--x: y,;
}
* {
--x: var(y,);
@ -29,7 +29,7 @@
--x: (y);
}
* {
--x: (y) ;
--x: (y);
}
* {
--x: (y);
@ -44,7 +44,7 @@
--x: f(y);
}
* {
--x: f(y) ;
--x: f(y);
}
* {
--x: f(y);
@ -59,7 +59,7 @@
--x: [y];
}
* {
--x: [y] ;
--x: [y];
}
* {
--x: [y];
@ -74,7 +74,7 @@
--x: {y};
}
* {
--x: {y} ;
--x: {y};
}
* {
--x: {y};

View File

@ -1 +1 @@
*{--x: }*{--x: }*{--x: }*{--x: }*{--x:y}*{--x:y}*{--x:y }*{--x:y, }*{--x:var(y,)}*{--x:(y)}*{--x:(y) }*{--x:(y)}*{--x:(y )}*{--x:( y)}*{--x:f(y)}*{--x:f(y) }*{--x:f(y)}*{--x:f(y )}*{--x:f( y)}*{--x:[y]}*{--x:[y] }*{--x:[y]}*{--x:[y ]}*{--x:[ y]}*{--x:{y}}*{--x:{y} }*{--x:{y}}*{--x:{y }}*{--x:{ y}}
*{--x: }*{--x: }*{--x: }*{--x: }*{--x:y}*{--x:y}*{--x:y}*{--x:y,}*{--x:var(y,)}*{--x:(y)}*{--x:(y)}*{--x:(y)}*{--x:(y )}*{--x:( y)}*{--x:f(y)}*{--x:f(y)}*{--x:f(y)}*{--x:f(y )}*{--x:f( y)}*{--x:[y]}*{--x:[y]}*{--x:[y]}*{--x:[y ]}*{--x:[ y]}*{--x:{y}}*{--x:{y}}*{--x:{y}}*{--x:{y }}*{--x:{ y}}

View File

@ -23,7 +23,7 @@ $bad: rule;
a {
div.major { color: blue } color: red }
a {
div: hover { color: blue } color:red;
div: hover { color: blue } color: red;
}
a {
div: hover { color: blue };

View File

@ -1,4 +1,4 @@
{}{color:red}#broken# {color:red}$bad{color:red}$bad {color:red}$bad foo{color:red}$bad foo {color:red}$bad: rule;
a {div.major { color: blue } color: red }a{div:hover{ color: blue }color:red}a{div:hover{ color: blue };color:red}
a {div.major { color: blue } color: red }a{div:hover { color: blue } color: red}a{div:hover{ color: blue };color:red}

View File

@ -135,7 +135,8 @@ body:first-of-type .selector {}
|property: value;color: red;
}
.selector {
property: value !ie;}
property: value !ie;
}
@media screen\9 {}
@media \0screen\,screen\9 {}
@media \0screen {}

View File

@ -1 +1 @@
.selector:not(*:root){}@media screen and (min-width:0\0){}.selector:not(*:root){}@supports(-webkit-appearance:none){}.selector{(;property: value;);}.selector{[;property: value;];}@media \\0 screen {}@media all and (-webkit-min-device-pixel-ratio:0)and (min-resolution:.001dpcm){.selector{}}body:empty .selector{}body:last-child .selector,x:-moz-any-link{}@media \0 all{}body:last-child .selector,x:-moz-any-link,x:default{}body:not(:-moz-handler-blocked) .selector{}@media screen and (-moz-images-in-menus:0){}@media screen and (min--moz-device-pixel-ratio:0){}_::-moz-progress-bar,body:last-child .selector{}@media all and (min--moz-device-pixel-ratio:0)and (min-resolution:.001dpcm){}@media all and (-moz-images-in-menus:0)and (min-resolution:.001dpcm){}@media all and (min--moz-device-pixel-ratio:0){@media(min-width:0px){}}@media all and (-moz-images-in-menus:0){@media(min-width:0px){}}@supports(-moz-appearance:meterbar){}_::-moz-range-track,body:last-child .selector{}@supports(-moz-appearance:meterbar)and (display:flex){}@supports(-moz-appearance:meterbar)and (cursor:zoom-in){}@supports(-moz-appearance:meterbar)and (background-attachment:local){}@supports(-moz-appearance:meterbar)and (image-orientation:90deg){}@supports(-moz-appearance:meterbar)and (all:initial){}@supports(-moz-appearance:meterbar)and (list-style-type:japanese-formal){}@media all and (min--moz-device-pixel-ratio:0)and (min-resolution:30dpcm){}@supports(-moz-appearance:meterbar)and (background-blend-mode:difference,normal){}_:-moz-tree-row(hover),.selector{}_::selection,.selector:not([attr*=""]){}@supports(-webkit-appearance:none){}* html .selector{}.unused-class.selector{}html>body .selector{}*:first-child+html .selector{}.selector,x:-ie7{}*+html .selector{}body *.selector{}.selector\ {}html>body .selector{}head~body .selector{}_::selection,.selector:not([attr*=""]){}:root .selector{}body:last-child .selector{}body:nth-of-type(1) .selector{}body:first-of-type .selector{}.selector:not([attr*=""]){}.selector{_property:value}.selector{-property:value}.selector{property:value\9}.selector{property:value\9}.selector{!property: value;color:red}.selector{$property: value;color:red}.selector{color:red;&property: value;}.selector{*property: value;color:red}.selector{)property: value;color:red}.selector{=property: value;color:red}.selector{%property: value;color:red}.selector{+property: value;color:red}.selector{color:red;@property: value;}.selector{,property: value;color:red}.selector{.property: value;color:red}.selector{/property: value;color:red}.selector{`property: value;color:red}.selector{]property: value;color:red}.selector{#property: value;color:red}.selector{~property: value;color:red}.selector{?property: value;color:red}.selector{:property: value;color:red}.selector{|property: value;color:red}.selector{property: value !ie;}@media screen\9{}@media \0screen\,screen\9 {}@media \0screen{}@media screen and (min-width:0\0){}_:-ms-input-placeholder,:root .selector{}_:-ms-fullscreen,:root .selector{}@media screen and (-ms-high-contrast:active),(-ms-high-contrast:none){}@media screen{@media(min-width:0px){}}.selector:not(*:root){}@supports(-webkit-appearance:none){}.selector{(;property: value;);}.selector{[;property: value;];}html:first-child .selector{}_:-o-prefocus,body:last-child .selector{}@media all and (-webkit-min-device-pixel-ratio:1e4),not all and (-webkit-min-device-pixel-ratio:0){}@media(min-resolution:.001dpcm){_:-o-prefocus,.selector{}}*|html[xmlns*=""] .selector{}@media all and (-webkit-min-device-pixel-ratio:0)and (min-resolution:.001dpcm){.selector{}}.selector:not(*:root){}@supports(-webkit-appearance:none){}.selector{(;property: value;);}.selector{[;property: value;];}@media screen and (min-width:0\0){}@media screen{@media(min-width:0px){}}html:first-child .selector{}html[xmlns*=""] body:last-child .selector{}html[xmlns*=""]:root .selector{}*|html[xmlns*=""] .selector{}_::-moz-svg-foreign-content,:root .selector{}@media \\0 screen {}a{*color : black;_background:white;font-size:big;$(var)-size: 100%;}a{*b:c}div{color:red}selector{property:value;property:normal-value}div{color:red}
.selector:not(*:root){}@media screen and (min-width:0\0){}.selector:not(*:root){}@supports(-webkit-appearance:none){}.selector{(;property: value;);}.selector{[;property: value;];}@media \\0 screen {}@media all and (-webkit-min-device-pixel-ratio:0)and (min-resolution:.001dpcm){.selector{}}body:empty .selector{}body:last-child .selector,x:-moz-any-link{}@media \0 all{}body:last-child .selector,x:-moz-any-link,x:default{}body:not(:-moz-handler-blocked) .selector{}@media screen and (-moz-images-in-menus:0){}@media screen and (min--moz-device-pixel-ratio:0){}_::-moz-progress-bar,body:last-child .selector{}@media all and (min--moz-device-pixel-ratio:0)and (min-resolution:.001dpcm){}@media all and (-moz-images-in-menus:0)and (min-resolution:.001dpcm){}@media all and (min--moz-device-pixel-ratio:0){@media(min-width:0px){}}@media all and (-moz-images-in-menus:0){@media(min-width:0px){}}@supports(-moz-appearance:meterbar){}_::-moz-range-track,body:last-child .selector{}@supports(-moz-appearance:meterbar)and (display:flex){}@supports(-moz-appearance:meterbar)and (cursor:zoom-in){}@supports(-moz-appearance:meterbar)and (background-attachment:local){}@supports(-moz-appearance:meterbar)and (image-orientation:90deg){}@supports(-moz-appearance:meterbar)and (all:initial){}@supports(-moz-appearance:meterbar)and (list-style-type:japanese-formal){}@media all and (min--moz-device-pixel-ratio:0)and (min-resolution:30dpcm){}@supports(-moz-appearance:meterbar)and (background-blend-mode:difference,normal){}_:-moz-tree-row(hover),.selector{}_::selection,.selector:not([attr*=""]){}@supports(-webkit-appearance:none){}* html .selector{}.unused-class.selector{}html>body .selector{}*:first-child+html .selector{}.selector,x:-ie7{}*+html .selector{}body *.selector{}.selector\ {}html>body .selector{}head~body .selector{}_::selection,.selector:not([attr*=""]){}:root .selector{}body:last-child .selector{}body:nth-of-type(1) .selector{}body:first-of-type .selector{}.selector:not([attr*=""]){}.selector{_property:value}.selector{-property:value}.selector{property:value\9}.selector{property:value\9}.selector{!property: value;color:red}.selector{$property: value;color:red}.selector{color:red;&property: value;}.selector{*property: value;color:red}.selector{)property: value;color:red}.selector{=property: value;color:red}.selector{%property: value;color:red}.selector{+property: value;color:red}.selector{color:red;@property: value;}.selector{,property: value;color:red}.selector{.property: value;color:red}.selector{/property: value;color:red}.selector{`property: value;color:red}.selector{]property: value;color:red}.selector{#property: value;color:red}.selector{~property: value;color:red}.selector{?property: value;color:red}.selector{:property: value;color:red}.selector{|property: value;color:red}.selector{property:value !ie}@media screen\9{}@media \0screen\,screen\9 {}@media \0screen{}@media screen and (min-width:0\0){}_:-ms-input-placeholder,:root .selector{}_:-ms-fullscreen,:root .selector{}@media screen and (-ms-high-contrast:active),(-ms-high-contrast:none){}@media screen{@media(min-width:0px){}}.selector:not(*:root){}@supports(-webkit-appearance:none){}.selector{(;property: value;);}.selector{[;property: value;];}html:first-child .selector{}_:-o-prefocus,body:last-child .selector{}@media all and (-webkit-min-device-pixel-ratio:1e4),not all and (-webkit-min-device-pixel-ratio:0){}@media(min-resolution:.001dpcm){_:-o-prefocus,.selector{}}*|html[xmlns*=""] .selector{}@media all and (-webkit-min-device-pixel-ratio:0)and (min-resolution:.001dpcm){.selector{}}.selector:not(*:root){}@supports(-webkit-appearance:none){}.selector{(;property: value;);}.selector{[;property: value;];}@media screen and (min-width:0\0){}@media screen{@media(min-width:0px){}}html:first-child .selector{}html[xmlns*=""] body:last-child .selector{}html[xmlns*=""]:root .selector{}*|html[xmlns*=""] .selector{}_::-moz-svg-foreign-content,:root .selector{}@media \\0 screen {}a{*color : black;_background:white;font-size:big;$(var)-size: 100%;}a{*b:c}div{color:red}selector{property:value;property:normal-value}div{color:red}

View File

@ -45,7 +45,8 @@ div {
background: url('\"foo\"');
}
.bar {
background: url(http://example.com/image.svg param(--color var(--primary-color)));}
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)));
}

View File

@ -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__)}

View File

@ -48,4 +48,21 @@ impl Visit for UnitNoUnknown {
unknown_dimension.visit_children_with(self);
}
fn visit_component_value(&mut self, component_value: &ComponentValue) {
if let ComponentValue::PreservedToken(
token_and_span @ TokenAndSpan {
token: Token::Dimension { unit, .. },
..
},
) = component_value
{
if self.ignored_units.iter().all(|item| !item.is_match(unit)) {
let message = format!("Unexpected unknown unit \"{}\".", unit);
self.ctx.report(token_and_span, message);
}
}
component_value.visit_children_with(self);
}
}

View File

@ -26,7 +26,7 @@
x Unexpected unknown unit "pix".
,-[$DIR/tests/rules/fail/unit-no-unknown/default/input.css:5:1]
5 | a { color: rgb(255pix, 0, 51); }
: ^^^
: ^^^^^^
`----
x Unexpected unknown unit "pix".

View File

@ -15,6 +15,9 @@ where
{
fn parse(&mut self) -> PResult<Stylesheet> {
let start = self.input.cur_span();
// Consume a list of rules from input, with the top-level flag set, and set the
// stylesheets value to the result.
let rules = self
.with_ctx(Ctx {
is_top_level: true,
@ -23,6 +26,7 @@ where
.parse_as::<Vec<Rule>>()?;
let last = self.input.last_pos();
// Return the stylesheet.
Ok(Stylesheet {
span: Span::new(start.lo, last, Default::default()),
rules,
@ -35,6 +39,8 @@ where
I: ParserInput,
{
fn parse(&mut self) -> PResult<Vec<Rule>> {
// To consume a list of rules, given a top-level flag:
// Create an initially empty list of rules.
let mut rules = vec![];
@ -122,10 +128,12 @@ where
I: ParserInput,
{
fn parse(&mut self) -> PResult<AtRule> {
// To consume an at-rule:
// Consume the next input token. Create a new at-rule with its name set to the
// value of the current input token, its prelude initially set to an empty list,
// and its value initially set to nothing.
let at_rule_span = self.input.cur_span();
let span = self.input.cur_span();
let at_keyword_name = match bump!(self) {
Token::AtKeyword { value, raw } => (value, raw),
_ => {
@ -136,11 +144,7 @@ where
(
at_keyword_name.0.to_ascii_lowercase(),
AtRuleName::DashedIdent(DashedIdent {
span: Span::new(
at_rule_span.lo + BytePos(1),
at_rule_span.hi,
Default::default(),
),
span: Span::new(span.lo + BytePos(1), span.hi, Default::default()),
value: at_keyword_name.0,
raw: Some(at_keyword_name.1),
}),
@ -149,11 +153,7 @@ where
(
at_keyword_name.0.to_ascii_lowercase(),
AtRuleName::Ident(Ident {
span: Span::new(
at_rule_span.lo + BytePos(1),
at_rule_span.hi,
Default::default(),
),
span: Span::new(span.lo + BytePos(1), span.hi, Default::default()),
value: at_keyword_name.0,
raw: Some(at_keyword_name.1),
}),
@ -172,11 +172,11 @@ where
// This is a parse error. Return the at-rule.
if is!(self, EOF) {
self.errors.push(Error::new(
at_rule_span,
ErrorKind::EofButExpected("semicolon or curly block"),
span!(self, span.lo),
ErrorKind::EofButExpected("';' or '{'"),
));
at_rule.span = span!(self, at_rule_span.lo);
at_rule.span = span!(self, span.lo);
return Ok(at_rule);
}
@ -196,7 +196,7 @@ where
Ok(at_rule_prelude) => match at_rule_prelude {
None if normalized_at_rule_name == js_word!("layer") => {
self.errors.push(Error::new(
at_rule_span,
span,
ErrorKind::Expected("at least one name"),
));
@ -220,7 +220,7 @@ where
}
}
};
at_rule.span = span!(self, at_rule_span.lo);
at_rule.span = span!(self, span.lo);
return Ok(at_rule);
}
@ -287,7 +287,7 @@ where
Some(block)
}
};
at_rule.span = span!(self, at_rule_span.lo);
at_rule.span = span!(self, span.lo);
return Ok(at_rule);
}
@ -314,6 +314,7 @@ where
I: ParserInput,
{
fn parse(&mut self) -> PResult<QualifiedRule> {
// To consume a qualified rule:
let create_prelude =
|p: &mut Parser<I>, list: Vec<ComponentValue>| -> PResult<QualifiedRulePrelude> {
let list_of_component_values = p.create_locv(list);
@ -377,9 +378,10 @@ where
// <EOF-token>
// This is a parse error. Return nothing.
if is!(self, EOF) {
let span = self.input.cur_span();
return Err(Error::new(span, ErrorKind::Eof));
return Err(Error::new(
span!(self, span.lo),
ErrorKind::EofButExpected("'{'"),
));
}
match cur!(self) {
@ -762,23 +764,29 @@ where
I: ParserInput,
{
fn parse(&mut self) -> PResult<Declaration> {
let span = self.input.cur_span();
// To consume a declaration:
// Consume the next input token. Create a new declaration with its name set
// to the value of the current input token and its value initially set to an
// empty list.
let span = self.input.cur_span();
let is_dashed_ident = match cur!(self) {
Token::Ident { value, .. } => value.starts_with("--"),
_ => {
return Err(Error::new(span, ErrorKind::Expected("Ident")));
}
};
let name = if is_dashed_ident {
DeclarationName::DashedIdent(self.parse()?)
} else {
DeclarationName::Ident(self.parse()?)
};
let mut declaration = Declaration {
span: Default::default(),
name,
value: vec![],
important: None,
};
// 1. While the next input token is a <whitespace-token>, consume the next input
// token.
@ -792,124 +800,180 @@ where
// token.
self.input.skip_ws();
let mut end = self.input.cur_span().hi;
let mut value = vec![];
// 4. As long as the next input token is anything other than an <EOF-token>,
// consume a component value and append it to the declarations value.
if !is!(self, EOF) {
match is_dashed_ident {
true => {
value.extend(self.parse_declaration_value()?);
let mut last_whitespaces = (0, 0, 0);
let mut exclamation_point_span = None;
let mut important_ident = None;
loop {
// TODO fix me `)`, workaround
if is_one_of!(self, EOF, ")") {
if important_ident.is_none() {
if let Some(span) = &exclamation_point_span {
// TODO improve me to `<declaration-value>`
self.errors.push(Error::new(
*span,
ErrorKind::Unexpected("'!' in <declaration-value>"),
));
}
}
false => {
loop {
// TODO fix me
self.input.skip_ws();
// TODO fix me
if is_one_of!(self, EOF, "!", ";", "}", ")") {
break;
}
break;
}
let state = self.input.state();
let ctx = Ctx {
block_contents_grammar: BlockContentsGrammar::DeclarationValue,
..self.ctx
};
let parsed = self.with_ctx(ctx).parse_as::<ComponentValue>();
let value_or_token = match parsed {
Ok(value) => value,
Err(err) => {
self.errors.push(err);
self.input.reset(&state);
let component_value = self
.with_ctx(Ctx {
block_contents_grammar: BlockContentsGrammar::NoGrammar,
..self.ctx
})
.parse_as::<ComponentValue>()?;
let ctx = Ctx {
block_contents_grammar: BlockContentsGrammar::NoGrammar,
..self.ctx
};
match &component_value {
// Optimization for step 5
ComponentValue::PreservedToken(
token_and_span @ TokenAndSpan {
token: Token::Ident { value, .. },
..
},
) if exclamation_point_span.is_some()
&& value.to_ascii_lowercase() == js_word!("important") =>
{
important_ident = Some(token_and_span.clone());
}
ComponentValue::PreservedToken(TokenAndSpan {
span,
token: Token::Delim { value: '!', .. },
..
}) => {
exclamation_point_span = Some(*span);
self.with_ctx(ctx).parse_as::<ComponentValue>()?
}
};
if important_ident.is_some() {
important_ident = None;
value.push(value_or_token);
end = self.input.last_pos();
last_whitespaces = (last_whitespaces.2, 0, 0);
}
}
// Optimization for step 6
ComponentValue::PreservedToken(TokenAndSpan {
token: Token::WhiteSpace { .. },
..
}) => match (&exclamation_point_span, &important_ident) {
(Some(_), Some(_)) => {
last_whitespaces.2 += 1;
}
(Some(_), None) => {
last_whitespaces.1 += 1;
}
(None, None) => {
last_whitespaces.0 += 1;
}
_ => {
unreachable!();
}
},
_ => {
last_whitespaces = (0, 0, 0);
if let Some(span) = &exclamation_point_span {
// TODO improve me to `<declaration-value>`
self.errors.push(Error::new(
*span,
ErrorKind::Unexpected("'!' in <declaration-value>"),
));
important_ident = None;
exclamation_point_span = None;
}
}
}
match value.last() {
Some(ComponentValue::PreservedToken(TokenAndSpan {
span,
token: Token::BadUrl { .. },
..
}))
| Some(ComponentValue::PreservedToken(TokenAndSpan {
span,
token: Token::BadString { .. },
..
})) => {
return Err(Error::new(
*span,
ErrorKind::Unexpected("token in <declaration-value>"),
));
}
_ => {}
};
declaration.value.push(component_value);
}
// 5. If the last two non-<whitespace-token>s in the declarations value are a
// <delim-token> with the value "!" followed by an <ident-token> with a value
// that is an ASCII case-insensitive match for "important", remove them from the
// declarations value and set the declarations important flag to true.
self.input.skip_ws();
if let (Some(exclamation_point_span), Some(important_ident)) =
(exclamation_point_span, important_ident)
{
let span = Span::new(
exclamation_point_span.lo,
important_ident.span_hi(),
Default::default(),
);
let value = match important_ident.token {
Token::Ident { value, raw } => (value, raw),
_ => {
unreachable!();
}
};
let value = Ident {
span: important_ident.span,
value: value.0,
raw: Some(value.1),
};
let important = if is!(self, "!") {
let important_flag = self.parse()?;
end = self.input.last_pos();
Some(important_flag)
} else {
None
};
declaration.important = Some(ImportantFlag { span, value });
}
// 6. While the last token in the declarations value is a <whitespace-token>,
// remove that token.
self.input.skip_ws();
let len = if declaration.important.is_some() {
declaration.value.len()
- (last_whitespaces.0 + last_whitespaces.1 + last_whitespaces.2 + 2)
} else {
declaration.value.len() - (last_whitespaces.0 + last_whitespaces.1 + last_whitespaces.2)
};
// 7. Return the declaration.
Ok(Declaration {
span: Span::new(span.lo, end, Default::default()),
name,
value,
important,
})
}
}
declaration.value.truncate(len);
impl<I> Parse<ImportantFlag> for Parser<I>
where
I: ParserInput,
{
fn parse(&mut self) -> PResult<ImportantFlag> {
let span = self.input.cur_span();
expect!(self, "!");
self.input.skip_ws();
let ident: Ident = self.parse()?;
if &*ident.value.to_ascii_lowercase() != "important" {
return Err(Error::new(span, ErrorKind::Expected("important")));
// Update span
// TODO for commit history
if let Some(important) = &declaration.important {
declaration.span = Span::new(span.lo, important.span_hi(), Default::default());
} else if let Some(last) = declaration.value.last() {
declaration.span = Span::new(span.lo, last.span_hi(), Default::default());
} else {
declaration.span = span!(self, span.lo);
}
Ok(ImportantFlag {
span: span!(self, span.lo),
value: ident,
})
if is_dashed_ident {
// Don't parse custom properties
//
// 7. Return the declaration.
return Ok(declaration);
}
// Grammar parsing
let locv = self.create_locv(declaration.value);
declaration.value = match self.parse_according_to_grammar(&locv, |parser| {
let mut values = vec![];
loop {
if is!(parser, EOF) {
break;
}
values.push(parser.parse_generic_value()?);
}
Ok(values)
}) {
Ok(values) => values,
Err(err) => {
if *err.kind() != ErrorKind::Ignore {
self.errors.push(err);
}
locv.children
}
};
// 7. Return the declaration.
Ok(declaration)
}
}
@ -918,137 +982,31 @@ where
I: ParserInput,
{
fn parse(&mut self) -> PResult<ComponentValue> {
match self.ctx.block_contents_grammar {
BlockContentsGrammar::NoGrammar => {
// Consume the next input token.
match cur!(self) {
// If the current input token is a <{-token>, <[-token>, or <(-token>, consume a
// simple block and return it.
tok!("[") | tok!("(") | tok!("{") => {
let block = self.parse()?;
match cur!(self) {
// If the current input token is a <{-token>, <[-token>, or <(-token>, consume a
// simple block and return it.
tok!("[") | tok!("(") | tok!("{") => {
let block = self.parse()?;
Ok(ComponentValue::SimpleBlock(block))
}
// Otherwise, if the current input token is a <function-token>, consume a
// function and return it.
tok!("function") => Ok(ComponentValue::Function(self.parse()?)),
// Otherwise, return the current input token.
_ => {
let token = self.input.bump();
match token {
Some(t) => Ok(ComponentValue::PreservedToken(t)),
_ => {
unreachable!();
}
}
}
}
Ok(ComponentValue::SimpleBlock(block))
}
// Otherwise, if the current input token is a <function-token>, consume a
// function and return it.
tok!("function") => {
let function = self.parse()?;
Ok(ComponentValue::Function(function))
}
// Otherwise, return the current input token.
_ => {
// TODO refactor me
self.input.skip_ws();
let token = self.input.bump();
let span = self.input.cur_span();
match cur!(self) {
tok!(",") | tok!("/") | tok!(";") => {
return Ok(ComponentValue::Delimiter(self.parse()?));
match token {
Some(t) => Ok(ComponentValue::PreservedToken(t)),
_ => {
unreachable!();
}
tok!("string") => {
return Ok(ComponentValue::Str(self.parse()?));
}
tok!("url") => {
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()?));
}
},
tok!("percentage") => {
return Ok(ComponentValue::Percentage(self.parse()?));
}
tok!("dimension") => return Ok(ComponentValue::Dimension(self.parse()?)),
Token::Number { type_flag, .. } => {
if *type_flag == NumberType::Integer {
return Ok(ComponentValue::Integer(self.parse()?));
}
return Ok(ComponentValue::Number(self.parse()?));
}
Token::Ident { value, .. } => {
if value.starts_with("--") {
return Ok(ComponentValue::DashedIdent(self.parse()?));
} else if &*value.to_ascii_lowercase() == "u"
&& peeked_is_one_of!(self, "+", "number", "dimension")
{
return Ok(ComponentValue::UnicodeRange(self.parse()?));
}
return Ok(ComponentValue::Ident(self.parse()?));
}
tok!("[") | tok!("(") | tok!("{") => {
let ctx = Ctx {
block_contents_grammar: BlockContentsGrammar::NoGrammar,
..self.ctx
};
let mut block = self.with_ctx(ctx).parse_as::<SimpleBlock>()?;
let locv = self.create_locv(block.value);
block.value = match self.parse_according_to_grammar(&locv, |parser| {
let mut values = vec![];
loop {
parser.input.skip_ws();
if is!(parser, EOF) {
break;
}
let component_value = parser.parse()?;
values.push(component_value);
}
Ok(values)
}) {
Ok(values) => values,
Err(err) => {
if *err.kind() != ErrorKind::Ignore {
self.errors.push(err);
}
locv.children
}
};
return Ok(ComponentValue::SimpleBlock(block));
}
tok!("#") => {
return Ok(ComponentValue::Color(self.parse()?));
}
_ => {}
}
Err(Error::new(span, ErrorKind::Expected("Declaration value")))
}
}
}
@ -1059,6 +1017,10 @@ where
I: ParserInput,
{
fn parse(&mut self) -> PResult<SimpleBlock> {
// To consume a simple block:
// Create a simple block with its associated token set to the current input
// token and with its value initially set to an empty list.
let span = self.input.cur_span();
let name = match cur!(self) {
tok!("{") | tok!("(") | tok!("[") => self.input.bump().unwrap(),
@ -1069,8 +1031,6 @@ where
));
}
};
// Create a simple block with its associated token set to the current input
// token and with its value initially set to an empty list.
let mut simple_block = SimpleBlock {
span: Default::default(),
name,
@ -1082,9 +1042,19 @@ where
// <EOF-token>
// This is a parse error. Return the block.
if is!(self, EOF) {
let span = self.input.cur_span();
let mirror = match &simple_block.name.token {
Token::LBracket => "']'",
Token::LParen => "')'",
Token::LBrace => "'}'",
_ => {
unreachable!();
}
};
self.errors.push(Error::new(span, ErrorKind::Eof));
self.errors.push(Error::new(
span!(self, span.lo),
ErrorKind::EofButExpected(mirror),
));
break;
}
@ -1124,6 +1094,107 @@ where
}
}
impl<I> Parse<Function> for Parser<I>
where
I: ParserInput,
{
fn parse(&mut self) -> PResult<Function> {
// Note: This algorithm assumes that the current input token has already been
// checked to be a <function-token>.
//
// To consume a function:
// Create a function with its name equal to the value of the current input token
// 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),
_ => {
unreachable!()
}
};
let function_name = &*ident.0.to_ascii_lowercase();
let name = Ident {
span: swc_common::Span::new(span.lo, span.hi - BytePos(1), Default::default()),
value: ident.0,
raw: Some(ident.1),
};
let mut function = Function {
span: Default::default(),
name,
value: vec![],
};
let mut with_error = false;
// Repeatedly consume the next input token and process it as follows:
loop {
// <EOF-token>
// This is a parse error. Return the function.
if is!(self, EOF) {
self.errors.push(Error::new(
span!(self, span.lo),
ErrorKind::EofButExpected("')'"),
));
break;
}
match cur!(self) {
// <)-token>
// Return the function.
tok!(")") => {
bump!(self);
break;
}
// anything else
// Reconsume the current input token. Consume a component value and append the
// returned value to the functions value.
_ => match self.ctx.block_contents_grammar {
BlockContentsGrammar::NoGrammar => {
let ctx = Ctx {
block_contents_grammar: BlockContentsGrammar::NoGrammar,
..self.ctx
};
let component_value = self.with_ctx(ctx).parse_as::<ComponentValue>()?;
function.value.push(component_value);
}
_ => {
if with_error {
function.value.push(self.parse()?);
} else {
let state = self.input.state();
let values = self.parse_function_values(function_name);
match values {
Ok(values) => {
function.value.extend(values);
}
Err(err) => {
self.errors.push(err);
self.input.reset(&state);
with_error = true;
function.value.push(self.parse()?);
}
}
}
}
},
}
}
function.span = span!(self, span.lo);
return Ok(function);
}
}
impl<I> Parse<ListOfComponentValues> for Parser<I>
where
I: ParserInput,
@ -1136,6 +1207,9 @@ where
};
let mut children = vec![];
// Repeatedly consume a component value from input until an <EOF-token> is
// returned, appending the returned values (except the final <EOF-token>) into a
// list. Return the list.
loop {
if is!(self, EOF) {
break;

View File

@ -11,84 +11,195 @@ impl<I> Parser<I>
where
I: ParserInput,
{
/// Parse value as <declaration-value>.
pub(super) fn parse_declaration_value(&mut self) -> PResult<Vec<ComponentValue>> {
let mut value = vec![];
let mut balance_stack: Vec<Option<char>> = vec![];
pub(super) fn parse_generic_value(&mut self) -> PResult<ComponentValue> {
self.input.skip_ws();
// The <declaration-value> production matches any sequence of one or more
// tokens, so long as the sequence does not contain ...
loop {
if is!(self, EOF) {
break;
let span = self.input.cur_span();
match cur!(self) {
tok!(",") | tok!("/") | tok!(";") => {
return Ok(ComponentValue::Delimiter(self.parse()?));
}
match cur!(self) {
// ... <bad-string-token>, <bad-url-token>,
tok!("bad-string") | tok!("bad-url") => break,
tok!("string") => {
return Ok(ComponentValue::Str(self.parse()?));
}
// ... unmatched <)-token>, <]-token>, or <}-token>,
tok!(")") | tok!("]") | tok!("}") => {
let value = match cur!(self) {
tok!(")") => ')',
tok!("]") => ']',
tok!("}") => '}',
_ => {
unreachable!();
tok!("url") => {
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.with_ctx(Ctx {
block_contents_grammar: BlockContentsGrammar::DeclarationValue,
..self.ctx
})
.parse_as::<Function>()?,
));
}
},
tok!("percentage") => {
return Ok(ComponentValue::Percentage(self.parse()?));
}
tok!("dimension") => return Ok(ComponentValue::Dimension(self.parse()?)),
Token::Number { type_flag, .. } => {
if *type_flag == NumberType::Integer {
return Ok(ComponentValue::Integer(self.parse()?));
}
return Ok(ComponentValue::Number(self.parse()?));
}
Token::Ident { value, .. } => {
if value.starts_with("--") {
return Ok(ComponentValue::DashedIdent(self.parse()?));
} else if &*value.to_ascii_lowercase() == "u"
&& peeked_is_one_of!(self, "+", "number", "dimension")
{
return Ok(ComponentValue::UnicodeRange(self.parse()?));
}
return Ok(ComponentValue::Ident(self.parse()?));
}
tok!("[") | tok!("(") | tok!("{") => {
let ctx = Ctx {
block_contents_grammar: BlockContentsGrammar::NoGrammar,
..self.ctx
};
let mut block = self.with_ctx(ctx).parse_as::<SimpleBlock>()?;
let locv = self.create_locv(block.value);
block.value = match self.parse_according_to_grammar(&locv, |parser| {
let mut values = vec![];
loop {
parser.input.skip_ws();
if is!(parser, EOF) {
break;
}
};
let balance_close_type = match balance_stack.pop() {
Some(v) => v,
None => None,
};
let component_value = parser.parse_generic_value()?;
if Some(value) != balance_close_type {
break;
values.push(component_value);
}
}
tok!("function") | tok!("(") | tok!("[") | tok!("{") => {
let value = match cur!(self) {
tok!("function") | tok!("(") => ')',
tok!("[") => ']',
tok!("{") => '}',
_ => {
unreachable!();
Ok(values)
}) {
Ok(values) => values,
Err(err) => {
if *err.kind() != ErrorKind::Ignore {
self.errors.push(err);
}
};
balance_stack.push(Some(value));
}
// ... or top-level <semicolon-token> tokens
tok!(";") => {
if balance_stack.is_empty() {
break;
locv.children
}
}
};
// ... or <delim-token> tokens with a value of "!"
tok!("!") => {
if balance_stack.is_empty() {
break;
}
}
_ => {}
return Ok(ComponentValue::SimpleBlock(block));
}
let token = self.input.bump();
match token {
Some(token) => value.push(ComponentValue::PreservedToken(token)),
None => break,
tok!("#") => {
return Ok(ComponentValue::Color(self.parse()?));
}
_ => {}
}
Ok(value)
Err(Error::new(span, ErrorKind::Expected("Declaration value")))
}
/// Parse value as <declaration-value>.
// pub(super) fn validate_declaration_value(&mut self) -> PResult<Vec<ComponentValue>> {
// let mut value = vec![];
// let mut balance_stack: Vec<Option<char>> = vec![];
//
// // The <declaration-value> production matches any sequence of one or more
// // tokens, so long as the sequence does not contain ...
// loop {
// if is!(self, EOF) {
// break;
// }
//
// match cur!(self) {
// // ... <bad-string-token>, <bad-url-token>,
// tok!("bad-string") | tok!("bad-url") => { break; },
//
// // ... unmatched <)-token>, <]-token>, or <}-token>,
// tok!(")") | tok!("]") | tok!("}") => {
// let value = match cur!(self) {
// tok!(")") => ')',
// tok!("]") => ']',
// tok!("}") => '}',
// _ => {
// unreachable!();
// }
// };
//
// let balance_close_type = match balance_stack.pop() {
// Some(v) => v,
// None => None,
// };
//
// if Some(value) != balance_close_type {
// break;
// }
// }
//
// tok!("function") | tok!("(") | tok!("[") | tok!("{") => {
// let value = match cur!(self) {
// tok!("function") | tok!("(") => ')',
// tok!("[") => ']',
// tok!("{") => '}',
// _ => {
// unreachable!();
// }
// };
//
// balance_stack.push(Some(value));
// }
//
// // ... or top-level <semicolon-token> tokens
// tok!(";") => {
// if balance_stack.is_empty() {
// break;
// }
// }
//
// // ... or <delim-token> tokens with a value of "!"
// tok!("!") => {
// if balance_stack.is_empty() {
// break;
// }
// }
//
// _ => {}
// }
//
// let token = self.input.bump();
//
// match token {
// Some(token) => value.push(ComponentValue::PreservedToken(token)),
// None => break,
// }
// }
//
// Ok(value)
// }
/// Parse value as <any-value>.
pub(super) fn parse_any_value(&mut self) -> PResult<Vec<TokenAndSpan>> {
let mut tokens = vec![];
@ -360,7 +471,15 @@ where
}
tok!("number") => Ok(Some(ComponentValue::Number(parser.parse()?))),
Token::Function { value, .. } if is_math_function(value) => {
Ok(Some(ComponentValue::Function(parser.parse()?)))
Ok(Some(ComponentValue::Function(
parser
.with_ctx(Ctx {
block_contents_grammar:
BlockContentsGrammar::DeclarationValue,
..parser.ctx
})
.parse_as::<Function>()?,
)))
}
tok!("ident") => {
is_legacy_syntax = false;
@ -418,7 +537,15 @@ where
}
}
Token::Function { value, .. } if is_math_function(value) => {
Ok(Some(ComponentValue::Function(parser.parse()?)))
Ok(Some(ComponentValue::Function(
parser
.with_ctx(Ctx {
block_contents_grammar:
BlockContentsGrammar::DeclarationValue,
..parser.ctx
})
.parse_as::<Function>()?,
)))
}
_ => {
if !has_variable_before {
@ -473,7 +600,15 @@ where
}
tok!("number") => Ok(Some(ComponentValue::Number(parser.parse()?))),
Token::Function { value, .. } if is_math_function(value) => {
Ok(Some(ComponentValue::Function(parser.parse()?)))
Ok(Some(ComponentValue::Function(
parser
.with_ctx(Ctx {
block_contents_grammar:
BlockContentsGrammar::DeclarationValue,
..parser.ctx
})
.parse_as::<Function>()?,
)))
}
tok!("ident") if !is_legacy_syntax => {
let ident: Ident = parser.parse()?;
@ -517,7 +652,15 @@ where
Ok(Some(ComponentValue::Percentage(parser.parse()?)))
}
Token::Function { value, .. } if is_math_function(value) => {
Ok(Some(ComponentValue::Function(parser.parse()?)))
Ok(Some(ComponentValue::Function(
parser
.with_ctx(Ctx {
block_contents_grammar:
BlockContentsGrammar::DeclarationValue,
..parser.ctx
})
.parse_as::<Function>()?,
)))
}
tok!("ident") => {
let ident: Ident = parser.parse()?;
@ -585,7 +728,15 @@ where
}
tok!("number") => Ok(Some(ComponentValue::Number(parser.parse()?))),
Token::Function { value, .. } if is_math_function(value) => {
Ok(Some(ComponentValue::Function(parser.parse()?)))
Ok(Some(ComponentValue::Function(
parser
.with_ctx(Ctx {
block_contents_grammar:
BlockContentsGrammar::DeclarationValue,
..parser.ctx
})
.parse_as::<Function>()?,
)))
}
tok!("ident") if !is_legacy_syntax => {
let ident: Ident = parser.parse()?;
@ -629,7 +780,15 @@ where
Ok(Some(ComponentValue::Percentage(parser.parse()?)))
}
Token::Function { value, .. } if is_math_function(value) => {
Ok(Some(ComponentValue::Function(parser.parse()?)))
Ok(Some(ComponentValue::Function(
parser
.with_ctx(Ctx {
block_contents_grammar:
BlockContentsGrammar::DeclarationValue,
..parser.ctx
})
.parse_as::<Function>()?,
)))
}
tok!("ident") => {
let ident: Ident = parser.parse()?;
@ -682,7 +841,15 @@ where
Ok(Some(ComponentValue::AlphaValue(parser.parse()?)))
}
Token::Function { value, .. } if is_math_function(value) => {
Ok(Some(ComponentValue::Function(parser.parse()?)))
Ok(Some(ComponentValue::Function(
parser
.with_ctx(Ctx {
block_contents_grammar:
BlockContentsGrammar::DeclarationValue,
..parser.ctx
})
.parse_as::<Function>()?,
)))
}
_ => {
if !has_variable_before {
@ -716,7 +883,15 @@ where
Ok(Some(ComponentValue::AlphaValue(parser.parse()?)))
}
Token::Function { value, .. } if is_math_function(value) => {
Ok(Some(ComponentValue::Function(parser.parse()?)))
Ok(Some(ComponentValue::Function(
parser
.with_ctx(Ctx {
block_contents_grammar:
BlockContentsGrammar::DeclarationValue,
..parser.ctx
})
.parse_as::<Function>()?,
)))
}
tok!("ident") => {
let ident: Ident = parser.parse()?;
@ -790,7 +965,15 @@ where
Ok(Some(ComponentValue::Hue(parser.parse()?)))
}
Token::Function { value, .. } if is_math_function(value) => {
Ok(Some(ComponentValue::Function(parser.parse()?)))
Ok(Some(ComponentValue::Function(
parser
.with_ctx(Ctx {
block_contents_grammar:
BlockContentsGrammar::DeclarationValue,
..parser.ctx
})
.parse_as::<Function>()?,
)))
}
tok!("ident") => {
let ident: Ident = parser.parse()?;
@ -835,7 +1018,15 @@ where
}
tok!("number") => Ok(Some(ComponentValue::Number(parser.parse()?))),
Token::Function { value, .. } if is_math_function(value) => {
Ok(Some(ComponentValue::Function(parser.parse()?)))
Ok(Some(ComponentValue::Function(
parser
.with_ctx(Ctx {
block_contents_grammar:
BlockContentsGrammar::DeclarationValue,
..parser.ctx
})
.parse_as::<Function>()?,
)))
}
tok!("ident") => {
let ident: Ident = parser.parse()?;
@ -898,7 +1089,15 @@ where
Ok(Some(ComponentValue::Percentage(parser.parse()?)))
}
Token::Function { value, .. } if is_math_function(value) => {
Ok(Some(ComponentValue::Function(parser.parse()?)))
Ok(Some(ComponentValue::Function(
parser
.with_ctx(Ctx {
block_contents_grammar:
BlockContentsGrammar::DeclarationValue,
..parser.ctx
})
.parse_as::<Function>()?,
)))
}
tok!("ident") => {
let ident: Ident = parser.parse()?;
@ -947,7 +1146,15 @@ where
Ok(Some(ComponentValue::Number(parser.parse()?)))
}
Token::Function { value, .. } if is_math_function(value) => {
Ok(Some(ComponentValue::Function(parser.parse()?)))
Ok(Some(ComponentValue::Function(
parser
.with_ctx(Ctx {
block_contents_grammar:
BlockContentsGrammar::DeclarationValue,
..parser.ctx
})
.parse_as::<Function>()?,
)))
}
tok!("ident") => {
let ident: Ident = parser.parse()?;
@ -1015,7 +1222,15 @@ where
Ok(Some(ComponentValue::Percentage(parser.parse()?)))
}
Token::Function { value, .. } if is_math_function(value) => {
Ok(Some(ComponentValue::Function(parser.parse()?)))
Ok(Some(ComponentValue::Function(
parser
.with_ctx(Ctx {
block_contents_grammar:
BlockContentsGrammar::DeclarationValue,
..parser.ctx
})
.parse_as::<Function>()?,
)))
}
tok!("ident") => {
let ident: Ident = parser.parse()?;
@ -1064,7 +1279,15 @@ where
Ok(Some(ComponentValue::Number(parser.parse()?)))
}
Token::Function { value, .. } if is_math_function(value) => {
Ok(Some(ComponentValue::Function(parser.parse()?)))
Ok(Some(ComponentValue::Function(
parser
.with_ctx(Ctx {
block_contents_grammar:
BlockContentsGrammar::DeclarationValue,
..parser.ctx
})
.parse_as::<Function>()?,
)))
}
tok!("ident") => {
let ident: Ident = parser.parse()?;
@ -1110,7 +1333,15 @@ where
Ok(Some(ComponentValue::Hue(parser.parse()?)))
}
Token::Function { value, .. } if is_math_function(value) => {
Ok(Some(ComponentValue::Function(parser.parse()?)))
Ok(Some(ComponentValue::Function(
parser
.with_ctx(Ctx {
block_contents_grammar:
BlockContentsGrammar::DeclarationValue,
..parser.ctx
})
.parse_as::<Function>()?,
)))
}
tok!("ident") => {
let ident: Ident = parser.parse()?;
@ -1193,7 +1424,15 @@ where
Ok(Some(ComponentValue::AlphaValue(parser.parse()?)))
}
Token::Function { value, .. } if is_math_function(value) => {
Ok(Some(ComponentValue::Function(parser.parse()?)))
Ok(Some(ComponentValue::Function(
parser
.with_ctx(Ctx {
block_contents_grammar:
BlockContentsGrammar::DeclarationValue,
..parser.ctx
})
.parse_as::<Function>()?,
)))
}
tok!("ident") if !matches!(function_name, "device-cmyk") => {
let ident: Ident = parser.parse()?;
@ -1302,7 +1541,15 @@ where
Ok(Some(ComponentValue::Percentage(parser.parse()?)))
}
Token::Function { value, .. } if is_math_function(value) => {
Ok(Some(ComponentValue::Function(parser.parse()?)))
Ok(Some(ComponentValue::Function(
parser
.with_ctx(Ctx {
block_contents_grammar:
BlockContentsGrammar::DeclarationValue,
..parser.ctx
})
.parse_as::<Function>()?,
)))
}
tok!("ident") => {
let ident: Ident = parser.parse()?;
@ -1353,7 +1600,14 @@ where
"var" | "env" | "constant"
) =>
{
ComponentValue::Function(self.parse()?)
ComponentValue::Function(
self.with_ctx(Ctx {
block_contents_grammar:
BlockContentsGrammar::DeclarationValue,
..self.ctx
})
.parse_as::<Function>()?,
)
}
tok!("ident") => {
let ident: Ident = self.parse()?;
@ -1384,7 +1638,15 @@ where
Ok(Some(ComponentValue::Percentage(parser.parse()?)))
}
Token::Function { value, .. } if is_math_function(value) => {
Ok(Some(ComponentValue::Function(parser.parse()?)))
Ok(Some(ComponentValue::Function(
parser
.with_ctx(Ctx {
block_contents_grammar:
BlockContentsGrammar::DeclarationValue,
..parser.ctx
})
.parse_as::<Function>()?,
)))
}
tok!("ident") => {
let ident: Ident = parser.parse()?;
@ -1440,7 +1702,15 @@ where
}
}
Token::Function { value, .. } if is_math_function(value) => {
Ok(Some(ComponentValue::Function(parser.parse()?)))
Ok(Some(ComponentValue::Function(
parser
.with_ctx(Ctx {
block_contents_grammar:
BlockContentsGrammar::DeclarationValue,
..parser.ctx
})
.parse_as::<Function>()?,
)))
}
_ => {
if !has_variable_before {
@ -1477,7 +1747,15 @@ where
Ok(Some(ComponentValue::AlphaValue(parser.parse()?)))
}
Token::Function { value, .. } if is_math_function(value) => {
Ok(Some(ComponentValue::Function(parser.parse()?)))
Ok(Some(ComponentValue::Function(
parser
.with_ctx(Ctx {
block_contents_grammar:
BlockContentsGrammar::DeclarationValue,
..parser.ctx
})
.parse_as::<Function>()?,
)))
}
tok!("ident") if !matches!(function_name, "device-cmyk") => {
let ident: Ident = parser.parse()?;
@ -1542,14 +1820,7 @@ where
break;
}
let value = match self.try_parse(|p| {
let ctx = Ctx {
block_contents_grammar: BlockContentsGrammar::DeclarationValue,
..p.ctx
};
p.with_ctx(ctx).parse_as::<ComponentValue>()
}) {
let value = match self.try_parse(|p| p.parse_generic_value()) {
Some(v) => v,
None => {
if is_one_of!(self, ";", ":") {
@ -1589,7 +1860,13 @@ where
{
*has_before_variable = true;
Ok(Some(ComponentValue::Function(self.parse()?)))
Ok(Some(ComponentValue::Function(
self.with_ctx(Ctx {
block_contents_grammar: BlockContentsGrammar::DeclarationValue,
..self.ctx
})
.parse_as::<Function>()?,
)))
}
_ => fallback(self, *has_before_variable),
}
@ -2275,7 +2552,13 @@ where
}
// <device-cmyk()>
Token::Function { value, .. } if value.as_ref().eq_ignore_ascii_case("device-cmyk") => {
Ok(Color::Function(self.parse()?))
Ok(Color::Function(
self.with_ctx(Ctx {
block_contents_grammar: BlockContentsGrammar::DeclarationValue,
..self.ctx
})
.parse_as::<Function>()?,
))
}
// <absolute-color-base>
_ => match self.parse() {
@ -2316,7 +2599,13 @@ where
Ok(AbsoluteColorBase::NamedColorOrTransparent(self.parse()?))
}
Token::Function { value, .. } if is_absolute_color_base_function(value) => {
Ok(AbsoluteColorBase::Function(self.parse()?))
Ok(AbsoluteColorBase::Function(
self.with_ctx(Ctx {
block_contents_grammar: BlockContentsGrammar::DeclarationValue,
..self.ctx
})
.parse_as::<Function>()?,
))
}
_ => {
return Err(Error::new(
@ -2427,7 +2716,13 @@ where
return Err(Error::new(span, ErrorKind::Expected("math function token")));
}
Ok(CmykComponent::Function(self.parse()?))
Ok(CmykComponent::Function(
self.with_ctx(Ctx {
block_contents_grammar: BlockContentsGrammar::DeclarationValue,
..self.ctx
})
.parse_as::<Function>()?,
))
}
_ => {
unreachable!()
@ -2580,7 +2875,13 @@ where
modifiers.push(UrlModifier::Ident(self.parse()?));
}
tok!("function") => {
modifiers.push(UrlModifier::Function(self.parse()?));
modifiers.push(UrlModifier::Function(
self.with_ctx(Ctx {
block_contents_grammar: BlockContentsGrammar::DeclarationValue,
..self.ctx
})
.parse_as::<Function>()?,
));
}
_ => {
let span = self.input.cur_span();
@ -2608,89 +2909,6 @@ where
}
}
impl<I> Parse<Function> for Parser<I>
where
I: ParserInput,
{
fn parse(&mut self) -> PResult<Function> {
let span = self.input.cur_span();
let ident = match bump!(self) {
Token::Function { value, raw } => (value, raw),
_ => {
unreachable!()
}
};
let function_name = &*ident.0.to_ascii_lowercase();
let name = Ident {
span: swc_common::Span::new(span.lo, span.hi - BytePos(1), Default::default()),
value: ident.0,
raw: Some(ident.1),
};
// Create a function with its name equal to the value of the current input token
// and with its value initially set to an empty list.
let mut function = Function {
span: Default::default(),
name,
value: vec![],
};
// Repeatedly consume the next input token and process it as follows:
loop {
// <EOF-token>
// This is a parse error. Return the function.
if is!(self, EOF) {
break;
}
match cur!(self) {
// <)-token>
// Return the function.
tok!(")") => {
bump!(self);
break;
}
// anything else
// Reconsume the current input token. Consume a component value and append the
// returned value to the functions value.
_ => match self.ctx.block_contents_grammar {
BlockContentsGrammar::NoGrammar => {
let ctx = Ctx {
block_contents_grammar: BlockContentsGrammar::NoGrammar,
..self.ctx
};
let component_value = self.with_ctx(ctx).parse_as::<ComponentValue>()?;
function.value.push(component_value);
}
_ => {
let state = self.input.state();
let values = self.parse_function_values(function_name);
match values {
Ok(values) => {
function.value.extend(values);
}
Err(err) => {
self.errors.push(err);
self.input.reset(&state);
function.value.push(self.parse()?);
}
}
}
},
}
}
function.span = span!(self, span.lo);
return Ok(function);
}
}
// <urange> =
// u '+' <ident-token> '?'* |
// u <dimension-token> '?'* |
@ -3292,7 +3510,13 @@ where
Ok(CalcValue::Sum(calc_sum_in_parens))
}
tok!("function") => Ok(CalcValue::Function(self.parse()?)),
tok!("function") => Ok(CalcValue::Function(
self.with_ctx(Ctx {
block_contents_grammar: BlockContentsGrammar::DeclarationValue,
..self.ctx
})
.parse_as::<Function>()?,
)),
_ => {
let span = self.input.cur_span();

View File

@ -2331,7 +2331,7 @@
"type": "Declaration",
"span": {
"start": 815,
"end": 827,
"end": 850,
"ctxt": 0
},
"name": {
@ -2346,102 +2346,103 @@
},
"value": [
{
"type": "PreservedToken",
"type": "SimpleBlock",
"span": {
"start": 826,
"end": 827,
"ctxt": 0
},
"token": "LBrace"
},
{
"type": "PreservedToken",
"span": {
"start": 827,
"end": 828,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 828,
"end": 837,
"ctxt": 0
},
"token": {
"Ident": {
"value": "something",
"raw": "something"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 837,
"end": 838,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 838,
"end": 839,
"ctxt": 0
},
"token": {
"Delim": {
"value": "!"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 839,
"end": 848,
"ctxt": 0
},
"token": {
"Ident": {
"value": "important",
"raw": "important"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 848,
"end": 849,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 849,
"end": 850,
"ctxt": 0
},
"token": "RBrace"
"name": {
"type": "PreservedToken",
"span": {
"start": 826,
"end": 827,
"ctxt": 0
},
"token": "LBrace"
},
"value": [
{
"type": "PreservedToken",
"span": {
"start": 827,
"end": 828,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 828,
"end": 837,
"ctxt": 0
},
"token": {
"Ident": {
"value": "something",
"raw": "something"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 837,
"end": 838,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 838,
"end": 839,
"ctxt": 0
},
"token": {
"Delim": {
"value": "!"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 839,
"end": 848,
"ctxt": 0
},
"token": {
"Ident": {
"value": "important",
"raw": "important"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 848,
"end": 849,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
}
]
}
],
"important": null
@ -2465,53 +2466,41 @@
},
"value": [
{
"type": "PreservedToken",
"type": "SimpleBlock",
"span": {
"start": 871,
"end": 872,
"ctxt": 0
},
"token": "LParen"
},
{
"type": "PreservedToken",
"span": {
"start": 872,
"end": 873,
"ctxt": 0
},
"token": "LBracket"
},
{
"type": "PreservedToken",
"span": {
"start": 873,
"end": 874,
"ctxt": 0
},
"token": "RBracket"
},
{
"type": "PreservedToken",
"span": {
"start": 874,
"end": 875,
"ctxt": 0
},
"token": "RParen"
},
{
"type": "PreservedToken",
"span": {
"start": 875,
"end": 876,
"ctxt": 0
"name": {
"type": "PreservedToken",
"span": {
"start": 871,
"end": 872,
"ctxt": 0
},
"token": "LParen"
},
"token": {
"WhiteSpace": {
"value": " "
"value": [
{
"type": "SimpleBlock",
"span": {
"start": 872,
"end": 874,
"ctxt": 0
},
"name": {
"type": "PreservedToken",
"span": {
"start": 872,
"end": 873,
"ctxt": 0
},
"token": "LBracket"
},
"value": []
}
}
]
}
],
"important": {

View File

@ -2404,19 +2404,19 @@
x ComponentValue
,-[$DIR/tests/fixture/csstree/1/input.css:27:9]
27 | --custom1: { something !important };
: ^^^^^^^^^^^^
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
`----
x StyleBlock
,-[$DIR/tests/fixture/csstree/1/input.css:27:9]
27 | --custom1: { something !important };
: ^^^^^^^^^^^^
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
`----
x Declaration
,-[$DIR/tests/fixture/csstree/1/input.css:27:9]
27 | --custom1: { something !important };
: ^^^^^^^^^^^^
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
`----
x DeclarationName
@ -2434,7 +2434,13 @@
x ComponentValue
,-[$DIR/tests/fixture/csstree/1/input.css:27:9]
27 | --custom1: { something !important };
: ^
: ^^^^^^^^^^^^^^^^^^^^^^^^
`----
x SimpleBlock
,-[$DIR/tests/fixture/csstree/1/input.css:27:9]
27 | --custom1: { something !important };
: ^^^^^^^^^^^^^^^^^^^^^^^^
`----
x LBrace
@ -2515,18 +2521,6 @@
: ^
`----
x ComponentValue
,-[$DIR/tests/fixture/csstree/1/input.css:27:9]
27 | --custom1: { something !important };
: ^
`----
x RBrace
,-[$DIR/tests/fixture/csstree/1/input.css:27:9]
27 | --custom1: { something !important };
: ^
`----
x ComponentValue
,-[$DIR/tests/fixture/csstree/1/input.css:28:9]
28 | --custom2: ([]) !important;
@ -2560,7 +2554,13 @@
x ComponentValue
,-[$DIR/tests/fixture/csstree/1/input.css:28:9]
28 | --custom2: ([]) !important;
: ^
: ^^^^
`----
x SimpleBlock
,-[$DIR/tests/fixture/csstree/1/input.css:28:9]
28 | --custom2: ([]) !important;
: ^^^^
`----
x LParen
@ -2572,7 +2572,13 @@
x ComponentValue
,-[$DIR/tests/fixture/csstree/1/input.css:28:9]
28 | --custom2: ([]) !important;
: ^
: ^^
`----
x SimpleBlock
,-[$DIR/tests/fixture/csstree/1/input.css:28:9]
28 | --custom2: ([]) !important;
: ^^
`----
x LBracket
@ -2581,42 +2587,6 @@
: ^
`----
x ComponentValue
,-[$DIR/tests/fixture/csstree/1/input.css:28:9]
28 | --custom2: ([]) !important;
: ^
`----
x RBracket
,-[$DIR/tests/fixture/csstree/1/input.css:28:9]
28 | --custom2: ([]) !important;
: ^
`----
x ComponentValue
,-[$DIR/tests/fixture/csstree/1/input.css:28:9]
28 | --custom2: ([]) !important;
: ^
`----
x RParen
,-[$DIR/tests/fixture/csstree/1/input.css:28:9]
28 | --custom2: ([]) !important;
: ^
`----
x ComponentValue
,-[$DIR/tests/fixture/csstree/1/input.css:28:9]
28 | --custom2: ([]) !important;
: ^
`----
x WhiteSpace { value: Atom(' ' type=inline) }
,-[$DIR/tests/fixture/csstree/1/input.css:28:9]
28 | --custom2: ([]) !important;
: ^
`----
x ImportantFlag
,-[$DIR/tests/fixture/csstree/1/input.css:28:9]
28 | --custom2: ([]) !important;

View File

@ -277,7 +277,7 @@
"type": "Declaration",
"span": {
"start": 55,
"end": 69,
"end": 80,
"ctxt": 0
},
"name": {
@ -292,97 +292,94 @@
},
"value": [
{
"type": "PreservedToken",
"type": "Function",
"span": {
"start": 64,
"end": 69,
"ctxt": 0
},
"token": {
"Function": {
"value": "calc",
"raw": "calc"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 69,
"end": 72,
"ctxt": 0
},
"token": {
"Percentage": {
"value": 10.0,
"raw": "10"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 72,
"end": 73,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 73,
"end": 74,
"ctxt": 0
},
"token": {
"Delim": {
"value": "+"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 74,
"end": 75,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 75,
"end": 79,
"ctxt": 0
},
"token": {
"Dimension": {
"value": 30.0,
"raw_value": "30",
"unit": "px",
"raw_unit": "px",
"type": "integer"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 79,
"end": 80,
"ctxt": 0
},
"token": "RParen"
"name": {
"type": "Ident",
"span": {
"start": 64,
"end": 68,
"ctxt": 0
},
"value": "calc",
"raw": "calc"
},
"value": [
{
"type": "PreservedToken",
"span": {
"start": 69,
"end": 72,
"ctxt": 0
},
"token": {
"Percentage": {
"value": 10.0,
"raw": "10"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 72,
"end": 73,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 73,
"end": 74,
"ctxt": 0
},
"token": {
"Delim": {
"value": "+"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 74,
"end": 75,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 75,
"end": 79,
"ctxt": 0
},
"token": {
"Dimension": {
"value": 30.0,
"raw_value": "30",
"unit": "px",
"raw_unit": "px",
"type": "integer"
}
}
}
]
}
],
"important": null

View File

@ -497,19 +497,19 @@
x ComponentValue
,-[$DIR/tests/fixture/function/calc/input.css:6:5]
6 | --width: calc(10% + 30px);
: ^^^^^^^^^^^^^^
: ^^^^^^^^^^^^^^^^^^^^^^^^^
`----
x StyleBlock
,-[$DIR/tests/fixture/function/calc/input.css:6:5]
6 | --width: calc(10% + 30px);
: ^^^^^^^^^^^^^^
: ^^^^^^^^^^^^^^^^^^^^^^^^^
`----
x Declaration
,-[$DIR/tests/fixture/function/calc/input.css:6:5]
6 | --width: calc(10% + 30px);
: ^^^^^^^^^^^^^^
: ^^^^^^^^^^^^^^^^^^^^^^^^^
`----
x DeclarationName
@ -527,13 +527,19 @@
x ComponentValue
,-[$DIR/tests/fixture/function/calc/input.css:6:5]
6 | --width: calc(10% + 30px);
: ^^^^^
: ^^^^^^^^^^^^^^^^
`----
x Function { value: Atom('calc' type=static), raw: Atom('calc' type=static) }
x Function
,-[$DIR/tests/fixture/function/calc/input.css:6:5]
6 | --width: calc(10% + 30px);
: ^^^^^
: ^^^^^^^^^^^^^^^^
`----
x Ident
,-[$DIR/tests/fixture/function/calc/input.css:6:5]
6 | --width: calc(10% + 30px);
: ^^^^
`----
x ComponentValue
@ -596,18 +602,6 @@
: ^^^^
`----
x ComponentValue
,-[$DIR/tests/fixture/function/calc/input.css:6:5]
6 | --width: calc(10% + 30px);
: ^
`----
x RParen
,-[$DIR/tests/fixture/function/calc/input.css:6:5]
6 | --width: calc(10% + 30px);
: ^
`----
x ComponentValue
,-[$DIR/tests/fixture/function/calc/input.css:8:5]
8 | width: calc(0px);

View File

@ -372,7 +372,7 @@
"type": "Declaration",
"span": {
"start": 149,
"end": 165,
"end": 166,
"ctxt": 0
},
"name": {
@ -387,27 +387,23 @@
},
"value": [
{
"type": "PreservedToken",
"type": "Function",
"span": {
"start": 161,
"end": 165,
"ctxt": 0
},
"token": {
"Function": {
"value": "foo",
"raw": "foo"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 165,
"end": 166,
"ctxt": 0
},
"token": "RParen"
"name": {
"type": "Ident",
"span": {
"start": 161,
"end": 164,
"ctxt": 0
},
"value": "foo",
"raw": "foo"
},
"value": []
}
],
"important": null
@ -416,7 +412,7 @@
"type": "Declaration",
"span": {
"start": 169,
"end": 192,
"end": 198,
"ctxt": 0
},
"name": {
@ -431,50 +427,43 @@
},
"value": [
{
"type": "PreservedToken",
"type": "Function",
"span": {
"start": 188,
"end": 192,
"ctxt": 0
},
"token": {
"Function": {
"value": "foo",
"raw": "foo"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 192,
"end": 196,
"ctxt": 0
},
"token": {
"Function": {
"value": "bar",
"raw": "bar"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 196,
"end": 197,
"ctxt": 0
},
"token": "RParen"
},
{
"type": "PreservedToken",
"span": {
"start": 197,
"end": 198,
"ctxt": 0
},
"token": "RParen"
"name": {
"type": "Ident",
"span": {
"start": 188,
"end": 191,
"ctxt": 0
},
"value": "foo",
"raw": "foo"
},
"value": [
{
"type": "Function",
"span": {
"start": 192,
"end": 197,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 192,
"end": 195,
"ctxt": 0
},
"value": "bar",
"raw": "bar"
},
"value": []
}
]
}
],
"important": null
@ -483,7 +472,7 @@
"type": "Declaration",
"span": {
"start": 201,
"end": 217,
"end": 219,
"ctxt": 0
},
"name": {
@ -498,35 +487,36 @@
},
"value": [
{
"type": "PreservedToken",
"type": "SimpleBlock",
"span": {
"start": 216,
"end": 217,
"ctxt": 0
},
"token": "LParen"
},
{
"type": "PreservedToken",
"span": {
"start": 217,
"end": 218,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 218,
"end": 219,
"ctxt": 0
},
"token": "RParen"
"name": {
"type": "PreservedToken",
"span": {
"start": 216,
"end": 217,
"ctxt": 0
},
"token": "LParen"
},
"value": [
{
"type": "PreservedToken",
"span": {
"start": 217,
"end": 218,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
}
]
}
],
"important": null
@ -535,7 +525,7 @@
"type": "Declaration",
"span": {
"start": 222,
"end": 233,
"end": 235,
"ctxt": 0
},
"name": {
@ -550,35 +540,36 @@
},
"value": [
{
"type": "PreservedToken",
"type": "SimpleBlock",
"span": {
"start": 232,
"end": 233,
"ctxt": 0
},
"token": "LBrace"
},
{
"type": "PreservedToken",
"span": {
"start": 233,
"end": 234,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 234,
"end": 235,
"ctxt": 0
},
"token": "RBrace"
"name": {
"type": "PreservedToken",
"span": {
"start": 232,
"end": 233,
"ctxt": 0
},
"token": "LBrace"
},
"value": [
{
"type": "PreservedToken",
"span": {
"start": 233,
"end": 234,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
}
]
}
],
"important": null
@ -587,7 +578,7 @@
"type": "Declaration",
"span": {
"start": 238,
"end": 251,
"end": 253,
"ctxt": 0
},
"name": {
@ -602,35 +593,36 @@
},
"value": [
{
"type": "PreservedToken",
"type": "SimpleBlock",
"span": {
"start": 250,
"end": 251,
"ctxt": 0
},
"token": "LBracket"
},
{
"type": "PreservedToken",
"span": {
"start": 251,
"end": 252,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 252,
"end": 253,
"ctxt": 0
},
"token": "RBracket"
"name": {
"type": "PreservedToken",
"span": {
"start": 250,
"end": 251,
"ctxt": 0
},
"token": "LBracket"
},
"value": [
{
"type": "PreservedToken",
"span": {
"start": 251,
"end": 252,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
}
]
}
],
"important": null
@ -709,7 +701,7 @@
"type": "Declaration",
"span": {
"start": 317,
"end": 352,
"end": 355,
"ctxt": 0
},
"name": {
@ -751,22 +743,22 @@
}
},
{
"type": "PreservedToken",
"type": "SimpleBlock",
"span": {
"start": 353,
"end": 354,
"ctxt": 0
},
"token": "LBrace"
},
{
"type": "PreservedToken",
"span": {
"start": 354,
"end": 355,
"ctxt": 0
},
"token": "RBrace"
"name": {
"type": "PreservedToken",
"span": {
"start": 353,
"end": 354,
"ctxt": 0
},
"token": "LBrace"
},
"value": []
}
],
"important": null
@ -775,7 +767,7 @@
"type": "Declaration",
"span": {
"start": 358,
"end": 390,
"end": 393,
"ctxt": 0
},
"name": {
@ -817,22 +809,22 @@
}
},
{
"type": "PreservedToken",
"type": "SimpleBlock",
"span": {
"start": 391,
"end": 392,
"ctxt": 0
},
"token": "LBrace"
},
{
"type": "PreservedToken",
"span": {
"start": 392,
"end": 393,
"ctxt": 0
},
"token": "RBrace"
"name": {
"type": "PreservedToken",
"span": {
"start": 391,
"end": 392,
"ctxt": 0
},
"token": "LBrace"
},
"value": []
}
],
"important": null
@ -901,7 +893,7 @@
"type": "Declaration",
"span": {
"start": 449,
"end": 471,
"end": 476,
"ctxt": 0
},
"name": {
@ -916,31 +908,32 @@
},
"value": [
{
"type": "PreservedToken",
"type": "SimpleBlock",
"span": {
"start": 470,
"end": 471,
"ctxt": 0
},
"token": "LParen"
},
{
"type": "PreservedToken",
"span": {
"start": 471,
"end": 475,
"ctxt": 0
},
"token": "CDO"
},
{
"type": "PreservedToken",
"span": {
"start": 475,
"end": 476,
"ctxt": 0
},
"token": "RParen"
"name": {
"type": "PreservedToken",
"span": {
"start": 470,
"end": 471,
"ctxt": 0
},
"token": "LParen"
},
"value": [
{
"type": "PreservedToken",
"span": {
"start": 471,
"end": 475,
"ctxt": 0
},
"token": "CDO"
}
]
}
],
"important": null
@ -949,7 +942,7 @@
"type": "Declaration",
"span": {
"start": 479,
"end": 501,
"end": 505,
"ctxt": 0
},
"name": {
@ -964,31 +957,32 @@
},
"value": [
{
"type": "PreservedToken",
"type": "SimpleBlock",
"span": {
"start": 500,
"end": 501,
"ctxt": 0
},
"token": "LParen"
},
{
"type": "PreservedToken",
"span": {
"start": 501,
"end": 504,
"ctxt": 0
},
"token": "CDC"
},
{
"type": "PreservedToken",
"span": {
"start": 504,
"end": 505,
"ctxt": 0
},
"token": "RParen"
"name": {
"type": "PreservedToken",
"span": {
"start": 500,
"end": 501,
"ctxt": 0
},
"token": "LParen"
},
"value": [
{
"type": "PreservedToken",
"span": {
"start": 501,
"end": 504,
"ctxt": 0
},
"token": "CDC"
}
]
}
],
"important": null

View File

@ -488,19 +488,19 @@
x ComponentValue
,-[$DIR/tests/fixture/rome/custom-properties/input.css:10:5]
10 | --function: foo();
: ^^^^^^^^^^^^^^^^
: ^^^^^^^^^^^^^^^^^
`----
x StyleBlock
,-[$DIR/tests/fixture/rome/custom-properties/input.css:10:5]
10 | --function: foo();
: ^^^^^^^^^^^^^^^^
: ^^^^^^^^^^^^^^^^^
`----
x Declaration
,-[$DIR/tests/fixture/rome/custom-properties/input.css:10:5]
10 | --function: foo();
: ^^^^^^^^^^^^^^^^
: ^^^^^^^^^^^^^^^^^
`----
x DeclarationName
@ -518,43 +518,37 @@
x ComponentValue
,-[$DIR/tests/fixture/rome/custom-properties/input.css:10:5]
10 | --function: foo();
: ^^^^
: ^^^^^
`----
x Function { value: Atom('foo' type=inline), raw: Atom('foo' type=inline) }
x Function
,-[$DIR/tests/fixture/rome/custom-properties/input.css:10:5]
10 | --function: foo();
: ^^^^
: ^^^^^
`----
x ComponentValue
x Ident
,-[$DIR/tests/fixture/rome/custom-properties/input.css:10:5]
10 | --function: foo();
: ^
`----
x RParen
,-[$DIR/tests/fixture/rome/custom-properties/input.css:10:5]
10 | --function: foo();
: ^
: ^^^
`----
x ComponentValue
,-[$DIR/tests/fixture/rome/custom-properties/input.css:11:5]
11 | --nested-function: foo(bar());
: ^^^^^^^^^^^^^^^^^^^^^^^
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
`----
x StyleBlock
,-[$DIR/tests/fixture/rome/custom-properties/input.css:11:5]
11 | --nested-function: foo(bar());
: ^^^^^^^^^^^^^^^^^^^^^^^
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
`----
x Declaration
,-[$DIR/tests/fixture/rome/custom-properties/input.css:11:5]
11 | --nested-function: foo(bar());
: ^^^^^^^^^^^^^^^^^^^^^^^
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
`----
x DeclarationName
@ -572,67 +566,55 @@
x ComponentValue
,-[$DIR/tests/fixture/rome/custom-properties/input.css:11:5]
11 | --nested-function: foo(bar());
: ^^^^
: ^^^^^^^^^^
`----
x Function { value: Atom('foo' type=inline), raw: Atom('foo' type=inline) }
x Function
,-[$DIR/tests/fixture/rome/custom-properties/input.css:11:5]
11 | --nested-function: foo(bar());
: ^^^^
: ^^^^^^^^^^
`----
x Ident
,-[$DIR/tests/fixture/rome/custom-properties/input.css:11:5]
11 | --nested-function: foo(bar());
: ^^^
`----
x ComponentValue
,-[$DIR/tests/fixture/rome/custom-properties/input.css:11:5]
11 | --nested-function: foo(bar());
: ^^^^
: ^^^^^
`----
x Function { value: Atom('bar' type=inline), raw: Atom('bar' type=inline) }
x Function
,-[$DIR/tests/fixture/rome/custom-properties/input.css:11:5]
11 | --nested-function: foo(bar());
: ^^^^
: ^^^^^
`----
x ComponentValue
x Ident
,-[$DIR/tests/fixture/rome/custom-properties/input.css:11:5]
11 | --nested-function: foo(bar());
: ^
`----
x RParen
,-[$DIR/tests/fixture/rome/custom-properties/input.css:11:5]
11 | --nested-function: foo(bar());
: ^
`----
x ComponentValue
,-[$DIR/tests/fixture/rome/custom-properties/input.css:11:5]
11 | --nested-function: foo(bar());
: ^
`----
x RParen
,-[$DIR/tests/fixture/rome/custom-properties/input.css:11:5]
11 | --nested-function: foo(bar());
: ^
: ^^^
`----
x ComponentValue
,-[$DIR/tests/fixture/rome/custom-properties/input.css:12:5]
12 | --parentheses: ( );
: ^^^^^^^^^^^^^^^^
: ^^^^^^^^^^^^^^^^^^
`----
x StyleBlock
,-[$DIR/tests/fixture/rome/custom-properties/input.css:12:5]
12 | --parentheses: ( );
: ^^^^^^^^^^^^^^^^
: ^^^^^^^^^^^^^^^^^^
`----
x Declaration
,-[$DIR/tests/fixture/rome/custom-properties/input.css:12:5]
12 | --parentheses: ( );
: ^^^^^^^^^^^^^^^^
: ^^^^^^^^^^^^^^^^^^
`----
x DeclarationName
@ -650,7 +632,13 @@
x ComponentValue
,-[$DIR/tests/fixture/rome/custom-properties/input.css:12:5]
12 | --parentheses: ( );
: ^
: ^^^
`----
x SimpleBlock
,-[$DIR/tests/fixture/rome/custom-properties/input.css:12:5]
12 | --parentheses: ( );
: ^^^
`----
x LParen
@ -671,34 +659,22 @@
: ^
`----
x ComponentValue
,-[$DIR/tests/fixture/rome/custom-properties/input.css:12:5]
12 | --parentheses: ( );
: ^
`----
x RParen
,-[$DIR/tests/fixture/rome/custom-properties/input.css:12:5]
12 | --parentheses: ( );
: ^
`----
x ComponentValue
,-[$DIR/tests/fixture/rome/custom-properties/input.css:13:5]
13 | --braces: { };
: ^^^^^^^^^^^
: ^^^^^^^^^^^^^
`----
x StyleBlock
,-[$DIR/tests/fixture/rome/custom-properties/input.css:13:5]
13 | --braces: { };
: ^^^^^^^^^^^
: ^^^^^^^^^^^^^
`----
x Declaration
,-[$DIR/tests/fixture/rome/custom-properties/input.css:13:5]
13 | --braces: { };
: ^^^^^^^^^^^
: ^^^^^^^^^^^^^
`----
x DeclarationName
@ -716,7 +692,13 @@
x ComponentValue
,-[$DIR/tests/fixture/rome/custom-properties/input.css:13:5]
13 | --braces: { };
: ^
: ^^^
`----
x SimpleBlock
,-[$DIR/tests/fixture/rome/custom-properties/input.css:13:5]
13 | --braces: { };
: ^^^
`----
x LBrace
@ -737,34 +719,22 @@
: ^
`----
x ComponentValue
,-[$DIR/tests/fixture/rome/custom-properties/input.css:13:5]
13 | --braces: { };
: ^
`----
x RBrace
,-[$DIR/tests/fixture/rome/custom-properties/input.css:13:5]
13 | --braces: { };
: ^
`----
x ComponentValue
,-[$DIR/tests/fixture/rome/custom-properties/input.css:14:5]
14 | --brackets: [ ];
: ^^^^^^^^^^^^^
: ^^^^^^^^^^^^^^^
`----
x StyleBlock
,-[$DIR/tests/fixture/rome/custom-properties/input.css:14:5]
14 | --brackets: [ ];
: ^^^^^^^^^^^^^
: ^^^^^^^^^^^^^^^
`----
x Declaration
,-[$DIR/tests/fixture/rome/custom-properties/input.css:14:5]
14 | --brackets: [ ];
: ^^^^^^^^^^^^^
: ^^^^^^^^^^^^^^^
`----
x DeclarationName
@ -782,7 +752,13 @@
x ComponentValue
,-[$DIR/tests/fixture/rome/custom-properties/input.css:14:5]
14 | --brackets: [ ];
: ^
: ^^^
`----
x SimpleBlock
,-[$DIR/tests/fixture/rome/custom-properties/input.css:14:5]
14 | --brackets: [ ];
: ^^^
`----
x LBracket
@ -803,18 +779,6 @@
: ^
`----
x ComponentValue
,-[$DIR/tests/fixture/rome/custom-properties/input.css:14:5]
14 | --brackets: [ ];
: ^
`----
x RBracket
,-[$DIR/tests/fixture/rome/custom-properties/input.css:14:5]
14 | --brackets: [ ];
: ^
`----
x ComponentValue
,-[$DIR/tests/fixture/rome/custom-properties/input.css:15:5]
15 | --at-keyword-unknown: @foobar;
@ -902,19 +866,19 @@
x ComponentValue
,-[$DIR/tests/fixture/rome/custom-properties/input.css:17:5]
17 | --at-keyword-unknown-block: @foobar {};
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
`----
x StyleBlock
,-[$DIR/tests/fixture/rome/custom-properties/input.css:17:5]
17 | --at-keyword-unknown-block: @foobar {};
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
`----
x Declaration
,-[$DIR/tests/fixture/rome/custom-properties/input.css:17:5]
17 | --at-keyword-unknown-block: @foobar {};
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
`----
x DeclarationName
@ -956,7 +920,13 @@
x ComponentValue
,-[$DIR/tests/fixture/rome/custom-properties/input.css:17:5]
17 | --at-keyword-unknown-block: @foobar {};
: ^
: ^^
`----
x SimpleBlock
,-[$DIR/tests/fixture/rome/custom-properties/input.css:17:5]
17 | --at-keyword-unknown-block: @foobar {};
: ^^
`----
x LBrace
@ -965,34 +935,22 @@
: ^
`----
x ComponentValue
,-[$DIR/tests/fixture/rome/custom-properties/input.css:17:5]
17 | --at-keyword-unknown-block: @foobar {};
: ^
`----
x RBrace
,-[$DIR/tests/fixture/rome/custom-properties/input.css:17:5]
17 | --at-keyword-unknown-block: @foobar {};
: ^
`----
x ComponentValue
,-[$DIR/tests/fixture/rome/custom-properties/input.css:18:5]
18 | --at-keyword-known-block: @media {};
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
`----
x StyleBlock
,-[$DIR/tests/fixture/rome/custom-properties/input.css:18:5]
18 | --at-keyword-known-block: @media {};
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
`----
x Declaration
,-[$DIR/tests/fixture/rome/custom-properties/input.css:18:5]
18 | --at-keyword-known-block: @media {};
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
`----
x DeclarationName
@ -1034,7 +992,13 @@
x ComponentValue
,-[$DIR/tests/fixture/rome/custom-properties/input.css:18:5]
18 | --at-keyword-known-block: @media {};
: ^
: ^^
`----
x SimpleBlock
,-[$DIR/tests/fixture/rome/custom-properties/input.css:18:5]
18 | --at-keyword-known-block: @media {};
: ^^
`----
x LBrace
@ -1043,18 +1007,6 @@
: ^
`----
x ComponentValue
,-[$DIR/tests/fixture/rome/custom-properties/input.css:18:5]
18 | --at-keyword-known-block: @media {};
: ^
`----
x RBrace
,-[$DIR/tests/fixture/rome/custom-properties/input.css:18:5]
18 | --at-keyword-known-block: @media {};
: ^
`----
x ComponentValue
,-[$DIR/tests/fixture/rome/custom-properties/input.css:19:5]
19 | --cdo-at-top-level: <!--;
@ -1142,19 +1094,19 @@
x ComponentValue
,-[$DIR/tests/fixture/rome/custom-properties/input.css:21:5]
21 | --cdo-not-top-level: (<!--);
: ^^^^^^^^^^^^^^^^^^^^^^
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^
`----
x StyleBlock
,-[$DIR/tests/fixture/rome/custom-properties/input.css:21:5]
21 | --cdo-not-top-level: (<!--);
: ^^^^^^^^^^^^^^^^^^^^^^
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^
`----
x Declaration
,-[$DIR/tests/fixture/rome/custom-properties/input.css:21:5]
21 | --cdo-not-top-level: (<!--);
: ^^^^^^^^^^^^^^^^^^^^^^
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^
`----
x DeclarationName
@ -1172,7 +1124,13 @@
x ComponentValue
,-[$DIR/tests/fixture/rome/custom-properties/input.css:21:5]
21 | --cdo-not-top-level: (<!--);
: ^
: ^^^^^^
`----
x SimpleBlock
,-[$DIR/tests/fixture/rome/custom-properties/input.css:21:5]
21 | --cdo-not-top-level: (<!--);
: ^^^^^^
`----
x LParen
@ -1193,34 +1151,22 @@
: ^^^^
`----
x ComponentValue
,-[$DIR/tests/fixture/rome/custom-properties/input.css:21:5]
21 | --cdo-not-top-level: (<!--);
: ^
`----
x RParen
,-[$DIR/tests/fixture/rome/custom-properties/input.css:21:5]
21 | --cdo-not-top-level: (<!--);
: ^
`----
x ComponentValue
,-[$DIR/tests/fixture/rome/custom-properties/input.css:22:5]
22 | --cdc-not-top-level: (-->);
: ^^^^^^^^^^^^^^^^^^^^^^
: ^^^^^^^^^^^^^^^^^^^^^^^^^^
`----
x StyleBlock
,-[$DIR/tests/fixture/rome/custom-properties/input.css:22:5]
22 | --cdc-not-top-level: (-->);
: ^^^^^^^^^^^^^^^^^^^^^^
: ^^^^^^^^^^^^^^^^^^^^^^^^^^
`----
x Declaration
,-[$DIR/tests/fixture/rome/custom-properties/input.css:22:5]
22 | --cdc-not-top-level: (-->);
: ^^^^^^^^^^^^^^^^^^^^^^
: ^^^^^^^^^^^^^^^^^^^^^^^^^^
`----
x DeclarationName
@ -1238,7 +1184,13 @@
x ComponentValue
,-[$DIR/tests/fixture/rome/custom-properties/input.css:22:5]
22 | --cdc-not-top-level: (-->);
: ^
: ^^^^^
`----
x SimpleBlock
,-[$DIR/tests/fixture/rome/custom-properties/input.css:22:5]
22 | --cdc-not-top-level: (-->);
: ^^^^^
`----
x LParen
@ -1258,15 +1210,3 @@
22 | --cdc-not-top-level: (-->);
: ^^^
`----
x ComponentValue
,-[$DIR/tests/fixture/rome/custom-properties/input.css:22:5]
22 | --cdc-not-top-level: (-->);
: ^
`----
x RParen
,-[$DIR/tests/fixture/rome/custom-properties/input.css:22:5]
22 | --cdc-not-top-level: (-->);
: ^
`----

View File

@ -4037,7 +4037,7 @@
"type": "Declaration",
"span": {
"start": 1312,
"end": 1326,
"end": 1369,
"ctxt": 0
},
"name": {
@ -4052,181 +4052,182 @@
},
"value": [
{
"type": "PreservedToken",
"type": "SimpleBlock",
"span": {
"start": 1325,
"end": 1326,
"ctxt": 0
},
"token": "LBrace"
},
{
"type": "PreservedToken",
"span": {
"start": 1326,
"end": 1335,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": "\n "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 1335,
"end": 1340,
"ctxt": 0
},
"token": {
"Ident": {
"value": "width",
"raw": "width"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 1340,
"end": 1341,
"ctxt": 0
},
"token": "Colon"
},
{
"type": "PreservedToken",
"span": {
"start": 1341,
"end": 1342,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 1342,
"end": 1343,
"ctxt": 0
},
"token": {
"Number": {
"value": 0.0,
"raw": "0",
"type": "integer"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 1343,
"end": 1344,
"ctxt": 0
},
"token": "Semi"
},
{
"type": "PreservedToken",
"span": {
"start": 1344,
"end": 1353,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": "\n "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 1353,
"end": 1359,
"ctxt": 0
},
"token": {
"Ident": {
"value": "height",
"raw": "height"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 1359,
"end": 1360,
"ctxt": 0
},
"token": "Colon"
},
{
"type": "PreservedToken",
"span": {
"start": 1360,
"end": 1361,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 1361,
"end": 1362,
"ctxt": 0
},
"token": {
"Number": {
"value": 0.0,
"raw": "0",
"type": "integer"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 1362,
"end": 1363,
"ctxt": 0
},
"token": "Semi"
},
{
"type": "PreservedToken",
"span": {
"start": 1363,
"end": 1368,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": "\n "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 1368,
"end": 1369,
"ctxt": 0
},
"token": "RBrace"
"name": {
"type": "PreservedToken",
"span": {
"start": 1325,
"end": 1326,
"ctxt": 0
},
"token": "LBrace"
},
"value": [
{
"type": "PreservedToken",
"span": {
"start": 1326,
"end": 1335,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": "\n "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 1335,
"end": 1340,
"ctxt": 0
},
"token": {
"Ident": {
"value": "width",
"raw": "width"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 1340,
"end": 1341,
"ctxt": 0
},
"token": "Colon"
},
{
"type": "PreservedToken",
"span": {
"start": 1341,
"end": 1342,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 1342,
"end": 1343,
"ctxt": 0
},
"token": {
"Number": {
"value": 0.0,
"raw": "0",
"type": "integer"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 1343,
"end": 1344,
"ctxt": 0
},
"token": "Semi"
},
{
"type": "PreservedToken",
"span": {
"start": 1344,
"end": 1353,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": "\n "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 1353,
"end": 1359,
"ctxt": 0
},
"token": {
"Ident": {
"value": "height",
"raw": "height"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 1359,
"end": 1360,
"ctxt": 0
},
"token": "Colon"
},
{
"type": "PreservedToken",
"span": {
"start": 1360,
"end": 1361,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 1361,
"end": 1362,
"ctxt": 0
},
"token": {
"Number": {
"value": 0.0,
"raw": "0",
"type": "integer"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 1362,
"end": 1363,
"ctxt": 0
},
"token": "Semi"
},
{
"type": "PreservedToken",
"span": {
"start": 1363,
"end": 1368,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": "\n "
}
}
}
]
}
],
"important": null
@ -4235,7 +4236,7 @@
"type": "Declaration",
"span": {
"start": 1375,
"end": 1390,
"end": 1439,
"ctxt": 0
},
"name": {
@ -4250,198 +4251,186 @@
},
"value": [
{
"type": "PreservedToken",
"type": "SimpleBlock",
"span": {
"start": 1389,
"end": 1390,
"ctxt": 0
},
"token": "LBrace"
},
{
"type": "PreservedToken",
"span": {
"start": 1390,
"end": 1399,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": "\n "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 1399,
"end": 1404,
"ctxt": 0
},
"token": {
"Ident": {
"value": "width",
"raw": "width"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 1404,
"end": 1405,
"ctxt": 0
},
"token": "Colon"
},
{
"type": "PreservedToken",
"span": {
"start": 1405,
"end": 1406,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 1406,
"end": 1410,
"ctxt": 0
},
"token": {
"Dimension": {
"value": 16.0,
"raw_value": "16",
"unit": "px",
"raw_unit": "px",
"type": "integer"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 1410,
"end": 1411,
"ctxt": 0
},
"token": "Semi"
},
{
"type": "PreservedToken",
"span": {
"start": 1411,
"end": 1420,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": "\n "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 1420,
"end": 1426,
"ctxt": 0
},
"token": {
"Ident": {
"value": "height",
"raw": "height"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 1426,
"end": 1427,
"ctxt": 0
},
"token": "Colon"
},
{
"type": "PreservedToken",
"span": {
"start": 1427,
"end": 1428,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 1428,
"end": 1432,
"ctxt": 0
},
"token": {
"Dimension": {
"value": 16.0,
"raw_value": "16",
"unit": "px",
"raw_unit": "px",
"type": "integer"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 1432,
"end": 1433,
"ctxt": 0
},
"token": "Semi"
},
{
"type": "PreservedToken",
"span": {
"start": 1433,
"end": 1438,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": "\n "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 1438,
"end": 1439,
"ctxt": 0
},
"token": "RBrace"
},
{
"type": "PreservedToken",
"span": {
"start": 1439,
"end": 1440,
"ctxt": 0
"name": {
"type": "PreservedToken",
"span": {
"start": 1389,
"end": 1390,
"ctxt": 0
},
"token": "LBrace"
},
"token": {
"WhiteSpace": {
"value": "\n"
"value": [
{
"type": "PreservedToken",
"span": {
"start": 1390,
"end": 1399,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": "\n "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 1399,
"end": 1404,
"ctxt": 0
},
"token": {
"Ident": {
"value": "width",
"raw": "width"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 1404,
"end": 1405,
"ctxt": 0
},
"token": "Colon"
},
{
"type": "PreservedToken",
"span": {
"start": 1405,
"end": 1406,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 1406,
"end": 1410,
"ctxt": 0
},
"token": {
"Dimension": {
"value": 16.0,
"raw_value": "16",
"unit": "px",
"raw_unit": "px",
"type": "integer"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 1410,
"end": 1411,
"ctxt": 0
},
"token": "Semi"
},
{
"type": "PreservedToken",
"span": {
"start": 1411,
"end": 1420,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": "\n "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 1420,
"end": 1426,
"ctxt": 0
},
"token": {
"Ident": {
"value": "height",
"raw": "height"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 1426,
"end": 1427,
"ctxt": 0
},
"token": "Colon"
},
{
"type": "PreservedToken",
"span": {
"start": 1427,
"end": 1428,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 1428,
"end": 1432,
"ctxt": 0
},
"token": {
"Dimension": {
"value": 16.0,
"raw_value": "16",
"unit": "px",
"raw_unit": "px",
"type": "integer"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 1432,
"end": 1433,
"ctxt": 0
},
"token": "Semi"
},
{
"type": "PreservedToken",
"span": {
"start": 1433,
"end": 1438,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": "\n "
}
}
}
}
]
}
],
"important": null

View File

@ -4346,20 +4346,26 @@
x ComponentValue
,-[$DIR/tests/fixture/style-block/input.css:106:5]
106 | --zero-size: {
: ^^^^^^^^^^^^^^
106 | ,-> --zero-size: {
107 | | width: 0;
108 | | height: 0;
109 | `-> };
`----
x StyleBlock
,-[$DIR/tests/fixture/style-block/input.css:106:5]
106 | --zero-size: {
: ^^^^^^^^^^^^^^
106 | ,-> --zero-size: {
107 | | width: 0;
108 | | height: 0;
109 | `-> };
`----
x Declaration
,-[$DIR/tests/fixture/style-block/input.css:106:5]
106 | --zero-size: {
: ^^^^^^^^^^^^^^
106 | ,-> --zero-size: {
107 | | width: 0;
108 | | height: 0;
109 | `-> };
`----
x DeclarationName
@ -4376,8 +4382,18 @@
x ComponentValue
,-[$DIR/tests/fixture/style-block/input.css:106:5]
106 | --zero-size: {
: ^
106 | ,-> --zero-size: {
107 | | width: 0;
108 | | height: 0;
109 | `-> };
`----
x SimpleBlock
,-[$DIR/tests/fixture/style-block/input.css:106:5]
106 | ,-> --zero-size: {
107 | | width: 0;
108 | | height: 0;
109 | `-> };
`----
x LBrace
@ -4545,34 +4561,28 @@
109 | `-> };
`----
x ComponentValue
,-[$DIR/tests/fixture/style-block/input.css:109:5]
109 | };
: ^
`----
x RBrace
,-[$DIR/tests/fixture/style-block/input.css:109:5]
109 | };
: ^
`----
x ComponentValue
,-[$DIR/tests/fixture/style-block/input.css:110:5]
110 | --small-icon: {
: ^^^^^^^^^^^^^^^
110 | ,-> --small-icon: {
111 | | width: 16px;
112 | | height: 16px;
113 | `-> }
`----
x StyleBlock
,-[$DIR/tests/fixture/style-block/input.css:110:5]
110 | --small-icon: {
: ^^^^^^^^^^^^^^^
110 | ,-> --small-icon: {
111 | | width: 16px;
112 | | height: 16px;
113 | `-> }
`----
x Declaration
,-[$DIR/tests/fixture/style-block/input.css:110:5]
110 | --small-icon: {
: ^^^^^^^^^^^^^^^
110 | ,-> --small-icon: {
111 | | width: 16px;
112 | | height: 16px;
113 | `-> }
`----
x DeclarationName
@ -4589,8 +4599,18 @@
x ComponentValue
,-[$DIR/tests/fixture/style-block/input.css:110:5]
110 | --small-icon: {
: ^
110 | ,-> --small-icon: {
111 | | width: 16px;
112 | | height: 16px;
113 | `-> }
`----
x SimpleBlock
,-[$DIR/tests/fixture/style-block/input.css:110:5]
110 | ,-> --small-icon: {
111 | | width: 16px;
112 | | height: 16px;
113 | `-> }
`----
x LBrace
@ -4757,30 +4777,3 @@
112 | ,-> height: 16px;
113 | `-> }
`----
x ComponentValue
,-[$DIR/tests/fixture/style-block/input.css:113:5]
113 | }
: ^
`----
x RBrace
,-[$DIR/tests/fixture/style-block/input.css:113:5]
113 | }
: ^
`----
x ComponentValue
,-[$DIR/tests/fixture/style-block/input.css:113:5]
113 | }
: ^
114 | ;
`----
x WhiteSpace { value: Atom('
| ' type=inline) }
,-[$DIR/tests/fixture/style-block/input.css:113:5]
113 | }
: ^
114 | ;
`----

View File

@ -24,26 +24,13 @@
"raw": "document"
},
"prelude": {
"type": "ListOfComponentValues",
"type": "DocumentPrelude",
"span": {
"start": 10,
"start": 11,
"end": 43,
"ctxt": 0
},
"children": [
{
"type": "PreservedToken",
"span": {
"start": 10,
"end": 11,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
"matchingFunctions": [
{
"type": "Function",
"span": {
@ -193,19 +180,6 @@
}
}
]
},
{
"type": "PreservedToken",
"span": {
"start": 42,
"end": 43,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
}
]
},

View File

@ -4,9 +4,3 @@
1 | @document domain(http://www.example.com/) {}
: ^
`----
x Expected Declaration value
,-[$DIR/tests/recovery/at-rule/document/input.css:1:1]
1 | @document domain(http://www.example.com/) {}
: ^
`----

View File

@ -29,24 +29,6 @@
: ^^^^^^^^
`----
x ComponentValue
,-[$DIR/tests/recovery/at-rule/document/input.css:1:1]
1 | @document domain(http://www.example.com/) {}
: ^
`----
x WhiteSpace { value: Atom(' ' type=inline) }
,-[$DIR/tests/recovery/at-rule/document/input.css:1:1]
1 | @document domain(http://www.example.com/) {}
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/at-rule/document/input.css:1:1]
1 | @document domain(http://www.example.com/) {}
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
`----
x Function
,-[$DIR/tests/recovery/at-rule/document/input.css:1:1]
1 | @document domain(http://www.example.com/) {}
@ -179,18 +161,6 @@
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/at-rule/document/input.css:1:1]
1 | @document domain(http://www.example.com/) {}
: ^
`----
x WhiteSpace { value: Atom(' ' type=inline) }
,-[$DIR/tests/recovery/at-rule/document/input.css:1:1]
1 | @document domain(http://www.example.com/) {}
: ^
`----
x SimpleBlock
,-[$DIR/tests/recovery/at-rule/document/input.css:1:1]
1 | @document domain(http://www.example.com/) {}

View File

@ -1,6 +1,7 @@
x Unexpected end of file
,-[$DIR/tests/recovery/at-rule/media/invalid-nesting/input.css:3:1]
x Unexpected end of file, but expected '{'
,-[$DIR/tests/recovery/at-rule/media/invalid-nesting/input.css:2:5]
2 | max-inline-size: 1024px;
: ^^^^^^^^^^^^^^^^^^^^^^^^^
3 | }
: ^
`----

View File

@ -1,5 +1,5 @@
x Unexpected end of file, but expected semicolon or curly block
x Unexpected end of file, but expected ';' or '{'
,-[$DIR/tests/recovery/at-rule/no-end/input.css:1:1]
1 | @unknown
: ^^^^^^^^

View File

@ -1,12 +1,12 @@
x Unexpected end of file, but expected semicolon or curly block
x Unexpected end of file, but expected ';' or '{'
,-[$DIR/tests/recovery/at-rule/no-semi/input.css:1:1]
1 | @media screen {@content}
: ^^^^^^^^
`----
x Unexpected end of file, but expected semicolon or curly block
x Unexpected end of file, but expected ';' or '{'
,-[$DIR/tests/recovery/at-rule/no-semi/input.css:3:1]
3 | @charset "UTF-8"
: ^^^^^^^^
: ^^^^^^^^^^^^^^^^^
`----

View File

@ -88,49 +88,23 @@
},
"value": [
{
"type": "ListOfComponentValues",
"type": "Declaration",
"span": {
"start": 11,
"end": 39,
"end": 38,
"ctxt": 0
},
"children": [
{
"type": "PreservedToken",
"span": {
"start": 11,
"end": 21,
"ctxt": 0
},
"token": {
"Ident": {
"value": "background",
"raw": "background"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 21,
"end": 22,
"ctxt": 0
},
"token": "Colon"
},
{
"type": "PreservedToken",
"span": {
"start": 22,
"end": 23,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
"name": {
"type": "Ident",
"span": {
"start": 11,
"end": 21,
"ctxt": 0
},
"value": "background",
"raw": "background"
},
"value": [
{
"type": "PreservedToken",
"span": {
@ -146,17 +120,9 @@
"raw_value": "image\".png"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 38,
"end": 39,
"ctxt": 0
},
"token": "Semi"
}
]
],
"important": null
},
{
"type": "Declaration",

View File

@ -10,9 +10,3 @@
2 | background: url(image".png);
: ^
`----
x Unexpected token in <declaration-value>
,-[$DIR/tests/recovery/bad-url-token/double-quotes/input.css:2:5]
2 | background: url(image".png);
: ^^^^^^^^^^^^^^^
`----

View File

@ -82,51 +82,33 @@
x ComponentValue
,-[$DIR/tests/recovery/bad-url-token/double-quotes/input.css:2:5]
2 | background: url(image".png);
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^
`----
x StyleBlock
,-[$DIR/tests/recovery/bad-url-token/double-quotes/input.css:2:5]
2 | background: url(image".png);
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^
`----
x ComponentValue
x Declaration
,-[$DIR/tests/recovery/bad-url-token/double-quotes/input.css:2:5]
2 | background: url(image".png);
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^
`----
x DeclarationName
,-[$DIR/tests/recovery/bad-url-token/double-quotes/input.css:2:5]
2 | background: url(image".png);
: ^^^^^^^^^^
`----
x Ident { value: Atom('background' type=dynamic), raw: Atom('background' type=dynamic) }
x Ident
,-[$DIR/tests/recovery/bad-url-token/double-quotes/input.css:2:5]
2 | background: url(image".png);
: ^^^^^^^^^^
`----
x ComponentValue
,-[$DIR/tests/recovery/bad-url-token/double-quotes/input.css:2:5]
2 | background: url(image".png);
: ^
`----
x Colon
,-[$DIR/tests/recovery/bad-url-token/double-quotes/input.css:2:5]
2 | background: url(image".png);
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/bad-url-token/double-quotes/input.css:2:5]
2 | background: url(image".png);
: ^
`----
x WhiteSpace { value: Atom(' ' type=inline) }
,-[$DIR/tests/recovery/bad-url-token/double-quotes/input.css:2:5]
2 | background: url(image".png);
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/bad-url-token/double-quotes/input.css:2:5]
2 | background: url(image".png);
@ -139,18 +121,6 @@
: ^^^^^^^^^^^^^^^
`----
x ComponentValue
,-[$DIR/tests/recovery/bad-url-token/double-quotes/input.css:2:5]
2 | background: url(image".png);
: ^
`----
x Semi
,-[$DIR/tests/recovery/bad-url-token/double-quotes/input.css:2:5]
2 | background: url(image".png);
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/bad-url-token/double-quotes/input.css:3:5]
3 | color: red;

View File

@ -88,49 +88,23 @@
},
"value": [
{
"type": "ListOfComponentValues",
"type": "Declaration",
"span": {
"start": 11,
"end": 44,
"end": 43,
"ctxt": 0
},
"children": [
{
"type": "PreservedToken",
"span": {
"start": 11,
"end": 21,
"ctxt": 0
},
"token": {
"Ident": {
"value": "background",
"raw": "background"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 21,
"end": 22,
"ctxt": 0
},
"token": "Colon"
},
{
"type": "PreservedToken",
"span": {
"start": 22,
"end": 23,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
"name": {
"type": "Ident",
"span": {
"start": 11,
"end": 21,
"ctxt": 0
},
"value": "background",
"raw": "background"
},
"value": [
{
"type": "PreservedToken",
"span": {
@ -146,17 +120,9 @@
"raw_value": "image.png\\\n "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 43,
"end": 44,
"ctxt": 0
},
"token": "Semi"
}
]
],
"important": null
}
]
}

View File

@ -10,9 +10,3 @@
2 | ,-> background: url(image.png\
3 | `-> );
`----
x Unexpected token in <declaration-value>
,-[$DIR/tests/recovery/bad-url-token/invalid-escape/input.css:2:5]
2 | ,-> background: url(image.png\
3 | `-> );
`----

View File

@ -91,42 +91,24 @@
3 | `-> );
`----
x ComponentValue
x Declaration
,-[$DIR/tests/recovery/bad-url-token/invalid-escape/input.css:2:5]
2 | ,-> background: url(image.png\
3 | `-> );
`----
x DeclarationName
,-[$DIR/tests/recovery/bad-url-token/invalid-escape/input.css:2:5]
2 | background: url(image.png\
: ^^^^^^^^^^
`----
x Ident { value: Atom('background' type=dynamic), raw: Atom('background' type=dynamic) }
x Ident
,-[$DIR/tests/recovery/bad-url-token/invalid-escape/input.css:2:5]
2 | background: url(image.png\
: ^^^^^^^^^^
`----
x ComponentValue
,-[$DIR/tests/recovery/bad-url-token/invalid-escape/input.css:2:5]
2 | background: url(image.png\
: ^
`----
x Colon
,-[$DIR/tests/recovery/bad-url-token/invalid-escape/input.css:2:5]
2 | background: url(image.png\
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/bad-url-token/invalid-escape/input.css:2:5]
2 | background: url(image.png\
: ^
`----
x WhiteSpace { value: Atom(' ' type=inline) }
,-[$DIR/tests/recovery/bad-url-token/invalid-escape/input.css:2:5]
2 | background: url(image.png\
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/bad-url-token/invalid-escape/input.css:2:5]
2 | ,-> background: url(image.png\
@ -140,15 +122,3 @@
2 | ,-> background: url(image.png\
3 | `-> );
`----
x ComponentValue
,-[$DIR/tests/recovery/bad-url-token/invalid-escape/input.css:3:5]
3 | );
: ^
`----
x Semi
,-[$DIR/tests/recovery/bad-url-token/invalid-escape/input.css:3:5]
3 | );
: ^
`----

View File

@ -88,49 +88,23 @@
},
"value": [
{
"type": "ListOfComponentValues",
"type": "Declaration",
"span": {
"start": 11,
"end": 39,
"end": 38,
"ctxt": 0
},
"children": [
{
"type": "PreservedToken",
"span": {
"start": 11,
"end": 21,
"ctxt": 0
},
"token": {
"Ident": {
"value": "background",
"raw": "background"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 21,
"end": 22,
"ctxt": 0
},
"token": "Colon"
},
{
"type": "PreservedToken",
"span": {
"start": 22,
"end": 23,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
"name": {
"type": "Ident",
"span": {
"start": 11,
"end": 21,
"ctxt": 0
},
"value": "background",
"raw": "background"
},
"value": [
{
"type": "PreservedToken",
"span": {
@ -146,17 +120,9 @@
"raw_value": "image(.png"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 38,
"end": 39,
"ctxt": 0
},
"token": "Semi"
}
]
],
"important": null
},
{
"type": "Declaration",

View File

@ -10,9 +10,3 @@
2 | background: url(image(.png);
: ^
`----
x Unexpected token in <declaration-value>
,-[$DIR/tests/recovery/bad-url-token/left-parenthesis/input.css:2:5]
2 | background: url(image(.png);
: ^^^^^^^^^^^^^^^
`----

View File

@ -82,51 +82,33 @@
x ComponentValue
,-[$DIR/tests/recovery/bad-url-token/left-parenthesis/input.css:2:5]
2 | background: url(image(.png);
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^
`----
x StyleBlock
,-[$DIR/tests/recovery/bad-url-token/left-parenthesis/input.css:2:5]
2 | background: url(image(.png);
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^
`----
x ComponentValue
x Declaration
,-[$DIR/tests/recovery/bad-url-token/left-parenthesis/input.css:2:5]
2 | background: url(image(.png);
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^
`----
x DeclarationName
,-[$DIR/tests/recovery/bad-url-token/left-parenthesis/input.css:2:5]
2 | background: url(image(.png);
: ^^^^^^^^^^
`----
x Ident { value: Atom('background' type=dynamic), raw: Atom('background' type=dynamic) }
x Ident
,-[$DIR/tests/recovery/bad-url-token/left-parenthesis/input.css:2:5]
2 | background: url(image(.png);
: ^^^^^^^^^^
`----
x ComponentValue
,-[$DIR/tests/recovery/bad-url-token/left-parenthesis/input.css:2:5]
2 | background: url(image(.png);
: ^
`----
x Colon
,-[$DIR/tests/recovery/bad-url-token/left-parenthesis/input.css:2:5]
2 | background: url(image(.png);
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/bad-url-token/left-parenthesis/input.css:2:5]
2 | background: url(image(.png);
: ^
`----
x WhiteSpace { value: Atom(' ' type=inline) }
,-[$DIR/tests/recovery/bad-url-token/left-parenthesis/input.css:2:5]
2 | background: url(image(.png);
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/bad-url-token/left-parenthesis/input.css:2:5]
2 | background: url(image(.png);
@ -139,18 +121,6 @@
: ^^^^^^^^^^^^^^^
`----
x ComponentValue
,-[$DIR/tests/recovery/bad-url-token/left-parenthesis/input.css:2:5]
2 | background: url(image(.png);
: ^
`----
x Semi
,-[$DIR/tests/recovery/bad-url-token/left-parenthesis/input.css:2:5]
2 | background: url(image(.png);
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/bad-url-token/left-parenthesis/input.css:3:5]
3 | color: red;

View File

@ -88,49 +88,23 @@
},
"value": [
{
"type": "ListOfComponentValues",
"type": "Declaration",
"span": {
"start": 11,
"end": 39,
"end": 38,
"ctxt": 0
},
"children": [
{
"type": "PreservedToken",
"span": {
"start": 11,
"end": 21,
"ctxt": 0
},
"token": {
"Ident": {
"value": "background",
"raw": "background"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 21,
"end": 22,
"ctxt": 0
},
"token": "Colon"
},
{
"type": "PreservedToken",
"span": {
"start": 22,
"end": 23,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
"name": {
"type": "Ident",
"span": {
"start": 11,
"end": 21,
"ctxt": 0
},
"value": "background",
"raw": "background"
},
"value": [
{
"type": "PreservedToken",
"span": {
@ -146,17 +120,9 @@
"raw_value": "image'.png"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 38,
"end": 39,
"ctxt": 0
},
"token": "Semi"
}
]
],
"important": null
},
{
"type": "Declaration",

View File

@ -10,9 +10,3 @@
2 | background: url(image'.png);
: ^
`----
x Unexpected token in <declaration-value>
,-[$DIR/tests/recovery/bad-url-token/single-quotes/input.css:2:5]
2 | background: url(image'.png);
: ^^^^^^^^^^^^^^^
`----

View File

@ -82,51 +82,33 @@
x ComponentValue
,-[$DIR/tests/recovery/bad-url-token/single-quotes/input.css:2:5]
2 | background: url(image'.png);
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^
`----
x StyleBlock
,-[$DIR/tests/recovery/bad-url-token/single-quotes/input.css:2:5]
2 | background: url(image'.png);
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^
`----
x ComponentValue
x Declaration
,-[$DIR/tests/recovery/bad-url-token/single-quotes/input.css:2:5]
2 | background: url(image'.png);
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^
`----
x DeclarationName
,-[$DIR/tests/recovery/bad-url-token/single-quotes/input.css:2:5]
2 | background: url(image'.png);
: ^^^^^^^^^^
`----
x Ident { value: Atom('background' type=dynamic), raw: Atom('background' type=dynamic) }
x Ident
,-[$DIR/tests/recovery/bad-url-token/single-quotes/input.css:2:5]
2 | background: url(image'.png);
: ^^^^^^^^^^
`----
x ComponentValue
,-[$DIR/tests/recovery/bad-url-token/single-quotes/input.css:2:5]
2 | background: url(image'.png);
: ^
`----
x Colon
,-[$DIR/tests/recovery/bad-url-token/single-quotes/input.css:2:5]
2 | background: url(image'.png);
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/bad-url-token/single-quotes/input.css:2:5]
2 | background: url(image'.png);
: ^
`----
x WhiteSpace { value: Atom(' ' type=inline) }
,-[$DIR/tests/recovery/bad-url-token/single-quotes/input.css:2:5]
2 | background: url(image'.png);
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/bad-url-token/single-quotes/input.css:2:5]
2 | background: url(image'.png);
@ -139,18 +121,6 @@
: ^^^^^^^^^^^^^^^
`----
x ComponentValue
,-[$DIR/tests/recovery/bad-url-token/single-quotes/input.css:2:5]
2 | background: url(image'.png);
: ^
`----
x Semi
,-[$DIR/tests/recovery/bad-url-token/single-quotes/input.css:2:5]
2 | background: url(image'.png);
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/bad-url-token/single-quotes/input.css:3:5]
3 | color: red;

View File

@ -88,49 +88,23 @@
},
"value": [
{
"type": "ListOfComponentValues",
"type": "Declaration",
"span": {
"start": 9,
"end": 52,
"end": 51,
"ctxt": 0
},
"children": [
{
"type": "PreservedToken",
"span": {
"start": 9,
"end": 25,
"ctxt": 0
},
"token": {
"Ident": {
"value": "background-image",
"raw": "background-image"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 25,
"end": 26,
"ctxt": 0
},
"token": "Colon"
},
{
"type": "PreservedToken",
"span": {
"start": 26,
"end": 27,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
"name": {
"type": "Ident",
"span": {
"start": 9,
"end": 25,
"ctxt": 0
},
"value": "background-image",
"raw": "background-image"
},
"value": [
{
"type": "PreservedToken",
"span": {
@ -146,17 +120,9 @@
"raw_value": " ./image.jpg a "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 51,
"end": 52,
"ctxt": 0
},
"token": "Semi"
}
]
],
"important": null
}
]
}

View File

@ -4,9 +4,3 @@
2 | background-image: url( ./image.jpg a );
: ^^^^^^^^^^^^^^^^^^^^^^^^
`----
x Unexpected token in <declaration-value>
,-[$DIR/tests/recovery/bad-url-token/whitespace-in-middle/input.css:2:5]
2 | background-image: url( ./image.jpg a );
: ^^^^^^^^^^^^^^^^^^^^^^^^
`----

View File

@ -78,51 +78,33 @@
x ComponentValue
,-[$DIR/tests/recovery/bad-url-token/whitespace-in-middle/input.css:2:5]
2 | background-image: url( ./image.jpg a );
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
`----
x StyleBlock
,-[$DIR/tests/recovery/bad-url-token/whitespace-in-middle/input.css:2:5]
2 | background-image: url( ./image.jpg a );
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
`----
x ComponentValue
x Declaration
,-[$DIR/tests/recovery/bad-url-token/whitespace-in-middle/input.css:2:5]
2 | background-image: url( ./image.jpg a );
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
`----
x DeclarationName
,-[$DIR/tests/recovery/bad-url-token/whitespace-in-middle/input.css:2:5]
2 | background-image: url( ./image.jpg a );
: ^^^^^^^^^^^^^^^^
`----
x Ident { value: Atom('background-image' type=dynamic), raw: Atom('background-image' type=dynamic) }
x Ident
,-[$DIR/tests/recovery/bad-url-token/whitespace-in-middle/input.css:2:5]
2 | background-image: url( ./image.jpg a );
: ^^^^^^^^^^^^^^^^
`----
x ComponentValue
,-[$DIR/tests/recovery/bad-url-token/whitespace-in-middle/input.css:2:5]
2 | background-image: url( ./image.jpg a );
: ^
`----
x Colon
,-[$DIR/tests/recovery/bad-url-token/whitespace-in-middle/input.css:2:5]
2 | background-image: url( ./image.jpg a );
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/bad-url-token/whitespace-in-middle/input.css:2:5]
2 | background-image: url( ./image.jpg a );
: ^
`----
x WhiteSpace { value: Atom(' ' type=inline) }
,-[$DIR/tests/recovery/bad-url-token/whitespace-in-middle/input.css:2:5]
2 | background-image: url( ./image.jpg a );
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/bad-url-token/whitespace-in-middle/input.css:2:5]
2 | background-image: url( ./image.jpg a );
@ -134,15 +116,3 @@
2 | background-image: url( ./image.jpg a );
: ^^^^^^^^^^^^^^^^^^^^^^^^
`----
x ComponentValue
,-[$DIR/tests/recovery/bad-url-token/whitespace-in-middle/input.css:2:5]
2 | background-image: url( ./image.jpg a );
: ^
`----
x Semi
,-[$DIR/tests/recovery/bad-url-token/whitespace-in-middle/input.css:2:5]
2 | background-image: url( ./image.jpg a );
: ^
`----

View File

@ -88,49 +88,23 @@
},
"value": [
{
"type": "ListOfComponentValues",
"type": "Declaration",
"span": {
"start": 11,
"end": 43,
"end": 42,
"ctxt": 0
},
"children": [
{
"type": "PreservedToken",
"span": {
"start": 11,
"end": 21,
"ctxt": 0
},
"token": {
"Ident": {
"value": "background",
"raw": "background"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 21,
"end": 22,
"ctxt": 0
},
"token": "Colon"
},
{
"type": "PreservedToken",
"span": {
"start": 22,
"end": 23,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
"name": {
"type": "Ident",
"span": {
"start": 11,
"end": 21,
"ctxt": 0
},
"value": "background",
"raw": "background"
},
"value": [
{
"type": "PreservedToken",
"span": {
@ -146,17 +120,9 @@
"raw_value": "image.\n png"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 42,
"end": 43,
"ctxt": 0
},
"token": "Semi"
}
]
],
"important": null
},
{
"type": "Declaration",

View File

@ -4,9 +4,3 @@
2 | ,-> background: url(image.
3 | `-> png);
`----
x Unexpected token in <declaration-value>
,-[$DIR/tests/recovery/bad-url-token/whitespace/input.css:2:5]
2 | ,-> background: url(image.
3 | `-> png);
`----

View File

@ -95,42 +95,24 @@
3 | `-> png);
`----
x ComponentValue
x Declaration
,-[$DIR/tests/recovery/bad-url-token/whitespace/input.css:2:5]
2 | ,-> background: url(image.
3 | `-> png);
`----
x DeclarationName
,-[$DIR/tests/recovery/bad-url-token/whitespace/input.css:2:5]
2 | background: url(image.
: ^^^^^^^^^^
`----
x Ident { value: Atom('background' type=dynamic), raw: Atom('background' type=dynamic) }
x Ident
,-[$DIR/tests/recovery/bad-url-token/whitespace/input.css:2:5]
2 | background: url(image.
: ^^^^^^^^^^
`----
x ComponentValue
,-[$DIR/tests/recovery/bad-url-token/whitespace/input.css:2:5]
2 | background: url(image.
: ^
`----
x Colon
,-[$DIR/tests/recovery/bad-url-token/whitespace/input.css:2:5]
2 | background: url(image.
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/bad-url-token/whitespace/input.css:2:5]
2 | background: url(image.
: ^
`----
x WhiteSpace { value: Atom(' ' type=inline) }
,-[$DIR/tests/recovery/bad-url-token/whitespace/input.css:2:5]
2 | background: url(image.
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/bad-url-token/whitespace/input.css:2:5]
2 | ,-> background: url(image.
@ -145,18 +127,6 @@
3 | `-> png);
`----
x ComponentValue
,-[$DIR/tests/recovery/bad-url-token/whitespace/input.css:3:5]
3 | png);
: ^
`----
x Semi
,-[$DIR/tests/recovery/bad-url-token/whitespace/input.css:3:5]
3 | png);
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/bad-url-token/whitespace/input.css:4:5]
4 | color: red;

View File

@ -1,6 +1,6 @@
x Unexpected end of file
x Unexpected end of file, but expected '{'
,-[$DIR/tests/recovery/comments/bad-comment-1/input.css:1:1]
1 | // comment
: ^
: ^^^^^^^^^^
`----

View File

@ -106,7 +106,7 @@
},
"value": [
{
"type": "Url",
"type": "Function",
"span": {
"start": 15,
"end": 26,
@ -122,17 +122,61 @@
"value": "url",
"raw": "url"
},
"value": {
"type": "String",
"span": {
"start": 19,
"end": 25,
"ctxt": 0
},
"value": "test",
"raw": "\"test\""
"value": [
{
"type": "PreservedToken",
"span": {
"start": 19,
"end": 25,
"ctxt": 0
},
"token": {
"String": {
"value": "test",
"raw": "\"test\""
}
}
}
]
},
{
"type": "PreservedToken",
"span": {
"start": 26,
"end": 27,
"ctxt": 0
},
"modifiers": []
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 40,
"end": 43,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 56,
"end": 65,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": "\n "
}
}
},
{
"type": "PreservedToken",

View File

@ -115,7 +115,7 @@
: ^^^^^^^^^^^
`----
x Url
x Function
,-[$DIR/tests/recovery/comments/declaration/input.css:2:5]
2 | prop: url("test") /* comment */ /* comment */
: ^^^^^^^^^^^
@ -127,18 +127,55 @@
: ^^^
`----
x UrlValue
x ComponentValue
,-[$DIR/tests/recovery/comments/declaration/input.css:2:5]
2 | prop: url("test") /* comment */ /* comment */
: ^^^^^^
`----
x Str
x String { value: Atom('test' type=inline), raw: Atom('"test"' type=inline) }
,-[$DIR/tests/recovery/comments/declaration/input.css:2:5]
2 | prop: url("test") /* comment */ /* comment */
: ^^^^^^
`----
x ComponentValue
,-[$DIR/tests/recovery/comments/declaration/input.css:2:5]
2 | prop: url("test") /* comment */ /* comment */
: ^
`----
x WhiteSpace { value: Atom(' ' type=inline) }
,-[$DIR/tests/recovery/comments/declaration/input.css:2:5]
2 | prop: url("test") /* comment */ /* comment */
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/comments/declaration/input.css:2:5]
2 | prop: url("test") /* comment */ /* comment */
: ^^^
`----
x WhiteSpace { value: Atom(' ' type=inline) }
,-[$DIR/tests/recovery/comments/declaration/input.css:2:5]
2 | prop: url("test") /* comment */ /* comment */
: ^^^
`----
x ComponentValue
,-[$DIR/tests/recovery/comments/declaration/input.css:2:5]
2 | ,-> prop: url("test") /* comment */ /* comment */
3 | `-> /* comment */:
`----
x WhiteSpace { value: Atom('
| ' type=dynamic) }
,-[$DIR/tests/recovery/comments/declaration/input.css:2:5]
2 | ,-> prop: url("test") /* comment */ /* comment */
3 | `-> /* comment */:
`----
x ComponentValue
,-[$DIR/tests/recovery/comments/declaration/input.css:3:9]
3 | /* comment */:

View File

@ -209,49 +209,23 @@
},
"value": [
{
"type": "ListOfComponentValues",
"type": "Declaration",
"span": {
"start": 54,
"end": 63,
"end": 62,
"ctxt": 0
},
"children": [
{
"type": "PreservedToken",
"span": {
"start": 54,
"end": 58,
"ctxt": 0
},
"token": {
"Ident": {
"value": "prop",
"raw": "prop"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 58,
"end": 59,
"ctxt": 0
},
"token": "Colon"
},
{
"type": "PreservedToken",
"span": {
"start": 59,
"end": 60,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
"name": {
"type": "Ident",
"span": {
"start": 54,
"end": 58,
"ctxt": 0
},
"value": "prop",
"raw": "prop"
},
"value": [
{
"type": "PreservedToken",
"span": {
@ -277,17 +251,9 @@
"value": "!"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 62,
"end": 63,
"ctxt": 0
},
"token": "Semi"
}
]
],
"important": null
},
{
"type": "Declaration",

View File

@ -5,7 +5,13 @@
: ^
`----
x Expected Ident
x Expected Declaration value
,-[$DIR/tests/recovery/declaration/basic/input.css:7:5]
7 | prop: !!;
: ^
`----
x Unexpected '!' in <declaration-value>
,-[$DIR/tests/recovery/declaration/basic/input.css:7:5]
7 | prop: !!;
: ^

View File

@ -224,51 +224,33 @@
x ComponentValue
,-[$DIR/tests/recovery/declaration/basic/input.css:7:5]
7 | prop: !!;
: ^^^^^^^^^
: ^^^^^^^^
`----
x StyleBlock
,-[$DIR/tests/recovery/declaration/basic/input.css:7:5]
7 | prop: !!;
: ^^^^^^^^^
: ^^^^^^^^
`----
x ComponentValue
x Declaration
,-[$DIR/tests/recovery/declaration/basic/input.css:7:5]
7 | prop: !!;
: ^^^^^^^^
`----
x DeclarationName
,-[$DIR/tests/recovery/declaration/basic/input.css:7:5]
7 | prop: !!;
: ^^^^
`----
x Ident { value: Atom('prop' type=inline), raw: Atom('prop' type=inline) }
x Ident
,-[$DIR/tests/recovery/declaration/basic/input.css:7:5]
7 | prop: !!;
: ^^^^
`----
x ComponentValue
,-[$DIR/tests/recovery/declaration/basic/input.css:7:5]
7 | prop: !!;
: ^
`----
x Colon
,-[$DIR/tests/recovery/declaration/basic/input.css:7:5]
7 | prop: !!;
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/declaration/basic/input.css:7:5]
7 | prop: !!;
: ^
`----
x WhiteSpace { value: Atom(' ' type=inline) }
,-[$DIR/tests/recovery/declaration/basic/input.css:7:5]
7 | prop: !!;
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/declaration/basic/input.css:7:5]
7 | prop: !!;
@ -293,18 +275,6 @@
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/declaration/basic/input.css:7:5]
7 | prop: !!;
: ^
`----
x Semi
,-[$DIR/tests/recovery/declaration/basic/input.css:7:5]
7 | prop: !!;
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/declaration/basic/input.css:8:5]
8 | color: red;

View File

@ -1,3 +1,23 @@
.a {
color: white !!important;
}
.class {
color: red red red !important !important;
}
.class {
color: red red red !important!important ;
}
.class {
color: red red red /* test*/ !important /*test*/ !important /*test*/ ;
}
.class {
color: red red red !important !important!important;
}
.class {
color: red red red /* test */ ! /*test */ important /* test */ ! /* test */ important /* test */;
}

View File

@ -1,6 +1,36 @@
x Expected Ident
x Expected Declaration value
,-[$DIR/tests/recovery/declaration/important/input.css:6:5]
6 | color: red red red !important !important;
: ^
`----
x Expected Declaration value
,-[$DIR/tests/recovery/declaration/important/input.css:10:5]
10 | color: red red red !important!important ;
: ^
`----
x Expected Declaration value
,-[$DIR/tests/recovery/declaration/important/input.css:14:5]
14 | color: red red red /* test*/ !important /*test*/ !important /*test*/ ;
: ^
`----
x Expected Declaration value
,-[$DIR/tests/recovery/declaration/important/input.css:18:5]
18 | color: red red red !important !important!important;
: ^
`----
x Expected Declaration value
,-[$DIR/tests/recovery/declaration/important/input.css:22:5]
22 | color: red red red /* test */ ! /*test */ important /* test */ ! /* test */ important /* test */;
: ^
`----
x Unexpected end of file
,-[$DIR/tests/recovery/declaration/important/input.css:2:5]
2 | color: white !!important;
: ^
: ^
`----

View File

@ -119,14 +119,31 @@
}
},
{
"type": "Ident",
"type": "PreservedToken",
"span": {
"start": 17,
"end": 18,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 18,
"end": 21,
"ctxt": 0
},
"value": "red",
"raw": "red"
"token": {
"Ident": {
"value": "red",
"raw": "red"
}
}
}
],
"important": null

View File

@ -120,10 +120,22 @@
x ComponentValue
,-[$DIR/tests/recovery/delim-token/at-sign/input.css:2:5]
2 | color: @ red;
: ^^^
: ^
`----
x Ident
x WhiteSpace { value: Atom(' ' type=inline) }
,-[$DIR/tests/recovery/delim-token/at-sign/input.css:2:5]
2 | color: @ red;
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/delim-token/at-sign/input.css:2:5]
2 | color: @ red;
: ^^^
`----
x Ident { value: Atom('red' type=inline), raw: Atom('red' type=inline) }
,-[$DIR/tests/recovery/delim-token/at-sign/input.css:2:5]
2 | color: @ red;
: ^^^

View File

@ -88,49 +88,23 @@
},
"value": [
{
"type": "ListOfComponentValues",
"type": "Declaration",
"span": {
"start": 9,
"end": 19,
"end": 18,
"ctxt": 0
},
"children": [
{
"type": "PreservedToken",
"span": {
"start": 9,
"end": 14,
"ctxt": 0
},
"token": {
"Ident": {
"value": "color",
"raw": "color"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 14,
"end": 15,
"ctxt": 0
},
"token": "Colon"
},
{
"type": "PreservedToken",
"span": {
"start": 15,
"end": 16,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
"name": {
"type": "Ident",
"span": {
"start": 9,
"end": 14,
"ctxt": 0
},
"value": "color",
"raw": "color"
},
"value": [
{
"type": "PreservedToken",
"span": {
@ -156,17 +130,9 @@
"value": "!"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 18,
"end": 19,
"ctxt": 0
},
"token": "Semi"
}
]
],
"important": null
}
]
}

View File

@ -1,5 +1,11 @@
x Expected Ident
x Expected Declaration value
,-[$DIR/tests/recovery/delim-token/bang/input.css:2:5]
2 | color: !!;
: ^
`----
x Unexpected '!' in <declaration-value>
,-[$DIR/tests/recovery/delim-token/bang/input.css:2:5]
2 | color: !!;
: ^

View File

@ -78,51 +78,33 @@
x ComponentValue
,-[$DIR/tests/recovery/delim-token/bang/input.css:2:5]
2 | color: !!;
: ^^^^^^^^^^
: ^^^^^^^^^
`----
x StyleBlock
,-[$DIR/tests/recovery/delim-token/bang/input.css:2:5]
2 | color: !!;
: ^^^^^^^^^^
: ^^^^^^^^^
`----
x ComponentValue
x Declaration
,-[$DIR/tests/recovery/delim-token/bang/input.css:2:5]
2 | color: !!;
: ^^^^^^^^^
`----
x DeclarationName
,-[$DIR/tests/recovery/delim-token/bang/input.css:2:5]
2 | color: !!;
: ^^^^^
`----
x Ident { value: Atom('color' type=static), raw: Atom('color' type=static) }
x Ident
,-[$DIR/tests/recovery/delim-token/bang/input.css:2:5]
2 | color: !!;
: ^^^^^
`----
x ComponentValue
,-[$DIR/tests/recovery/delim-token/bang/input.css:2:5]
2 | color: !!;
: ^
`----
x Colon
,-[$DIR/tests/recovery/delim-token/bang/input.css:2:5]
2 | color: !!;
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/delim-token/bang/input.css:2:5]
2 | color: !!;
: ^
`----
x WhiteSpace { value: Atom(' ' type=inline) }
,-[$DIR/tests/recovery/delim-token/bang/input.css:2:5]
2 | color: !!;
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/delim-token/bang/input.css:2:5]
2 | color: !!;
@ -146,15 +128,3 @@
2 | color: !!;
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/delim-token/bang/input.css:2:5]
2 | color: !!;
: ^
`----
x Semi
,-[$DIR/tests/recovery/delim-token/bang/input.css:2:5]
2 | color: !!;
: ^
`----

View File

@ -4,9 +4,3 @@
2 | color: ##;
: ^
`----
x Expected Declaration value
,-[$DIR/tests/recovery/delim-token/hash/input.css:2:5]
2 | color: ##;
: ^
`----

View File

@ -140,14 +140,32 @@
},
"value": [
{
"type": "Integer",
"type": "PreservedToken",
"span": {
"start": 29,
"end": 30,
"ctxt": 0
},
"value": 1,
"raw": "1"
"token": {
"Number": {
"value": 1.0,
"raw": "1",
"type": "integer"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 30,
"end": 31,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
@ -163,14 +181,32 @@
}
},
{
"type": "Integer",
"type": "PreservedToken",
"span": {
"start": 32,
"end": 33,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 33,
"end": 34,
"ctxt": 0
},
"value": 2,
"raw": "2"
"token": {
"Number": {
"value": 2.0,
"raw": "2",
"type": "integer"
}
}
}
],
"important": null

View File

@ -161,12 +161,24 @@
: ^
`----
x Integer
x Number { value: 1.0, raw: Atom('1' type=inline), type_flag: Integer }
,-[$DIR/tests/recovery/delim-token/minus/input.css:3:5]
3 | prop1: 1 - 2;
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/delim-token/minus/input.css:3:5]
3 | prop1: 1 - 2;
: ^
`----
x WhiteSpace { value: Atom(' ' type=inline) }
,-[$DIR/tests/recovery/delim-token/minus/input.css:3:5]
3 | prop1: 1 - 2;
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/delim-token/minus/input.css:3:5]
3 | prop1: 1 - 2;
@ -179,13 +191,25 @@
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/delim-token/minus/input.css:3:5]
3 | prop1: 1 - 2;
: ^
`----
x WhiteSpace { value: Atom(' ' type=inline) }
,-[$DIR/tests/recovery/delim-token/minus/input.css:3:5]
3 | prop1: 1 - 2;
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/delim-token/minus/input.css:3:5]
3 | prop1: 1 - 2;
: ^
`----
x Integer
x Number { value: 2.0, raw: Atom('2' type=inline), type_flag: Integer }
,-[$DIR/tests/recovery/delim-token/minus/input.css:3:5]
3 | prop1: 1 - 2;
: ^

View File

@ -140,14 +140,32 @@
},
"value": [
{
"type": "Integer",
"type": "PreservedToken",
"span": {
"start": 29,
"end": 30,
"ctxt": 0
},
"value": 1,
"raw": "1"
"token": {
"Number": {
"value": 1.0,
"raw": "1",
"type": "integer"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 30,
"end": 31,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
@ -163,14 +181,32 @@
}
},
{
"type": "Integer",
"type": "PreservedToken",
"span": {
"start": 32,
"end": 33,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 33,
"end": 34,
"ctxt": 0
},
"value": 2,
"raw": "2"
"token": {
"Number": {
"value": 2.0,
"raw": "2",
"type": "integer"
}
}
}
],
"important": null

View File

@ -161,12 +161,24 @@
: ^
`----
x Integer
x Number { value: 1.0, raw: Atom('1' type=inline), type_flag: Integer }
,-[$DIR/tests/recovery/delim-token/plus/input.css:3:5]
3 | prop1: 1 + 2;
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/delim-token/plus/input.css:3:5]
3 | prop1: 1 + 2;
: ^
`----
x WhiteSpace { value: Atom(' ' type=inline) }
,-[$DIR/tests/recovery/delim-token/plus/input.css:3:5]
3 | prop1: 1 + 2;
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/delim-token/plus/input.css:3:5]
3 | prop1: 1 + 2;
@ -179,13 +191,25 @@
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/delim-token/plus/input.css:3:5]
3 | prop1: 1 + 2;
: ^
`----
x WhiteSpace { value: Atom(' ' type=inline) }
,-[$DIR/tests/recovery/delim-token/plus/input.css:3:5]
3 | prop1: 1 + 2;
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/delim-token/plus/input.css:3:5]
3 | prop1: 1 + 2;
: ^
`----
x Integer
x Number { value: 2.0, raw: Atom('2' type=inline), type_flag: Integer }
,-[$DIR/tests/recovery/delim-token/plus/input.css:3:5]
3 | prop1: 1 + 2;
: ^

View File

@ -106,7 +106,7 @@
},
"value": [
{
"type": "Url",
"type": "Function",
"span": {
"start": 15,
"end": 26,
@ -122,17 +122,35 @@
"value": "url",
"raw": "url"
},
"value": {
"type": "String",
"span": {
"start": 19,
"end": 25,
"ctxt": 0
},
"value": "test",
"raw": "\"test\""
"value": [
{
"type": "PreservedToken",
"span": {
"start": 19,
"end": 25,
"ctxt": 0
},
"token": {
"String": {
"value": "test",
"raw": "\"test\""
}
}
}
]
},
{
"type": "PreservedToken",
"span": {
"start": 26,
"end": 27,
"ctxt": 0
},
"modifiers": []
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",

View File

@ -111,7 +111,7 @@
: ^^^^^^^^^^^
`----
x Url
x Function
,-[$DIR/tests/recovery/function-token/input.css:2:5]
2 | prop: url("test") :
: ^^^^^^^^^^^
@ -123,18 +123,30 @@
: ^^^
`----
x UrlValue
x ComponentValue
,-[$DIR/tests/recovery/function-token/input.css:2:5]
2 | prop: url("test") :
: ^^^^^^
`----
x Str
x String { value: Atom('test' type=inline), raw: Atom('"test"' type=inline) }
,-[$DIR/tests/recovery/function-token/input.css:2:5]
2 | prop: url("test") :
: ^^^^^^
`----
x ComponentValue
,-[$DIR/tests/recovery/function-token/input.css:2:5]
2 | prop: url("test") :
: ^
`----
x WhiteSpace { value: Atom(' ' type=inline) }
,-[$DIR/tests/recovery/function-token/input.css:2:5]
2 | prop: url("test") :
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/function-token/input.css:2:5]
2 | prop: url("test") :

View File

@ -88,49 +88,23 @@
},
"value": [
{
"type": "ListOfComponentValues",
"type": "Declaration",
"span": {
"start": 9,
"end": 70,
"end": 69,
"ctxt": 0
},
"children": [
{
"type": "PreservedToken",
"span": {
"start": 9,
"end": 19,
"ctxt": 0
},
"token": {
"Ident": {
"value": "background",
"raw": "background"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 19,
"end": 20,
"ctxt": 0
},
"token": "Colon"
},
{
"type": "PreservedToken",
"span": {
"start": 20,
"end": 21,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
"name": {
"type": "Ident",
"span": {
"start": 9,
"end": 19,
"ctxt": 0
},
"value": "background",
"raw": "background"
},
"value": [
{
"type": "PreservedToken",
"span": {
@ -146,17 +120,9 @@
"raw_value": "\n /* test */\n \"test.png\"\n "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 69,
"end": 70,
"ctxt": 0
},
"token": "Semi"
}
]
],
"important": null
}
]
}

View File

@ -6,11 +6,3 @@
4 | | "test.png"
5 | `-> );
`----
x Unexpected token in <declaration-value>
,-[$DIR/tests/recovery/function/bad-comment-2/input.css:2:5]
2 | ,-> background: url(
3 | | /* test */
4 | | "test.png"
5 | `-> );
`----

View File

@ -103,42 +103,26 @@
5 | `-> );
`----
x ComponentValue
x Declaration
,-[$DIR/tests/recovery/function/bad-comment-2/input.css:2:5]
2 | ,-> background: url(
3 | | /* test */
4 | | "test.png"
5 | `-> );
`----
x DeclarationName
,-[$DIR/tests/recovery/function/bad-comment-2/input.css:2:5]
2 | background: url(
: ^^^^^^^^^^
`----
x Ident { value: Atom('background' type=dynamic), raw: Atom('background' type=dynamic) }
x Ident
,-[$DIR/tests/recovery/function/bad-comment-2/input.css:2:5]
2 | background: url(
: ^^^^^^^^^^
`----
x ComponentValue
,-[$DIR/tests/recovery/function/bad-comment-2/input.css:2:5]
2 | background: url(
: ^
`----
x Colon
,-[$DIR/tests/recovery/function/bad-comment-2/input.css:2:5]
2 | background: url(
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/function/bad-comment-2/input.css:2:5]
2 | background: url(
: ^
`----
x WhiteSpace { value: Atom(' ' type=inline) }
,-[$DIR/tests/recovery/function/bad-comment-2/input.css:2:5]
2 | background: url(
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/function/bad-comment-2/input.css:2:5]
2 | ,-> background: url(
@ -160,15 +144,3 @@
4 | | "test.png"
5 | `-> );
`----
x ComponentValue
,-[$DIR/tests/recovery/function/bad-comment-2/input.css:5:5]
5 | );
: ^
`----
x Semi
,-[$DIR/tests/recovery/function/bad-comment-2/input.css:5:5]
5 | );
: ^
`----

View File

@ -88,49 +88,23 @@
},
"value": [
{
"type": "ListOfComponentValues",
"type": "Declaration",
"span": {
"start": 9,
"end": 68,
"end": 67,
"ctxt": 0
},
"children": [
{
"type": "PreservedToken",
"span": {
"start": 9,
"end": 19,
"ctxt": 0
},
"token": {
"Ident": {
"value": "background",
"raw": "background"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 19,
"end": 20,
"ctxt": 0
},
"token": "Colon"
},
{
"type": "PreservedToken",
"span": {
"start": 20,
"end": 21,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
"name": {
"type": "Ident",
"span": {
"start": 9,
"end": 19,
"ctxt": 0
},
"value": "background",
"raw": "background"
},
"value": [
{
"type": "PreservedToken",
"span": {
@ -146,17 +120,9 @@
"raw_value": "\n /* test */\n test.png\n "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 67,
"end": 68,
"ctxt": 0
},
"token": "Semi"
}
]
],
"important": null
}
]
}

View File

@ -6,11 +6,3 @@
4 | | test.png
5 | `-> );
`----
x Unexpected token in <declaration-value>
,-[$DIR/tests/recovery/function/bad-comment/input.css:2:5]
2 | ,-> background: url(
3 | | /* test */
4 | | test.png
5 | `-> );
`----

View File

@ -103,42 +103,26 @@
5 | `-> );
`----
x ComponentValue
x Declaration
,-[$DIR/tests/recovery/function/bad-comment/input.css:2:5]
2 | ,-> background: url(
3 | | /* test */
4 | | test.png
5 | `-> );
`----
x DeclarationName
,-[$DIR/tests/recovery/function/bad-comment/input.css:2:5]
2 | background: url(
: ^^^^^^^^^^
`----
x Ident { value: Atom('background' type=dynamic), raw: Atom('background' type=dynamic) }
x Ident
,-[$DIR/tests/recovery/function/bad-comment/input.css:2:5]
2 | background: url(
: ^^^^^^^^^^
`----
x ComponentValue
,-[$DIR/tests/recovery/function/bad-comment/input.css:2:5]
2 | background: url(
: ^
`----
x Colon
,-[$DIR/tests/recovery/function/bad-comment/input.css:2:5]
2 | background: url(
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/function/bad-comment/input.css:2:5]
2 | background: url(
: ^
`----
x WhiteSpace { value: Atom(' ' type=inline) }
,-[$DIR/tests/recovery/function/bad-comment/input.css:2:5]
2 | background: url(
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/function/bad-comment/input.css:2:5]
2 | ,-> background: url(
@ -160,15 +144,3 @@
4 | | test.png
5 | `-> );
`----
x ComponentValue
,-[$DIR/tests/recovery/function/bad-comment/input.css:5:5]
5 | );
: ^
`----
x Semi
,-[$DIR/tests/recovery/function/bad-comment/input.css:5:5]
5 | );
: ^
`----

View File

@ -117,14 +117,18 @@
},
"value": [
{
"type": "String",
"type": "PreservedToken",
"span": {
"start": 23,
"end": 29,
"ctxt": 0
},
"value": "test",
"raw": "\"test\""
"token": {
"String": {
"value": "test",
"raw": "\"test\""
}
}
}
]
}
@ -168,52 +172,92 @@
},
"value": [
{
"type": "String",
"type": "PreservedToken",
"span": {
"start": 48,
"end": 54,
"ctxt": 0
},
"value": "test",
"raw": "\"test\""
"token": {
"String": {
"value": "test",
"raw": "\"test\""
}
}
},
{
"type": "Delimiter",
"type": "PreservedToken",
"span": {
"start": 54,
"end": 55,
"ctxt": 0
},
"value": ","
"token": "Comma"
},
{
"type": "Integer",
"type": "PreservedToken",
"span": {
"start": 55,
"end": 56,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 56,
"end": 59,
"ctxt": 0
},
"value": 100,
"raw": "100"
"token": {
"Number": {
"value": 100.0,
"raw": "100",
"type": "integer"
}
}
},
{
"type": "Delimiter",
"type": "PreservedToken",
"span": {
"start": 59,
"end": 60,
"ctxt": 0
},
"value": ","
"token": "Comma"
},
{
"type": "Integer",
"type": "PreservedToken",
"span": {
"start": 60,
"end": 61,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 61,
"end": 64,
"ctxt": 0
},
"value": 100,
"raw": "100"
"token": {
"Number": {
"value": 100.0,
"raw": "100",
"type": "integer"
}
}
}
]
}
@ -257,52 +301,92 @@
},
"value": [
{
"type": "Integer",
"type": "PreservedToken",
"span": {
"start": 82,
"end": 85,
"ctxt": 0
},
"value": 100,
"raw": "100"
"token": {
"Number": {
"value": 100.0,
"raw": "100",
"type": "integer"
}
}
},
{
"type": "Delimiter",
"type": "PreservedToken",
"span": {
"start": 85,
"end": 86,
"ctxt": 0
},
"value": ","
"token": "Comma"
},
{
"type": "String",
"type": "PreservedToken",
"span": {
"start": 86,
"end": 87,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 87,
"end": 93,
"ctxt": 0
},
"value": "test",
"raw": "\"test\""
"token": {
"String": {
"value": "test",
"raw": "\"test\""
}
}
},
{
"type": "Delimiter",
"type": "PreservedToken",
"span": {
"start": 93,
"end": 94,
"ctxt": 0
},
"value": ","
"token": "Comma"
},
{
"type": "Integer",
"type": "PreservedToken",
"span": {
"start": 94,
"end": 95,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 95,
"end": 98,
"ctxt": 0
},
"value": 100,
"raw": "100"
"token": {
"Number": {
"value": 100.0,
"raw": "100",
"type": "integer"
}
}
}
]
}
@ -346,52 +430,92 @@
},
"value": [
{
"type": "Integer",
"type": "PreservedToken",
"span": {
"start": 116,
"end": 119,
"ctxt": 0
},
"value": 100,
"raw": "100"
"token": {
"Number": {
"value": 100.0,
"raw": "100",
"type": "integer"
}
}
},
{
"type": "Delimiter",
"type": "PreservedToken",
"span": {
"start": 119,
"end": 120,
"ctxt": 0
},
"value": ","
"token": "Comma"
},
{
"type": "Integer",
"type": "PreservedToken",
"span": {
"start": 120,
"end": 121,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 121,
"end": 124,
"ctxt": 0
},
"value": 100,
"raw": "100"
"token": {
"Number": {
"value": 100.0,
"raw": "100",
"type": "integer"
}
}
},
{
"type": "Delimiter",
"type": "PreservedToken",
"span": {
"start": 124,
"end": 125,
"ctxt": 0
},
"value": ","
"token": "Comma"
},
{
"type": "String",
"type": "PreservedToken",
"span": {
"start": 125,
"end": 126,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 126,
"end": 132,
"ctxt": 0
},
"value": "test",
"raw": "\"test\""
"token": {
"String": {
"value": "test",
"raw": "\"test\""
}
}
}
]
}
@ -435,71 +559,129 @@
},
"value": [
{
"type": "Integer",
"type": "PreservedToken",
"span": {
"start": 150,
"end": 153,
"ctxt": 0
},
"value": 100,
"raw": "100"
"token": {
"Number": {
"value": 100.0,
"raw": "100",
"type": "integer"
}
}
},
{
"type": "Delimiter",
"type": "PreservedToken",
"span": {
"start": 153,
"end": 154,
"ctxt": 0
},
"value": ","
"token": "Comma"
},
{
"type": "Integer",
"type": "PreservedToken",
"span": {
"start": 154,
"end": 155,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 155,
"end": 158,
"ctxt": 0
},
"value": 100,
"raw": "100"
"token": {
"Number": {
"value": 100.0,
"raw": "100",
"type": "integer"
}
}
},
{
"type": "Delimiter",
"type": "PreservedToken",
"span": {
"start": 158,
"end": 159,
"ctxt": 0
},
"value": ","
"token": "Comma"
},
{
"type": "Integer",
"type": "PreservedToken",
"span": {
"start": 159,
"end": 160,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 160,
"end": 163,
"ctxt": 0
},
"value": 100,
"raw": "100"
"token": {
"Number": {
"value": 100.0,
"raw": "100",
"type": "integer"
}
}
},
{
"type": "Delimiter",
"type": "PreservedToken",
"span": {
"start": 163,
"end": 164,
"ctxt": 0
},
"value": ","
"token": "Comma"
},
{
"type": "String",
"type": "PreservedToken",
"span": {
"start": 164,
"end": 165,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 165,
"end": 171,
"ctxt": 0
},
"value": "test",
"raw": "\"test\""
"token": {
"String": {
"value": "test",
"raw": "\"test\""
}
}
}
]
}
@ -543,34 +725,74 @@
},
"value": [
{
"type": "String",
"type": "PreservedToken",
"span": {
"start": 190,
"end": 196,
"ctxt": 0
},
"value": "test",
"raw": "\"test\""
"token": {
"String": {
"value": "test",
"raw": "\"test\""
}
}
},
{
"type": "Integer",
"type": "PreservedToken",
"span": {
"start": 196,
"end": 197,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 197,
"end": 200,
"ctxt": 0
},
"value": 100,
"raw": "100"
"token": {
"Number": {
"value": 100.0,
"raw": "100",
"type": "integer"
}
}
},
{
"type": "Integer",
"type": "PreservedToken",
"span": {
"start": 200,
"end": 201,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 201,
"end": 204,
"ctxt": 0
},
"value": 100,
"raw": "100"
"token": {
"Number": {
"value": 100.0,
"raw": "100",
"type": "integer"
}
}
}
]
}
@ -614,34 +836,74 @@
},
"value": [
{
"type": "Integer",
"type": "PreservedToken",
"span": {
"start": 222,
"end": 225,
"ctxt": 0
},
"value": 100,
"raw": "100"
"token": {
"Number": {
"value": 100.0,
"raw": "100",
"type": "integer"
}
}
},
{
"type": "String",
"type": "PreservedToken",
"span": {
"start": 225,
"end": 226,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 226,
"end": 232,
"ctxt": 0
},
"value": "test",
"raw": "\"test\""
"token": {
"String": {
"value": "test",
"raw": "\"test\""
}
}
},
{
"type": "Integer",
"type": "PreservedToken",
"span": {
"start": 232,
"end": 233,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 233,
"end": 236,
"ctxt": 0
},
"value": 100,
"raw": "100"
"token": {
"Number": {
"value": 100.0,
"raw": "100",
"type": "integer"
}
}
}
]
}
@ -685,34 +947,74 @@
},
"value": [
{
"type": "Integer",
"type": "PreservedToken",
"span": {
"start": 254,
"end": 257,
"ctxt": 0
},
"value": 100,
"raw": "100"
"token": {
"Number": {
"value": 100.0,
"raw": "100",
"type": "integer"
}
}
},
{
"type": "Integer",
"type": "PreservedToken",
"span": {
"start": 257,
"end": 258,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 258,
"end": 261,
"ctxt": 0
},
"value": 100,
"raw": "100"
"token": {
"Number": {
"value": 100.0,
"raw": "100",
"type": "integer"
}
}
},
{
"type": "String",
"type": "PreservedToken",
"span": {
"start": 261,
"end": 262,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 262,
"end": 268,
"ctxt": 0
},
"value": "test",
"raw": "\"test\""
"token": {
"String": {
"value": "test",
"raw": "\"test\""
}
}
}
]
}
@ -756,53 +1058,128 @@
},
"value": [
{
"type": "Integer",
"type": "PreservedToken",
"span": {
"start": 286,
"end": 289,
"ctxt": 0
},
"value": 100,
"raw": "100"
"token": {
"Number": {
"value": 100.0,
"raw": "100",
"type": "integer"
}
}
},
{
"type": "Integer",
"type": "PreservedToken",
"span": {
"start": 289,
"end": 290,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 290,
"end": 293,
"ctxt": 0
},
"value": 100,
"raw": "100"
"token": {
"Number": {
"value": 100.0,
"raw": "100",
"type": "integer"
}
}
},
{
"type": "Integer",
"type": "PreservedToken",
"span": {
"start": 293,
"end": 294,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 294,
"end": 297,
"ctxt": 0
},
"value": 100,
"raw": "100"
"token": {
"Number": {
"value": 100.0,
"raw": "100",
"type": "integer"
}
}
},
{
"type": "Delimiter",
"type": "PreservedToken",
"span": {
"start": 297,
"end": 298,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 298,
"end": 299,
"ctxt": 0
},
"value": "/"
"token": {
"Delim": {
"value": "/"
}
}
},
{
"type": "String",
"type": "PreservedToken",
"span": {
"start": 299,
"end": 300,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 300,
"end": 306,
"ctxt": 0
},
"value": "test",
"raw": "\"test\""
"token": {
"String": {
"value": "test",
"raw": "\"test\""
}
}
}
]
}

View File

@ -1,10 +1,4 @@
x Expected comma token
,-[$DIR/tests/recovery/function/rgb/input.css:4:5]
4 | color: rgb("test", 100, 100);
: ^
`----
x Expected percentage, function (math functions) or number token
,-[$DIR/tests/recovery/function/rgb/input.css:7:5]
7 | color: rgb(100, 100, 100, "test");
@ -23,114 +17,30 @@
: ^^^^^^
`----
x Expected percentage, number, function (math functions) or ident (with 'none' value) token
,-[$DIR/tests/recovery/function/rgb/input.css:4:5]
4 | color: rgb("test", 100, 100);
: ^
`----
x Expected percentage, number, function (math functions) or ident (with 'none' value) token
,-[$DIR/tests/recovery/function/rgb/input.css:4:5]
4 | color: rgb("test", 100, 100);
: ^
`----
x Expected percentage, number, function (math functions) or ident (with 'none' value) token
,-[$DIR/tests/recovery/function/rgb/input.css:4:5]
4 | color: rgb("test", 100, 100);
: ^
`----
x Expected percentage, number, function (math functions) or ident (with 'none' value) token
,-[$DIR/tests/recovery/function/rgb/input.css:5:5]
5 | color: rgb(100, "test", 100);
: ^^^^^^
`----
x Expected percentage, number, function (math functions) or ident (with 'none' value) token
,-[$DIR/tests/recovery/function/rgb/input.css:5:5]
5 | color: rgb(100, "test", 100);
: ^
`----
x Expected percentage, number, function (math functions) or ident (with 'none' value) token
,-[$DIR/tests/recovery/function/rgb/input.css:5:5]
5 | color: rgb(100, "test", 100);
: ^
`----
x Expected percentage, number, function (math functions) or ident (with 'none' value) token
,-[$DIR/tests/recovery/function/rgb/input.css:5:5]
5 | color: rgb(100, "test", 100);
: ^
`----
x Expected percentage, number, function (math functions) or ident (with 'none' value) token
,-[$DIR/tests/recovery/function/rgb/input.css:6:5]
6 | color: rgb(100, 100, "test");
: ^^^^^^
`----
x Expected percentage, number, function (math functions) or ident (with 'none' value) token
,-[$DIR/tests/recovery/function/rgb/input.css:6:5]
6 | color: rgb(100, 100, "test");
: ^
`----
x Expected percentage, number, function (math functions) or ident (with 'none' value) token
,-[$DIR/tests/recovery/function/rgb/input.css:6:5]
6 | color: rgb(100, 100, "test");
: ^
`----
x Expected percentage, number, function (math functions) or ident (with 'none' value) token
,-[$DIR/tests/recovery/function/rgb/input.css:7:5]
7 | color: rgb(100, 100, 100, "test");
: ^
`----
x Expected percentage, number, function (math functions) or ident (with 'none' value) token
,-[$DIR/tests/recovery/function/rgb/input.css:7:5]
7 | color: rgb(100, 100, 100, "test");
: ^^^^^^
`----
x Expected percentage, number, function (math functions) or ident (with 'none' value) token
,-[$DIR/tests/recovery/function/rgb/input.css:7:5]
7 | color: rgb(100, 100, 100, "test");
: ^
`----
x Expected percentage, number, function (math functions) or ident (with 'none' value) token
,-[$DIR/tests/recovery/function/rgb/input.css:7:5]
7 | color: rgb(100, 100, 100, "test");
: ^
`----
x Expected percentage, number, function (math functions) or ident (with 'none' value) token
,-[$DIR/tests/recovery/function/rgb/input.css:9:5]
9 | color: rgb("test" 100 100);
: ^^^^^^
`----
x Expected percentage, number, function (math functions) or ident (with 'none' value) token
,-[$DIR/tests/recovery/function/rgb/input.css:9:5]
9 | color: rgb("test" 100 100);
: ^
`----
x Expected percentage, number, function (math functions) or ident (with 'none' value) token
,-[$DIR/tests/recovery/function/rgb/input.css:10:5]
10 | color: rgb(100 "test" 100);
: ^^^^^^
`----
x Expected percentage, number, function (math functions) or ident (with 'none' value) token
,-[$DIR/tests/recovery/function/rgb/input.css:10:5]
10 | color: rgb(100 "test" 100);
: ^
`----
x Expected percentage, number, function (math functions) or ident (with 'none' value) token
,-[$DIR/tests/recovery/function/rgb/input.css:11:5]
11 | color: rgb(100 100 "test");
@ -142,9 +52,3 @@
12 | color: rgb(100 100 100 / "test");
: ^^^^^^
`----
x Expected percentage, number, function (math functions) or ident (with 'none' value) token
,-[$DIR/tests/recovery/function/rgb/input.css:12:5]
12 | color: rgb(100 100 100 / "test");
: ^
`----

View File

@ -181,7 +181,7 @@
: ^^^^^^
`----
x Str
x String { value: Atom('test' type=inline), raw: Atom('"test"' type=inline) }
,-[$DIR/tests/recovery/function/rgb/input.css:2:5]
2 | color: rgb("test");
: ^^^^^^
@ -247,7 +247,7 @@
: ^^^^^^
`----
x Str
x String { value: Atom('test' type=inline), raw: Atom('"test"' type=inline) }
,-[$DIR/tests/recovery/function/rgb/input.css:4:5]
4 | color: rgb("test", 100, 100);
: ^^^^^^
@ -259,19 +259,31 @@
: ^
`----
x Delimiter
x Comma
,-[$DIR/tests/recovery/function/rgb/input.css:4:5]
4 | color: rgb("test", 100, 100);
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/function/rgb/input.css:4:5]
4 | color: rgb("test", 100, 100);
: ^
`----
x WhiteSpace { value: Atom(' ' type=inline) }
,-[$DIR/tests/recovery/function/rgb/input.css:4:5]
4 | color: rgb("test", 100, 100);
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/function/rgb/input.css:4:5]
4 | color: rgb("test", 100, 100);
: ^^^
`----
x Integer
x Number { value: 100.0, raw: Atom('100' type=inline), type_flag: Integer }
,-[$DIR/tests/recovery/function/rgb/input.css:4:5]
4 | color: rgb("test", 100, 100);
: ^^^
@ -283,19 +295,31 @@
: ^
`----
x Delimiter
x Comma
,-[$DIR/tests/recovery/function/rgb/input.css:4:5]
4 | color: rgb("test", 100, 100);
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/function/rgb/input.css:4:5]
4 | color: rgb("test", 100, 100);
: ^
`----
x WhiteSpace { value: Atom(' ' type=inline) }
,-[$DIR/tests/recovery/function/rgb/input.css:4:5]
4 | color: rgb("test", 100, 100);
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/function/rgb/input.css:4:5]
4 | color: rgb("test", 100, 100);
: ^^^
`----
x Integer
x Number { value: 100.0, raw: Atom('100' type=inline), type_flag: Integer }
,-[$DIR/tests/recovery/function/rgb/input.css:4:5]
4 | color: rgb("test", 100, 100);
: ^^^
@ -361,7 +385,7 @@
: ^^^
`----
x Integer
x Number { value: 100.0, raw: Atom('100' type=inline), type_flag: Integer }
,-[$DIR/tests/recovery/function/rgb/input.css:5:5]
5 | color: rgb(100, "test", 100);
: ^^^
@ -373,19 +397,31 @@
: ^
`----
x Delimiter
x Comma
,-[$DIR/tests/recovery/function/rgb/input.css:5:5]
5 | color: rgb(100, "test", 100);
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/function/rgb/input.css:5:5]
5 | color: rgb(100, "test", 100);
: ^
`----
x WhiteSpace { value: Atom(' ' type=inline) }
,-[$DIR/tests/recovery/function/rgb/input.css:5:5]
5 | color: rgb(100, "test", 100);
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/function/rgb/input.css:5:5]
5 | color: rgb(100, "test", 100);
: ^^^^^^
`----
x Str
x String { value: Atom('test' type=inline), raw: Atom('"test"' type=inline) }
,-[$DIR/tests/recovery/function/rgb/input.css:5:5]
5 | color: rgb(100, "test", 100);
: ^^^^^^
@ -397,19 +433,31 @@
: ^
`----
x Delimiter
x Comma
,-[$DIR/tests/recovery/function/rgb/input.css:5:5]
5 | color: rgb(100, "test", 100);
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/function/rgb/input.css:5:5]
5 | color: rgb(100, "test", 100);
: ^
`----
x WhiteSpace { value: Atom(' ' type=inline) }
,-[$DIR/tests/recovery/function/rgb/input.css:5:5]
5 | color: rgb(100, "test", 100);
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/function/rgb/input.css:5:5]
5 | color: rgb(100, "test", 100);
: ^^^
`----
x Integer
x Number { value: 100.0, raw: Atom('100' type=inline), type_flag: Integer }
,-[$DIR/tests/recovery/function/rgb/input.css:5:5]
5 | color: rgb(100, "test", 100);
: ^^^
@ -475,7 +523,7 @@
: ^^^
`----
x Integer
x Number { value: 100.0, raw: Atom('100' type=inline), type_flag: Integer }
,-[$DIR/tests/recovery/function/rgb/input.css:6:5]
6 | color: rgb(100, 100, "test");
: ^^^
@ -487,19 +535,31 @@
: ^
`----
x Delimiter
x Comma
,-[$DIR/tests/recovery/function/rgb/input.css:6:5]
6 | color: rgb(100, 100, "test");
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/function/rgb/input.css:6:5]
6 | color: rgb(100, 100, "test");
: ^
`----
x WhiteSpace { value: Atom(' ' type=inline) }
,-[$DIR/tests/recovery/function/rgb/input.css:6:5]
6 | color: rgb(100, 100, "test");
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/function/rgb/input.css:6:5]
6 | color: rgb(100, 100, "test");
: ^^^
`----
x Integer
x Number { value: 100.0, raw: Atom('100' type=inline), type_flag: Integer }
,-[$DIR/tests/recovery/function/rgb/input.css:6:5]
6 | color: rgb(100, 100, "test");
: ^^^
@ -511,19 +571,31 @@
: ^
`----
x Delimiter
x Comma
,-[$DIR/tests/recovery/function/rgb/input.css:6:5]
6 | color: rgb(100, 100, "test");
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/function/rgb/input.css:6:5]
6 | color: rgb(100, 100, "test");
: ^
`----
x WhiteSpace { value: Atom(' ' type=inline) }
,-[$DIR/tests/recovery/function/rgb/input.css:6:5]
6 | color: rgb(100, 100, "test");
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/function/rgb/input.css:6:5]
6 | color: rgb(100, 100, "test");
: ^^^^^^
`----
x Str
x String { value: Atom('test' type=inline), raw: Atom('"test"' type=inline) }
,-[$DIR/tests/recovery/function/rgb/input.css:6:5]
6 | color: rgb(100, 100, "test");
: ^^^^^^
@ -589,7 +661,7 @@
: ^^^
`----
x Integer
x Number { value: 100.0, raw: Atom('100' type=inline), type_flag: Integer }
,-[$DIR/tests/recovery/function/rgb/input.css:7:5]
7 | color: rgb(100, 100, 100, "test");
: ^^^
@ -601,19 +673,31 @@
: ^
`----
x Delimiter
x Comma
,-[$DIR/tests/recovery/function/rgb/input.css:7:5]
7 | color: rgb(100, 100, 100, "test");
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/function/rgb/input.css:7:5]
7 | color: rgb(100, 100, 100, "test");
: ^
`----
x WhiteSpace { value: Atom(' ' type=inline) }
,-[$DIR/tests/recovery/function/rgb/input.css:7:5]
7 | color: rgb(100, 100, 100, "test");
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/function/rgb/input.css:7:5]
7 | color: rgb(100, 100, 100, "test");
: ^^^
`----
x Integer
x Number { value: 100.0, raw: Atom('100' type=inline), type_flag: Integer }
,-[$DIR/tests/recovery/function/rgb/input.css:7:5]
7 | color: rgb(100, 100, 100, "test");
: ^^^
@ -625,19 +709,31 @@
: ^
`----
x Delimiter
x Comma
,-[$DIR/tests/recovery/function/rgb/input.css:7:5]
7 | color: rgb(100, 100, 100, "test");
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/function/rgb/input.css:7:5]
7 | color: rgb(100, 100, 100, "test");
: ^
`----
x WhiteSpace { value: Atom(' ' type=inline) }
,-[$DIR/tests/recovery/function/rgb/input.css:7:5]
7 | color: rgb(100, 100, 100, "test");
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/function/rgb/input.css:7:5]
7 | color: rgb(100, 100, 100, "test");
: ^^^
`----
x Integer
x Number { value: 100.0, raw: Atom('100' type=inline), type_flag: Integer }
,-[$DIR/tests/recovery/function/rgb/input.css:7:5]
7 | color: rgb(100, 100, 100, "test");
: ^^^
@ -649,19 +745,31 @@
: ^
`----
x Delimiter
x Comma
,-[$DIR/tests/recovery/function/rgb/input.css:7:5]
7 | color: rgb(100, 100, 100, "test");
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/function/rgb/input.css:7:5]
7 | color: rgb(100, 100, 100, "test");
: ^
`----
x WhiteSpace { value: Atom(' ' type=inline) }
,-[$DIR/tests/recovery/function/rgb/input.css:7:5]
7 | color: rgb(100, 100, 100, "test");
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/function/rgb/input.css:7:5]
7 | color: rgb(100, 100, 100, "test");
: ^^^^^^
`----
x Str
x String { value: Atom('test' type=inline), raw: Atom('"test"' type=inline) }
,-[$DIR/tests/recovery/function/rgb/input.css:7:5]
7 | color: rgb(100, 100, 100, "test");
: ^^^^^^
@ -727,31 +835,55 @@
: ^^^^^^
`----
x Str
x String { value: Atom('test' type=inline), raw: Atom('"test"' type=inline) }
,-[$DIR/tests/recovery/function/rgb/input.css:9:5]
9 | color: rgb("test" 100 100);
: ^^^^^^
`----
x ComponentValue
,-[$DIR/tests/recovery/function/rgb/input.css:9:5]
9 | color: rgb("test" 100 100);
: ^
`----
x WhiteSpace { value: Atom(' ' type=inline) }
,-[$DIR/tests/recovery/function/rgb/input.css:9:5]
9 | color: rgb("test" 100 100);
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/function/rgb/input.css:9:5]
9 | color: rgb("test" 100 100);
: ^^^
`----
x Integer
x Number { value: 100.0, raw: Atom('100' type=inline), type_flag: Integer }
,-[$DIR/tests/recovery/function/rgb/input.css:9:5]
9 | color: rgb("test" 100 100);
: ^^^
`----
x ComponentValue
,-[$DIR/tests/recovery/function/rgb/input.css:9:5]
9 | color: rgb("test" 100 100);
: ^
`----
x WhiteSpace { value: Atom(' ' type=inline) }
,-[$DIR/tests/recovery/function/rgb/input.css:9:5]
9 | color: rgb("test" 100 100);
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/function/rgb/input.css:9:5]
9 | color: rgb("test" 100 100);
: ^^^
`----
x Integer
x Number { value: 100.0, raw: Atom('100' type=inline), type_flag: Integer }
,-[$DIR/tests/recovery/function/rgb/input.css:9:5]
9 | color: rgb("test" 100 100);
: ^^^
@ -817,31 +949,55 @@
: ^^^
`----
x Integer
x Number { value: 100.0, raw: Atom('100' type=inline), type_flag: Integer }
,-[$DIR/tests/recovery/function/rgb/input.css:10:5]
10 | color: rgb(100 "test" 100);
: ^^^
`----
x ComponentValue
,-[$DIR/tests/recovery/function/rgb/input.css:10:5]
10 | color: rgb(100 "test" 100);
: ^
`----
x WhiteSpace { value: Atom(' ' type=inline) }
,-[$DIR/tests/recovery/function/rgb/input.css:10:5]
10 | color: rgb(100 "test" 100);
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/function/rgb/input.css:10:5]
10 | color: rgb(100 "test" 100);
: ^^^^^^
`----
x Str
x String { value: Atom('test' type=inline), raw: Atom('"test"' type=inline) }
,-[$DIR/tests/recovery/function/rgb/input.css:10:5]
10 | color: rgb(100 "test" 100);
: ^^^^^^
`----
x ComponentValue
,-[$DIR/tests/recovery/function/rgb/input.css:10:5]
10 | color: rgb(100 "test" 100);
: ^
`----
x WhiteSpace { value: Atom(' ' type=inline) }
,-[$DIR/tests/recovery/function/rgb/input.css:10:5]
10 | color: rgb(100 "test" 100);
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/function/rgb/input.css:10:5]
10 | color: rgb(100 "test" 100);
: ^^^
`----
x Integer
x Number { value: 100.0, raw: Atom('100' type=inline), type_flag: Integer }
,-[$DIR/tests/recovery/function/rgb/input.css:10:5]
10 | color: rgb(100 "test" 100);
: ^^^
@ -907,31 +1063,55 @@
: ^^^
`----
x Integer
x Number { value: 100.0, raw: Atom('100' type=inline), type_flag: Integer }
,-[$DIR/tests/recovery/function/rgb/input.css:11:5]
11 | color: rgb(100 100 "test");
: ^^^
`----
x ComponentValue
,-[$DIR/tests/recovery/function/rgb/input.css:11:5]
11 | color: rgb(100 100 "test");
: ^
`----
x WhiteSpace { value: Atom(' ' type=inline) }
,-[$DIR/tests/recovery/function/rgb/input.css:11:5]
11 | color: rgb(100 100 "test");
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/function/rgb/input.css:11:5]
11 | color: rgb(100 100 "test");
: ^^^
`----
x Integer
x Number { value: 100.0, raw: Atom('100' type=inline), type_flag: Integer }
,-[$DIR/tests/recovery/function/rgb/input.css:11:5]
11 | color: rgb(100 100 "test");
: ^^^
`----
x ComponentValue
,-[$DIR/tests/recovery/function/rgb/input.css:11:5]
11 | color: rgb(100 100 "test");
: ^
`----
x WhiteSpace { value: Atom(' ' type=inline) }
,-[$DIR/tests/recovery/function/rgb/input.css:11:5]
11 | color: rgb(100 100 "test");
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/function/rgb/input.css:11:5]
11 | color: rgb(100 100 "test");
: ^^^^^^
`----
x Str
x String { value: Atom('test' type=inline), raw: Atom('"test"' type=inline) }
,-[$DIR/tests/recovery/function/rgb/input.css:11:5]
11 | color: rgb(100 100 "test");
: ^^^^^^
@ -997,31 +1177,55 @@
: ^^^
`----
x Integer
x Number { value: 100.0, raw: Atom('100' type=inline), type_flag: Integer }
,-[$DIR/tests/recovery/function/rgb/input.css:12:5]
12 | color: rgb(100 100 100 / "test");
: ^^^
`----
x ComponentValue
,-[$DIR/tests/recovery/function/rgb/input.css:12:5]
12 | color: rgb(100 100 100 / "test");
: ^
`----
x WhiteSpace { value: Atom(' ' type=inline) }
,-[$DIR/tests/recovery/function/rgb/input.css:12:5]
12 | color: rgb(100 100 100 / "test");
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/function/rgb/input.css:12:5]
12 | color: rgb(100 100 100 / "test");
: ^^^
`----
x Integer
x Number { value: 100.0, raw: Atom('100' type=inline), type_flag: Integer }
,-[$DIR/tests/recovery/function/rgb/input.css:12:5]
12 | color: rgb(100 100 100 / "test");
: ^^^
`----
x ComponentValue
,-[$DIR/tests/recovery/function/rgb/input.css:12:5]
12 | color: rgb(100 100 100 / "test");
: ^
`----
x WhiteSpace { value: Atom(' ' type=inline) }
,-[$DIR/tests/recovery/function/rgb/input.css:12:5]
12 | color: rgb(100 100 100 / "test");
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/function/rgb/input.css:12:5]
12 | color: rgb(100 100 100 / "test");
: ^^^
`----
x Integer
x Number { value: 100.0, raw: Atom('100' type=inline), type_flag: Integer }
,-[$DIR/tests/recovery/function/rgb/input.css:12:5]
12 | color: rgb(100 100 100 / "test");
: ^^^
@ -1030,22 +1234,46 @@
x ComponentValue
,-[$DIR/tests/recovery/function/rgb/input.css:12:5]
12 | color: rgb(100 100 100 / "test");
: ^
: ^
`----
x Delimiter
x WhiteSpace { value: Atom(' ' type=inline) }
,-[$DIR/tests/recovery/function/rgb/input.css:12:5]
12 | color: rgb(100 100 100 / "test");
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/function/rgb/input.css:12:5]
12 | color: rgb(100 100 100 / "test");
: ^
`----
x Delim { value: '/' }
,-[$DIR/tests/recovery/function/rgb/input.css:12:5]
12 | color: rgb(100 100 100 / "test");
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/function/rgb/input.css:12:5]
12 | color: rgb(100 100 100 / "test");
: ^
`----
x WhiteSpace { value: Atom(' ' type=inline) }
,-[$DIR/tests/recovery/function/rgb/input.css:12:5]
12 | color: rgb(100 100 100 / "test");
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/function/rgb/input.css:12:5]
12 | color: rgb(100 100 100 / "test");
: ^^^^^^
`----
x Str
x String { value: Atom('test' type=inline), raw: Atom('"test"' type=inline) }
,-[$DIR/tests/recovery/function/rgb/input.css:12:5]
12 | color: rgb(100 100 100 / "test");
: ^^^^^^

View File

@ -5,8 +5,15 @@
: ^
`----
x Unexpected end of file
,-[$DIR/tests/recovery/function/unclosed-2/input.css:3:3]
3 |
: ^
x Unexpected end of file, but expected ')'
,-[$DIR/tests/recovery/function/unclosed-2/input.css:2:5]
2 | ,-> grid-template-columns: repeat(4, [col-start] 12px
3 | `-> }
`----
x Unexpected end of file, but expected '}'
,-[$DIR/tests/recovery/function/unclosed-2/input.css:1:1]
1 | ,-> .style {
2 | | grid-template-columns: repeat(4, [col-start] 12px
3 | `-> }
`----

View File

@ -0,0 +1,2 @@
.style {
grid-template-columns: rgb(255, 255, 255

View File

@ -0,0 +1,176 @@
{
"type": "Stylesheet",
"span": {
"start": 1,
"end": 51,
"ctxt": 0
},
"rules": [
{
"type": "QualifiedRule",
"span": {
"start": 1,
"end": 51,
"ctxt": 0
},
"prelude": {
"type": "SelectorList",
"span": {
"start": 1,
"end": 7,
"ctxt": 0
},
"children": [
{
"type": "ComplexSelector",
"span": {
"start": 1,
"end": 7,
"ctxt": 0
},
"children": [
{
"type": "CompoundSelector",
"span": {
"start": 1,
"end": 7,
"ctxt": 0
},
"nestingSelector": null,
"typeSelector": null,
"subclassSelectors": [
{
"type": "ClassSelector",
"span": {
"start": 1,
"end": 7,
"ctxt": 0
},
"text": {
"type": "Ident",
"span": {
"start": 2,
"end": 7,
"ctxt": 0
},
"value": "style",
"raw": "style"
}
}
]
}
]
}
]
},
"block": {
"type": "SimpleBlock",
"span": {
"start": 8,
"end": 51,
"ctxt": 0
},
"name": {
"type": "PreservedToken",
"span": {
"start": 8,
"end": 9,
"ctxt": 0
},
"token": "LBrace"
},
"value": [
{
"type": "Declaration",
"span": {
"start": 11,
"end": 51,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 11,
"end": 32,
"ctxt": 0
},
"value": "grid-template-columns",
"raw": "grid-template-columns"
},
"value": [
{
"type": "Function",
"span": {
"start": 34,
"end": 51,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 34,
"end": 37,
"ctxt": 0
},
"value": "rgb",
"raw": "rgb"
},
"value": [
{
"type": "Number",
"span": {
"start": 38,
"end": 41,
"ctxt": 0
},
"value": 255.0,
"raw": "255"
},
{
"type": "Delimiter",
"span": {
"start": 41,
"end": 42,
"ctxt": 0
},
"value": ","
},
{
"type": "Number",
"span": {
"start": 43,
"end": 46,
"ctxt": 0
},
"value": 255.0,
"raw": "255"
},
{
"type": "Delimiter",
"span": {
"start": 46,
"end": 47,
"ctxt": 0
},
"value": ","
},
{
"type": "Number",
"span": {
"start": 48,
"end": 51,
"ctxt": 0
},
"value": 255.0,
"raw": "255"
}
]
}
],
"important": null
}
]
}
}
]
}

View File

@ -0,0 +1,12 @@
x Unexpected end of file, but expected ')'
,-[$DIR/tests/recovery/function/unclosed-3/input.css:2:5]
2 | grid-template-columns: rgb(255, 255, 255
: ^^^^^^^^^^^^^^^^^
`----
x Unexpected end of file, but expected '}'
,-[$DIR/tests/recovery/function/unclosed-3/input.css:1:1]
1 | ,-> .style {
2 | `-> grid-template-columns: rgb(255, 255, 255
`----

View File

@ -0,0 +1,180 @@
x Stylesheet
,-[$DIR/tests/recovery/function/unclosed-3/input.css:1:1]
1 | ,-> .style {
2 | `-> grid-template-columns: rgb(255, 255, 255
`----
x Rule
,-[$DIR/tests/recovery/function/unclosed-3/input.css:1:1]
1 | ,-> .style {
2 | `-> grid-template-columns: rgb(255, 255, 255
`----
x QualifiedRule
,-[$DIR/tests/recovery/function/unclosed-3/input.css:1:1]
1 | ,-> .style {
2 | `-> grid-template-columns: rgb(255, 255, 255
`----
x SelectorList
,-[$DIR/tests/recovery/function/unclosed-3/input.css:1:1]
1 | .style {
: ^^^^^^
`----
x ComplexSelector
,-[$DIR/tests/recovery/function/unclosed-3/input.css:1:1]
1 | .style {
: ^^^^^^
`----
x CompoundSelector
,-[$DIR/tests/recovery/function/unclosed-3/input.css:1:1]
1 | .style {
: ^^^^^^
`----
x SubclassSelector
,-[$DIR/tests/recovery/function/unclosed-3/input.css:1:1]
1 | .style {
: ^^^^^^
`----
x ClassSelector
,-[$DIR/tests/recovery/function/unclosed-3/input.css:1:1]
1 | .style {
: ^^^^^^
`----
x Ident
,-[$DIR/tests/recovery/function/unclosed-3/input.css:1:1]
1 | .style {
: ^^^^^
`----
x SimpleBlock
,-[$DIR/tests/recovery/function/unclosed-3/input.css:1:1]
1 | ,-> .style {
2 | `-> grid-template-columns: rgb(255, 255, 255
`----
x LBrace
,-[$DIR/tests/recovery/function/unclosed-3/input.css:1:1]
1 | .style {
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/function/unclosed-3/input.css:2:5]
2 | grid-template-columns: rgb(255, 255, 255
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
`----
x StyleBlock
,-[$DIR/tests/recovery/function/unclosed-3/input.css:2:5]
2 | grid-template-columns: rgb(255, 255, 255
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
`----
x Declaration
,-[$DIR/tests/recovery/function/unclosed-3/input.css:2:5]
2 | grid-template-columns: rgb(255, 255, 255
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
`----
x DeclarationName
,-[$DIR/tests/recovery/function/unclosed-3/input.css:2:5]
2 | grid-template-columns: rgb(255, 255, 255
: ^^^^^^^^^^^^^^^^^^^^^
`----
x Ident
,-[$DIR/tests/recovery/function/unclosed-3/input.css:2:5]
2 | grid-template-columns: rgb(255, 255, 255
: ^^^^^^^^^^^^^^^^^^^^^
`----
x ComponentValue
,-[$DIR/tests/recovery/function/unclosed-3/input.css:2:5]
2 | grid-template-columns: rgb(255, 255, 255
: ^^^^^^^^^^^^^^^^^
`----
x Color
,-[$DIR/tests/recovery/function/unclosed-3/input.css:2:5]
2 | grid-template-columns: rgb(255, 255, 255
: ^^^^^^^^^^^^^^^^^
`----
x Function
,-[$DIR/tests/recovery/function/unclosed-3/input.css:2:5]
2 | grid-template-columns: rgb(255, 255, 255
: ^^^^^^^^^^^^^^^^^
`----
x Ident
,-[$DIR/tests/recovery/function/unclosed-3/input.css:2:5]
2 | grid-template-columns: rgb(255, 255, 255
: ^^^
`----
x ComponentValue
,-[$DIR/tests/recovery/function/unclosed-3/input.css:2:5]
2 | grid-template-columns: rgb(255, 255, 255
: ^^^
`----
x Number
,-[$DIR/tests/recovery/function/unclosed-3/input.css:2:5]
2 | grid-template-columns: rgb(255, 255, 255
: ^^^
`----
x ComponentValue
,-[$DIR/tests/recovery/function/unclosed-3/input.css:2:5]
2 | grid-template-columns: rgb(255, 255, 255
: ^
`----
x Delimiter
,-[$DIR/tests/recovery/function/unclosed-3/input.css:2:5]
2 | grid-template-columns: rgb(255, 255, 255
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/function/unclosed-3/input.css:2:5]
2 | grid-template-columns: rgb(255, 255, 255
: ^^^
`----
x Number
,-[$DIR/tests/recovery/function/unclosed-3/input.css:2:5]
2 | grid-template-columns: rgb(255, 255, 255
: ^^^
`----
x ComponentValue
,-[$DIR/tests/recovery/function/unclosed-3/input.css:2:5]
2 | grid-template-columns: rgb(255, 255, 255
: ^
`----
x Delimiter
,-[$DIR/tests/recovery/function/unclosed-3/input.css:2:5]
2 | grid-template-columns: rgb(255, 255, 255
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/function/unclosed-3/input.css:2:5]
2 | grid-template-columns: rgb(255, 255, 255
: ^^^
`----
x Number
,-[$DIR/tests/recovery/function/unclosed-3/input.css:2:5]
2 | grid-template-columns: rgb(255, 255, 255
: ^^^
`----

View File

@ -117,21 +117,52 @@
},
"value": [
{
"type": "PreservedToken",
"type": "CalcSum",
"span": {
"start": 22,
"end": 27,
"ctxt": 0
},
"token": {
"Dimension": {
"value": 500.0,
"raw_value": "500",
"unit": "px",
"raw_unit": "px",
"type": "integer"
"expressions": [
{
"type": "CalcProduct",
"span": {
"start": 22,
"end": 27,
"ctxt": 0
},
"expressions": [
{
"type": "Length",
"span": {
"start": 22,
"end": 27,
"ctxt": 0
},
"value": {
"type": "Number",
"span": {
"start": 22,
"end": 25,
"ctxt": 0
},
"value": 500.0,
"raw": "500"
},
"unit": {
"type": "Ident",
"span": {
"start": 25,
"end": 27,
"ctxt": 0
},
"value": "px",
"raw": "px"
}
}
]
}
}
]
},
{
"type": "PreservedToken",

View File

@ -5,20 +5,15 @@
: ^
`----
x Expected 'number', 'dimension', 'percentage', 'ident', '(' or 'function' tokens
,-[$DIR/tests/recovery/function/unclosed/input.css:3:1]
3 | }
: ^
x Unexpected end of file, but expected ')'
,-[$DIR/tests/recovery/function/unclosed/input.css:2:5]
2 | ,-> width: min(500px;
3 | `-> }
`----
x Expected Declaration value
,-[$DIR/tests/recovery/function/unclosed/input.css:3:1]
3 | }
: ^
`----
x Unexpected end of file
,-[$DIR/tests/recovery/function/unclosed/input.css:3:3]
3 |
: ^
x Unexpected end of file, but expected '}'
,-[$DIR/tests/recovery/function/unclosed/input.css:1:1]
1 | ,-> .style {
2 | | width: min(500px;
3 | `-> }
`----

View File

@ -123,12 +123,60 @@
: ^^^^^
`----
x Dimension { value: 500.0, raw_value: Atom('500' type=inline), unit: Atom('px' type=static), raw_unit: Atom('px' type=static), type_flag: Integer }
x CalcSum
,-[$DIR/tests/recovery/function/unclosed/input.css:2:5]
2 | width: min(500px;
: ^^^^^
`----
x CalcProductOrOperator
,-[$DIR/tests/recovery/function/unclosed/input.css:2:5]
2 | width: min(500px;
: ^^^^^
`----
x CalcProduct
,-[$DIR/tests/recovery/function/unclosed/input.css:2:5]
2 | width: min(500px;
: ^^^^^
`----
x CalcValueOrOperator
,-[$DIR/tests/recovery/function/unclosed/input.css:2:5]
2 | width: min(500px;
: ^^^^^
`----
x CalcValue
,-[$DIR/tests/recovery/function/unclosed/input.css:2:5]
2 | width: min(500px;
: ^^^^^
`----
x Dimension
,-[$DIR/tests/recovery/function/unclosed/input.css:2:5]
2 | width: min(500px;
: ^^^^^
`----
x Length
,-[$DIR/tests/recovery/function/unclosed/input.css:2:5]
2 | width: min(500px;
: ^^^^^
`----
x Number
,-[$DIR/tests/recovery/function/unclosed/input.css:2:5]
2 | width: min(500px;
: ^^^
`----
x Ident
,-[$DIR/tests/recovery/function/unclosed/input.css:2:5]
2 | width: min(500px;
: ^^
`----
x ComponentValue
,-[$DIR/tests/recovery/function/unclosed/input.css:2:5]
2 | width: min(500px;

View File

@ -11708,49 +11708,23 @@
},
"value": [
{
"type": "ListOfComponentValues",
"type": "Declaration",
"span": {
"start": 3443,
"end": 3463,
"end": 3462,
"ctxt": 0
},
"children": [
{
"type": "PreservedToken",
"span": {
"start": 3443,
"end": 3451,
"ctxt": 0
},
"token": {
"Ident": {
"value": "property",
"raw": "property"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 3451,
"end": 3452,
"ctxt": 0
},
"token": "Colon"
},
{
"type": "PreservedToken",
"span": {
"start": 3452,
"end": 3453,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
"name": {
"type": "Ident",
"span": {
"start": 3443,
"end": 3451,
"ctxt": 0
},
"value": "property",
"raw": "property"
},
"value": [
{
"type": "PreservedToken",
"span": {
@ -11804,17 +11778,9 @@
"raw": "ie"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 3462,
"end": 3463,
"ctxt": 0
},
"token": "Semi"
}
]
],
"important": null
}
]
}

View File

@ -1,16 +1,16 @@
x Expected Declaration value
,-[$DIR/tests/recovery/hacks/input.css:180:1]
180 | .selector { property: value !ie; }
: ^
`----
x Expected Ident
,-[$DIR/tests/recovery/hacks/input.css:136:5]
136 | @property: value;
: ^
`----
x Expected important
,-[$DIR/tests/recovery/hacks/input.css:180:1]
180 | .selector { property: value !ie; }
: ^
`----
x Expected whitespace, semicolon, EOF, at-keyword, '&' or ident token
,-[$DIR/tests/recovery/hacks/input.css:13:1]
13 | .selector { (;property: value;); }
@ -167,10 +167,17 @@
: ^
`----
x Unexpected end of file
,-[$DIR/tests/recovery/hacks/input.css:114:1]
114 | }
: ^
x Unexpected '!' in <declaration-value>
,-[$DIR/tests/recovery/hacks/input.css:180:1]
180 | .selector { property: value !ie; }
: ^
`----
x Unexpected end of file, but expected '{'
,-[$DIR/tests/recovery/hacks/input.css:112:5]
112 | ,-> &property: value;
113 | `-> color: red;
114 | }
`----
x Unexpected tokens in at-rule prelude

View File

@ -11458,51 +11458,33 @@
x ComponentValue
,-[$DIR/tests/recovery/hacks/input.css:180:1]
180 | .selector { property: value !ie; }
: ^^^^^^^^^^^^^^^^^^^^
: ^^^^^^^^^^^^^^^^^^^
`----
x StyleBlock
,-[$DIR/tests/recovery/hacks/input.css:180:1]
180 | .selector { property: value !ie; }
: ^^^^^^^^^^^^^^^^^^^^
: ^^^^^^^^^^^^^^^^^^^
`----
x ComponentValue
x Declaration
,-[$DIR/tests/recovery/hacks/input.css:180:1]
180 | .selector { property: value !ie; }
: ^^^^^^^^^^^^^^^^^^^
`----
x DeclarationName
,-[$DIR/tests/recovery/hacks/input.css:180:1]
180 | .selector { property: value !ie; }
: ^^^^^^^^
`----
x Ident { value: Atom('property' type=static), raw: Atom('property' type=static) }
x Ident
,-[$DIR/tests/recovery/hacks/input.css:180:1]
180 | .selector { property: value !ie; }
: ^^^^^^^^
`----
x ComponentValue
,-[$DIR/tests/recovery/hacks/input.css:180:1]
180 | .selector { property: value !ie; }
: ^
`----
x Colon
,-[$DIR/tests/recovery/hacks/input.css:180:1]
180 | .selector { property: value !ie; }
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/hacks/input.css:180:1]
180 | .selector { property: value !ie; }
: ^
`----
x WhiteSpace { value: Atom(' ' type=inline) }
,-[$DIR/tests/recovery/hacks/input.css:180:1]
180 | .selector { property: value !ie; }
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/hacks/input.css:180:1]
180 | .selector { property: value !ie; }
@ -11551,18 +11533,6 @@
: ^^
`----
x ComponentValue
,-[$DIR/tests/recovery/hacks/input.css:180:1]
180 | .selector { property: value !ie; }
: ^
`----
x Semi
,-[$DIR/tests/recovery/hacks/input.css:180:1]
180 | .selector { property: value !ie; }
: ^
`----
x Rule
,-[$DIR/tests/recovery/hacks/input.css:182:1]
182 | @media screen\9 {}

View File

@ -106,14 +106,18 @@
},
"value": [
{
"type": "Ident",
"type": "PreservedToken",
"span": {
"start": 16,
"end": 22,
"ctxt": 0
},
"value": "progid",
"raw": "progid"
"token": {
"Ident": {
"value": "progid",
"raw": "progid"
}
}
},
{
"type": "PreservedToken",
@ -125,14 +129,18 @@
"token": "Colon"
},
{
"type": "Ident",
"type": "PreservedToken",
"span": {
"start": 23,
"end": 39,
"ctxt": 0
},
"value": "DXImageTransform",
"raw": "DXImageTransform"
"token": {
"Ident": {
"value": "DXImageTransform",
"raw": "DXImageTransform"
}
}
},
{
"type": "PreservedToken",
@ -148,14 +156,18 @@
}
},
{
"type": "Ident",
"type": "PreservedToken",
"span": {
"start": 40,
"end": 49,
"ctxt": 0
},
"value": "Microsoft",
"raw": "Microsoft"
"token": {
"Ident": {
"value": "Microsoft",
"raw": "Microsoft"
}
}
},
{
"type": "PreservedToken",
@ -354,14 +366,18 @@
},
"value": [
{
"type": "Ident",
"type": "PreservedToken",
"span": {
"start": 134,
"end": 140,
"ctxt": 0
},
"value": "progid",
"raw": "progid"
"token": {
"Ident": {
"value": "progid",
"raw": "progid"
}
}
},
{
"type": "PreservedToken",
@ -373,14 +389,18 @@
"token": "Colon"
},
{
"type": "Ident",
"type": "PreservedToken",
"span": {
"start": 141,
"end": 157,
"ctxt": 0
},
"value": "DXImageTransform",
"raw": "DXImageTransform"
"token": {
"Ident": {
"value": "DXImageTransform",
"raw": "DXImageTransform"
}
}
},
{
"type": "PreservedToken",
@ -396,14 +416,18 @@
}
},
{
"type": "Ident",
"type": "PreservedToken",
"span": {
"start": 158,
"end": 167,
"ctxt": 0
},
"value": "Microsoft",
"raw": "Microsoft"
"token": {
"Ident": {
"value": "Microsoft",
"raw": "Microsoft"
}
}
},
{
"type": "PreservedToken",
@ -481,14 +505,31 @@
]
},
{
"type": "Ident",
"type": "PreservedToken",
"span": {
"start": 187,
"end": 188,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 188,
"end": 194,
"ctxt": 0
},
"value": "progid",
"raw": "progid"
"token": {
"Ident": {
"value": "progid",
"raw": "progid"
}
}
},
{
"type": "PreservedToken",
@ -500,14 +541,18 @@
"token": "Colon"
},
{
"type": "Ident",
"type": "PreservedToken",
"span": {
"start": 195,
"end": 211,
"ctxt": 0
},
"value": "DXImageTransform",
"raw": "DXImageTransform"
"token": {
"Ident": {
"value": "DXImageTransform",
"raw": "DXImageTransform"
}
}
},
{
"type": "PreservedToken",
@ -523,14 +568,18 @@
}
},
{
"type": "Ident",
"type": "PreservedToken",
"span": {
"start": 212,
"end": 221,
"ctxt": 0
},
"value": "Microsoft",
"raw": "Microsoft"
"token": {
"Ident": {
"value": "Microsoft",
"raw": "Microsoft"
}
}
},
{
"type": "PreservedToken",

View File

@ -5,68 +5,8 @@
: ^
`----
x Expected Declaration value
,-[$DIR/tests/recovery/ie-progid/input.css:2:5]
2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0);
: ^
`----
x Expected Declaration value
,-[$DIR/tests/recovery/ie-progid/input.css:2:5]
2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0);
: ^
`----
x Expected Declaration value
,-[$DIR/tests/recovery/ie-progid/input.css:2:5]
2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0);
: ^
`----
x Expected Declaration value
,-[$DIR/tests/recovery/ie-progid/input.css:3:5]
3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3);
: ^
`----
x Expected Declaration value
,-[$DIR/tests/recovery/ie-progid/input.css:3:5]
3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3);
: ^
`----
x Expected Declaration value
,-[$DIR/tests/recovery/ie-progid/input.css:3:5]
3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3);
: ^
`----
x Expected Declaration value
,-[$DIR/tests/recovery/ie-progid/input.css:3:5]
3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3);
: ^
`----
x Expected Declaration value
,-[$DIR/tests/recovery/ie-progid/input.css:3:5]
3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3);
: ^
`----
x Expected Declaration value
,-[$DIR/tests/recovery/ie-progid/input.css:3:5]
3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3);
: ^
`----
x Expected Declaration value
,-[$DIR/tests/recovery/ie-progid/input.css:3:5]
3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3);
: ^
`----
x Expected Declaration value
,-[$DIR/tests/recovery/ie-progid/input.css:3:5]
3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3);
: ^
`----

View File

@ -115,7 +115,7 @@
: ^^^^^^
`----
x Ident
x Ident { value: Atom('progid' type=inline), raw: Atom('progid' type=inline) }
,-[$DIR/tests/recovery/ie-progid/input.css:2:5]
2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0);
: ^^^^^^
@ -139,7 +139,7 @@
: ^^^^^^^^^^^^^^^^
`----
x Ident
x Ident { value: Atom('DXImageTransform' type=dynamic), raw: Atom('DXImageTransform' type=dynamic) }
,-[$DIR/tests/recovery/ie-progid/input.css:2:5]
2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0);
: ^^^^^^^^^^^^^^^^
@ -163,7 +163,7 @@
: ^^^^^^^^^
`----
x Ident
x Ident { value: Atom('Microsoft' type=dynamic), raw: Atom('Microsoft' type=dynamic) }
,-[$DIR/tests/recovery/ie-progid/input.css:2:5]
2 | filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f',endColorstr='#292929',GradientType=0);
: ^^^^^^^^^
@ -367,7 +367,7 @@
: ^^^^^^
`----
x Ident
x Ident { value: Atom('progid' type=inline), raw: Atom('progid' type=inline) }
,-[$DIR/tests/recovery/ie-progid/input.css:3:5]
3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3);
: ^^^^^^
@ -391,7 +391,7 @@
: ^^^^^^^^^^^^^^^^
`----
x Ident
x Ident { value: Atom('DXImageTransform' type=dynamic), raw: Atom('DXImageTransform' type=dynamic) }
,-[$DIR/tests/recovery/ie-progid/input.css:3:5]
3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3);
: ^^^^^^^^^^^^^^^^
@ -415,7 +415,7 @@
: ^^^^^^^^^
`----
x Ident
x Ident { value: Atom('Microsoft' type=dynamic), raw: Atom('Microsoft' type=dynamic) }
,-[$DIR/tests/recovery/ie-progid/input.css:3:5]
3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3);
: ^^^^^^^^^
@ -487,13 +487,25 @@
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/ie-progid/input.css:3:5]
3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3);
: ^
`----
x WhiteSpace { value: Atom(' ' type=inline) }
,-[$DIR/tests/recovery/ie-progid/input.css:3:5]
3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3);
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/ie-progid/input.css:3:5]
3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3);
: ^^^^^^
`----
x Ident
x Ident { value: Atom('progid' type=inline), raw: Atom('progid' type=inline) }
,-[$DIR/tests/recovery/ie-progid/input.css:3:5]
3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3);
: ^^^^^^
@ -517,7 +529,7 @@
: ^^^^^^^^^^^^^^^^
`----
x Ident
x Ident { value: Atom('DXImageTransform' type=dynamic), raw: Atom('DXImageTransform' type=dynamic) }
,-[$DIR/tests/recovery/ie-progid/input.css:3:5]
3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3);
: ^^^^^^^^^^^^^^^^
@ -541,7 +553,7 @@
: ^^^^^^^^^
`----
x Ident
x Ident { value: Atom('Microsoft' type=dynamic), raw: Atom('Microsoft' type=dynamic) }
,-[$DIR/tests/recovery/ie-progid/input.css:3:5]
3 | filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3);
: ^^^^^^^^^

View File

@ -106,42 +106,48 @@
},
"value": [
{
"type": "Length",
"type": "PreservedToken",
"span": {
"start": 15,
"end": 22,
"ctxt": 0
},
"value": {
"type": "Number",
"span": {
"start": 15,
"end": 20,
"ctxt": 0
},
"value": 10.1,
"raw": "10.10"
},
"unit": {
"type": "Ident",
"span": {
"start": 20,
"end": 22,
"ctxt": 0
},
"value": "px",
"raw": "px"
"token": {
"Dimension": {
"value": 10.1,
"raw_value": "10.10",
"unit": "px",
"raw_unit": "px",
"type": "number"
}
}
},
{
"type": "Ident",
"type": "PreservedToken",
"span": {
"start": 22,
"end": 27,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": "\n "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 27,
"end": 32,
"ctxt": 0
},
"value": "prop1",
"raw": "prop1"
"token": {
"Ident": {
"value": "prop1",
"raw": "prop1"
}
}
},
{
"type": "PreservedToken",
@ -153,42 +159,61 @@
"token": "Colon"
},
{
"type": "Length",
"type": "PreservedToken",
"span": {
"start": 33,
"end": 34,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 34,
"end": 38,
"ctxt": 0
},
"value": {
"type": "Number",
"span": {
"start": 34,
"end": 36,
"ctxt": 0
},
"value": 10.0,
"raw": "10"
},
"unit": {
"type": "Ident",
"span": {
"start": 36,
"end": 38,
"ctxt": 0
},
"value": "px",
"raw": "px"
"token": {
"Dimension": {
"value": 10.0,
"raw_value": "10",
"unit": "px",
"raw_unit": "px",
"type": "integer"
}
}
},
{
"type": "Ident",
"type": "PreservedToken",
"span": {
"start": 38,
"end": 43,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": "\n "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 43,
"end": 48,
"ctxt": 0
},
"value": "prop2",
"raw": "prop2"
"token": {
"Ident": {
"value": "prop2",
"raw": "prop2"
}
}
},
{
"type": "PreservedToken",
@ -200,24 +225,59 @@
"token": "Colon"
},
{
"type": "Integer",
"type": "PreservedToken",
"span": {
"start": 49,
"end": 50,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 50,
"end": 52,
"ctxt": 0
},
"value": 10,
"raw": "10"
"token": {
"Number": {
"value": 10.0,
"raw": "10",
"type": "integer"
}
}
},
{
"type": "Ident",
"type": "PreservedToken",
"span": {
"start": 52,
"end": 57,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": "\n "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 57,
"end": 62,
"ctxt": 0
},
"value": "prop3",
"raw": "prop3"
"token": {
"Ident": {
"value": "prop3",
"raw": "prop3"
}
}
},
{
"type": "PreservedToken",
@ -229,14 +289,32 @@
"token": "Colon"
},
{
"type": "Number",
"type": "PreservedToken",
"span": {
"start": 63,
"end": 64,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 64,
"end": 69,
"ctxt": 0
},
"value": 10.1,
"raw": "10.10"
"token": {
"Number": {
"value": 10.1,
"raw": "10.10",
"type": "number"
}
}
}
],
"important": null

View File

@ -4,15 +4,3 @@
3 | prop1: 10px
: ^
`----
x Expected Declaration value
,-[$DIR/tests/recovery/number/input.css:4:5]
4 | prop2: 10
: ^
`----
x Expected Declaration value
,-[$DIR/tests/recovery/number/input.css:5:5]
5 | prop3: 10.10
: ^
`----

Some files were not shown because too many files have changed in this diff Show More