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

Method parse

crates/css_parse/src/syntax/no_block_allowed.rs:20–31  ·  view source on GitHub ↗
(p: &mut Parser<'a, Iter>)

Source from the content-addressed store, hash-verified

18
19impl<'a, D, M> Parse<'a> for NoBlockAllowed<D, M> {
20 fn parse<Iter>(p: &mut Parser<'a, Iter>) -> Result<Self>
21 where
22 Iter: Iterator<Item = crate::Cursor> + Clone,
23 {
24 if p.at_end() {
25 Ok(Self { semicolon: None, _phantom: std::marker::PhantomData })
26 } else if let Some(semicolon) = p.parse_if_peek::<T![;]>()? {
27 Ok(Self { semicolon: Some(semicolon), _phantom: std::marker::PhantomData })
28 } else {
29 Err(Diagnostic::new(p.next(), Diagnostic::unexpected))?
30 }
31 }
32}
33
34impl<'a, D, M> Peek<'a> for NoBlockAllowed<D, M> {

Callers

nothing calls this directly

Calls 3

ErrClass · 0.85
at_endMethod · 0.45
nextMethod · 0.45

Tested by

no test coverage detected