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

Method parse

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

Source from the content-addressed store, hash-verified

46
47impl<'a> Parse<'a> for BangImportant {
48 fn parse<Iter>(p: &mut Parser<'a, Iter>) -> Result<Self>
49 where
50 Iter: Iterator<Item = Cursor> + Clone,
51 {
52 let bang = p.parse::<T![!]>()?;
53 let important = p.parse::<T![Ident]>()?;
54 if !p.to_source_cursor(important.into()).eq_ignore_ascii_case("important") {
55 Err(Diagnostic::new(important.into(), Diagnostic::unexpected_ident))?
56 }
57 Ok(Self { bang, important })
58 }
59}
60
61impl ToCursors for BangImportant {

Callers

nothing calls this directly

Calls 3

ErrClass · 0.85
eq_ignore_ascii_caseMethod · 0.80
to_source_cursorMethod · 0.45

Tested by

no test coverage detected