From 71d3faa0422d826c46303ebb7b75050f327a1aec Mon Sep 17 00:00:00 2001 From: Connor Skees Date: Sat, 4 Jul 2020 11:15:18 -0400 Subject: [PATCH] keywords are case sensitive --- src/parse/value/parse.rs | 2 +- tests/and.rs | 1 - tests/extend.rs | 1 - tests/null.rs | 5 +++++ tests/or.rs | 1 - 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/parse/value/parse.rs b/src/parse/value/parse.rs index c8a8433..4432f4b 100644 --- a/src/parse/value/parse.rs +++ b/src/parse/value/parse.rs @@ -311,7 +311,7 @@ impl<'a> Parser<'a> { } // check for keywords - Ok(match lower.as_str() { + Ok(match s.as_str() { "true" => IntermediateValue::Value(HigherIntermediateValue::Literal(Value::True)), "false" => IntermediateValue::Value(HigherIntermediateValue::Literal(Value::False)), "null" => IntermediateValue::Value(HigherIntermediateValue::Literal(Value::Null)), diff --git a/tests/and.rs b/tests/and.rs index 429902b..c438588 100644 --- a/tests/and.rs +++ b/tests/and.rs @@ -46,7 +46,6 @@ test!( "a {\n color: 1-and;\n}\n" ); test!( - #[ignore = "casing is not preserved for keyword operators"] part_of_binop_casing, "a {\n color: 1 - AND;\n}\n", "a {\n color: 1-AND;\n}\n" diff --git a/tests/extend.rs b/tests/extend.rs index 3101e5b..a9e3eda 100644 --- a/tests/extend.rs +++ b/tests/extend.rs @@ -1757,7 +1757,6 @@ test!( "@media screen {\n a {\n x: y;\n }\n\n @page {}\n}\n" ); test!( - #[ignore = "to investigate"] escaped_selector, "// Escapes in selectors' identifiers should be normalized before `@extend` is // applied. diff --git a/tests/null.rs b/tests/null.rs index bc155d7..3d3fa3d 100644 --- a/tests/null.rs +++ b/tests/null.rs @@ -33,3 +33,8 @@ test!( "a {\n $x: null;\n color: -$x;\n}\n", "a {\n color: -;\n}\n" ); +test!( + null_is_case_sensitive, + "a {\n color: NULL;\n}\n", + "a {\n color: NULL;\n}\n" +); diff --git a/tests/or.rs b/tests/or.rs index 701761d..aa135c4 100644 --- a/tests/or.rs +++ b/tests/or.rs @@ -54,7 +54,6 @@ test!( "a {\n color: 1-or;\n}\n" ); test!( - #[ignore = "casing is not preserved for keyword operators"] part_of_binop_casing, "a {\n color: 1 - OR;\n}\n", "a {\n color: 1-OR;\n}\n"