mirror of
https://github.com/servo/servo.git
synced 2025-10-04 10:39:16 +01:00
style: Disallow 'not', 'and', and 'or' from <container-name>
Differential Revision: https://phabricator.services.mozilla.com/D156805
This commit is contained in:
parent
f9f5283a65
commit
3fc54c24e2
1 changed files with 3 additions and 2 deletions
|
@ -1539,9 +1539,10 @@ impl Parse for ContainerName {
|
||||||
if first.eq_ignore_ascii_case("none") {
|
if first.eq_ignore_ascii_case("none") {
|
||||||
return Ok(Self::none())
|
return Ok(Self::none())
|
||||||
}
|
}
|
||||||
idents.push(CustomIdent::from_ident(location, first, &["none"])?);
|
const DISALLOWED_CONTAINER_NAMES: &'static [&'static str] = &["none", "not", "or", "and"];
|
||||||
|
idents.push(CustomIdent::from_ident(location, first, DISALLOWED_CONTAINER_NAMES)?);
|
||||||
while let Ok(ident) = input.try_parse(|input| input.expect_ident_cloned()) {
|
while let Ok(ident) = input.try_parse(|input| input.expect_ident_cloned()) {
|
||||||
idents.push(CustomIdent::from_ident(location, &ident, &["none"])?);
|
idents.push(CustomIdent::from_ident(location, &ident, DISALLOWED_CONTAINER_NAMES)?);
|
||||||
}
|
}
|
||||||
Ok(ContainerName(idents.into()))
|
Ok(ContainerName(idents.into()))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue