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

Method should_skip_visit

crates/csskit_proc_macro/src/generate.rs:425–444  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

423 }
424
425 fn should_skip_visit(&self) -> bool {
426 match self {
427 Self::Ident(_) => true,
428 Self::IntLiteral(_) => true,
429 Self::DimensionLiteral(_, _) => true,
430 Self::Function(_, _) => false,
431 Self::AutoOr(ty) => ty.as_ref().should_skip_visit(),
432 Self::NoneOr(ty) => ty.as_ref().should_skip_visit(),
433 Self::AutoNoneOr(ty) => ty.as_ref().should_skip_visit(),
434 Self::NormalOr(ty) => ty.as_ref().should_skip_visit(),
435 Self::Type(DefType { ident, .. }) => ident.0.ends_with("Keywords"),
436 Self::StyleValue(_) => false,
437 Self::FunctionType(_) => false,
438 Self::Optional(d) => d.should_skip_visit(),
439 Self::Combinator(d, _) => d.iter().all(|d| d.should_skip_visit()),
440 Self::Group(d, _) => d.should_skip_visit(),
441 Self::Multiplier(d, _, _) => d.should_skip_visit(),
442 Self::Punct(_) => false,
443 }
444 }
445
446 fn type_attributes(&self, derives_parse: bool, derives_visitable: bool) -> TokenStream {
447 let skip = if derives_visitable && self.should_skip_visit() {

Callers 1

type_attributesMethod · 0.80

Calls 2

as_refMethod · 0.80
iterMethod · 0.80

Tested by

no test coverage detected