fix(css/parser): Resolve some TODOs (#2572)

This commit is contained in:
Alexander Akait 2021-10-29 13:55:02 +03:00 committed by GitHub
parent 67c0d4cc37
commit 47f7f1ad4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 32 additions and 5 deletions

2
Cargo.lock generated
View File

@ -2552,7 +2552,7 @@ dependencies = [
[[package]]
name = "swc_css_parser"
version = "0.25.1"
version = "0.25.2"
dependencies = [
"bitflags",
"lexical",

View File

@ -6,7 +6,7 @@ edition = "2018"
license = "Apache-2.0/MIT"
name = "swc_css_parser"
repository = "https://github.com/swc-project/swc.git"
version = "0.25.1"
version = "0.25.2"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[features]

View File

@ -622,7 +622,10 @@ where
// EOF
// This is a parse error. Return the <string-token>.
None => {
return Err(ErrorKind::Eof);
return Ok(Token::Str {
value: value.into(),
raw: raw.into(),
})
}
}
}
@ -719,8 +722,10 @@ where
});
}
None => {
// TODO: This is a parse error. Return the <url-token>.
return Err(ErrorKind::Eof);
return Ok(Token::Url {
value: value.into(),
raw: raw.into(),
});
}
_ => {}
}

View File

@ -0,0 +1,2 @@
div {
prop: "string

View File

@ -0,0 +1,2 @@
error: Expected "}"

View File

@ -0,0 +1,2 @@
div {
prop: 'string

View File

@ -0,0 +1,2 @@
error: Expected "}"

View File

@ -0,0 +1 @@
a { prop: url(foo.png

View File

@ -0,0 +1,2 @@
error: Expected "}"

View File

View File

@ -0,0 +1,9 @@
{
"type": "Stylesheet",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"rules": []
}

View File

@ -0,0 +1,2 @@
error: Stylesheet