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

Method parse

crates/css_ast/src/units/int.rs:49–58  ·  view source on GitHub ↗
(p: &mut Parser<'a, I>)

Source from the content-addressed store, hash-verified

47
48impl<'a> Parse<'a> for CSSInt {
49 fn parse<I>(p: &mut Parser<'a, I>) -> ParserResult<Self>
50 where
51 I: Iterator<Item = Cursor> + Clone,
52 {
53 if p.peek::<Self>() {
54 p.parse::<T![Number]>().map(Self)
55 } else {
56 Err(Diagnostic::new(p.next(), Diagnostic::unexpected))?
57 }
58 }
59}
60
61#[cfg(test)]

Callers

nothing calls this directly

Calls 2

ErrClass · 0.85
nextMethod · 0.45

Tested by

no test coverage detected