MCPcopy Create free account
hub / github.com/csskit/csskit / can_escape

Method can_escape

crates/css_lexer/src/token.rs:894–899  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

892 /// Checks if it is possible for the [Token] to contain escape characters. Numbers, for example, cannot. Idents can.
893 #[inline]
894 pub const fn can_escape(&self) -> bool {
895 self.kind_bits() == Kind::String as u8
896 || self.kind_bits() == Kind::Url as u8
897 || self.kind_bits() == Kind::Dimension as u8
898 || self.is_ident_like()
899 }
900
901 /// If the [Token] can escape, checks if the underlying source text contained escape characters.
902 ///

Callers 1

contains_escape_charsMethod · 0.80

Calls 2

kind_bitsMethod · 0.80
is_ident_likeMethod · 0.80

Tested by

no test coverage detected