at-rules are case sensitive

This commit is contained in:
ConnorSkees 2020-06-01 21:35:23 -04:00
parent 1de8067e24
commit 6a13c6f320
2 changed files with 3 additions and 2 deletions

View File

@ -72,7 +72,7 @@ pub enum AtRuleKind {
impl TryFrom<&Spanned<String>> for AtRuleKind {
type Error = SassError;
fn try_from(c: &Spanned<String>) -> Result<Self, SassError> {
Ok(match c.node.to_ascii_lowercase().as_str() {
Ok(match c.node.as_str() {
"use" => Self::Use,
"forward" => Self::Forward,
"import" => Self::Import,

View File

@ -96,7 +96,7 @@ test!(
test!(
uppercase_escaped_if,
"@\\49 f true {\n a {\n color: red;\n }\n}\n",
"a {\n color: red;\n}\n"
"@If true {\n a {\n color: red;\n }\n}\n"
);
test!(
escaped_else,
@ -108,6 +108,7 @@ test!(
"@if false {}\n\n@\\45lse {\n a {\n color: red;\n }\n}\n",
"a {\n color: red;\n}\n"
);
test!(uppercase_if, "@If true {\n a {\n color: red;\n }\n}\n");
error!(nothing_after_if, "@if", "Error: Expected expression.");
error!(
nothing_after_dollar,