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

Method kind

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

Source from the content-addressed store, hash-verified

640 /// Returns the [Kind].
641 #[inline]
642 pub const fn kind(&self) -> Kind {
643 let kind_bits = if self.kind_bits() & 0b1111 == Kind::Delim as u8 {
644 let c = self.char().unwrap() as usize;
645 if c < 127 { SINGLE_CHAR_KINDS[c] as u8 } else { Kind::Delim as u8 }
646 } else {
647 self.kind_bits()
648 };
649 Kind::from_bits(if self.is_bad() { kind_bits | 0b1_0000 } else { kind_bits })
650 }
651
652 /// Check if the TF upper-most bit is set.
653 #[inline(always)]

Callers 15

peekMethod · 0.45
from_tokenMethod · 0.45
nextMethod · 0.45
fmtMethod · 0.45
may_compactMethod · 0.45
fmt_compactedMethod · 0.45
fmt_compacted_numberMethod · 0.45
fmt_compacted_identMethod · 0.45
fmt_expandedMethod · 0.45
fmt_expanded_identMethod · 0.45
fromMethod · 0.45

Calls 3

kind_bitsMethod · 0.80
charMethod · 0.80
is_badMethod · 0.45

Tested by 5

popular_snapshotsFunction · 0.36
convert_tokenFunction · 0.36
test_caseFunction · 0.36