(&self)
| 170 | /// - Dimension: combines number and unit checks |
| 171 | #[inline] |
| 172 | pub fn may_compact(&self) -> bool { |
| 173 | let token = self.token(); |
| 174 | match token.kind() { |
| 175 | Kind::Whitespace => token.len() > 1, |
| 176 | Kind::Ident | Kind::Function | Kind::AtKeyword | Kind::Hash => token.contains_escape_chars(), |
| 177 | Kind::Number => self.can_compact_number(), |
| 178 | Kind::Dimension => { |
| 179 | self.can_compact_number() |
| 180 | || self.source[(self.token().numeric_len() as usize)..].bytes().any(|b| b == b'\\' || b == 0) |
| 181 | } |
| 182 | _ => false, |
| 183 | } |
| 184 | } |
| 185 | |
| 186 | /// Check if the numeric value could be compacted. |
| 187 | #[inline] |
no test coverage detected