From 3e9e860e20626bac0346dab3fb1f479f116fa263 Mon Sep 17 00:00:00 2001 From: ConnorSkees <39542938+ConnorSkees@users.noreply.github.com> Date: Mon, 20 Apr 2020 15:11:03 -0400 Subject: [PATCH] allow slient comments in special function args --- src/utils/read_until.rs | 4 ++++ tests/special-functions.rs | 9 +-------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/utils/read_until.rs b/src/utils/read_until.rs index e0a4d4b..0bcbeed 100644 --- a/src/utils/read_until.rs +++ b/src/utils/read_until.rs @@ -206,6 +206,10 @@ pub(crate) fn read_until_semicolon_or_open_or_closing_curly_brace { + t.push(toks.next().unwrap()); + t.extend(read_until_closing_paren(toks)); + } _ => t.push(toks.next().unwrap()), } } diff --git a/tests/special-functions.rs b/tests/special-functions.rs index b02684a..2d41859 100644 --- a/tests/special-functions.rs +++ b/tests/special-functions.rs @@ -21,11 +21,7 @@ test!( "a {\n color: calc(#{1 + 2});\n}\n", "a {\n color: calc(3);\n}\n" ); -test!( - #[ignore] - calc_retains_silent_comment, - "a {\n color: calc(//);\n}\n" -); +test!(calc_retains_silent_comment, "a {\n color: calc(//);\n}\n"); test!( calc_retains_multiline_comment, "a {\n color: calc(/**/);\n}\n" @@ -50,7 +46,6 @@ test!( "a {\n color: element(3);\n}\n" ); test!( - #[ignore] element_retains_silent_comment, "a {\n color: element(//);\n}\n" ); @@ -81,7 +76,6 @@ test!( "a {\n color: expression(3);\n}\n" ); test!( - #[ignore] expression_retains_silent_comment, "a {\n color: expression(//);\n}\n" ); @@ -112,7 +106,6 @@ test!( "a {\n color: progid:(3);\n}\n" ); test!( - #[ignore] progid_retains_silent_comment, "a {\n color: progid:(//);\n}\n" );