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

Method parse

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

Source from the content-addressed store, hash-verified

36
37impl<'a> Parse<'a> for CSSFloat {
38 fn parse<I>(p: &mut Parser<'a, I>) -> ParserResult<Self>
39 where
40 I: Iterator<Item = Cursor> + Clone,
41 {
42 if p.peek::<Self>() {
43 p.parse::<T![Number]>().map(Self)
44 } else {
45 Err(Diagnostic::new(p.next(), Diagnostic::unexpected))?
46 }
47 }
48}
49
50#[cfg(test)]

Callers

nothing calls this directly

Calls 2

ErrClass · 0.85
nextMethod · 0.45

Tested by

no test coverage detected