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

Method parse

crates/css_parse/src/token_macros.rs:435–448  ·  view source on GitHub ↗
(p: &mut Parser<'a, I>)

Source from the content-addressed store, hash-verified

433
434impl<'a> Parse<'a> for Whitespace {
435 fn parse<I>(p: &mut Parser<'a, I>) -> Result<Self>
436 where
437 I: Iterator<Item = Cursor> + Clone,
438 {
439 // Whitespace needs to implement parse so that it can change the skip-state to only ensuring Whitespace
440 // is not ignored.
441 let skip = p.set_skip(KindSet::COMMENTS);
442 let c = p.next();
443 p.set_skip(skip);
444 if c != Kind::Whitespace {
445 Err(crate::Diagnostic::new(c, crate::Diagnostic::unexpected))?
446 }
447 Ok(Self(c))
448 }
449}
450
451/// Represents a token with [Kind::Ident] that also begins with two HYPHEN MINUS (`--`)

Callers

nothing calls this directly

Calls 3

ErrClass · 0.85
set_skipMethod · 0.80
nextMethod · 0.45

Tested by

no test coverage detected