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

Method parse

crates/css_ast/src/rules/page.rs:42–55  ·  view source on GitHub ↗
(p: &mut Parser<'a, I>)

Source from the content-addressed store, hash-verified

40
41impl<'a> Parse<'a> for PageSelector<'a> {
42 fn parse<I>(p: &mut Parser<'a, I>) -> ParserResult<Self>
43 where
44 I: Iterator<Item = Cursor> + Clone,
45 {
46 let mut pseudos = Vec::new_in(p.bump());
47 let page_type = p.parse_if_peek::<T![Ident]>()?;
48 loop {
49 if p.peek::<T![:]>() {
50 pseudos.push(p.parse::<PagePseudoClass>()?);
51 } else {
52 return Ok(Self { page_type, pseudos });
53 }
54 }
55 }
56}
57
58impl<'a> ToSpecificity for PageSelector<'a> {

Callers

nothing calls this directly

Calls 1

bumpMethod · 0.45

Tested by

no test coverage detected