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

Method char

crates/css_lexer/src/token.rs:729–734  ·  view source on GitHub ↗

If the [Kind] is "Delim Like" (i.e. it is [Kind::Delim], [Kind::Colon], [Kind::Semicolon], [Kind::Comma], [Kind::LeftSquare], [Kind::RightSquare], [Kind::LeftParen], [Kind::RightParen], [Kind::LeftCurly], [Kind::RightCurly]) then this will return a [Some] with a [char] representing the value. For non-delim-like tokens this will return [None].

(&self)

Source from the content-addressed store, hash-verified

727 /// [Kind::RightCurly]) then this will return a [Some] with a [char] representing the value.
728 /// For non-delim-like tokens this will return [None].
729 pub const fn char(&self) -> Option<char> {
730 if self.is_delim_like() {
731 return char::from_u32(self.1);
732 }
733 None
734 }
735
736 /// The [Token] is a [Kind::Dimension] or [Kind::Number] and is an integer - i.e. it has no `.`.
737 #[inline]

Callers 11

fmtMethod · 0.80
kindMethod · 0.80
lenMethod · 0.80
needs_separator_forMethod · 0.80
fmtMethod · 0.80
eqMethod · 0.80
convert_tokenFunction · 0.80
unexpected_delimMethod · 0.80
parseMethod · 0.80

Calls 1

is_delim_likeMethod · 0.80

Tested by 1

convert_tokenFunction · 0.64