mirror of
https://github.com/swc-project/swc.git
synced 2024-10-05 04:39:06 +03:00
fix(css/parser): Resolve some TODOs (#2572)
This commit is contained in:
parent
67c0d4cc37
commit
47f7f1ad4f
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -2552,7 +2552,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "swc_css_parser"
|
||||
version = "0.25.1"
|
||||
version = "0.25.2"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"lexical",
|
||||
|
@ -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]
|
||||
|
@ -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(),
|
||||
});
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
@ -0,0 +1,2 @@
|
||||
div {
|
||||
prop: "string
|
@ -0,0 +1,2 @@
|
||||
error: Expected "}"
|
||||
|
@ -0,0 +1,2 @@
|
||||
div {
|
||||
prop: 'string
|
@ -0,0 +1,2 @@
|
||||
error: Expected "}"
|
||||
|
1
css/parser/tests/errors/url/eof-whitespaces/input.css
Normal file
1
css/parser/tests/errors/url/eof-whitespaces/input.css
Normal file
@ -0,0 +1 @@
|
||||
a { prop: url(foo.png
|
@ -0,0 +1,2 @@
|
||||
error: Expected "}"
|
||||
|
0
css/parser/tests/fixture/empty/input.css
Normal file
0
css/parser/tests/fixture/empty/input.css
Normal file
9
css/parser/tests/fixture/empty/output.json
Normal file
9
css/parser/tests/fixture/empty/output.json
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"type": "Stylesheet",
|
||||
"span": {
|
||||
"start": 0,
|
||||
"end": 0,
|
||||
"ctxt": 0
|
||||
},
|
||||
"rules": []
|
||||
}
|
2
css/parser/tests/fixture/empty/span.rust-debug
Normal file
2
css/parser/tests/fixture/empty/span.rust-debug
Normal file
@ -0,0 +1,2 @@
|
||||
error: Stylesheet
|
||||
|
Loading…
Reference in New Issue
Block a user