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

Method equals_atom

crates/css_parse/src/parser.rs:191–201  ·  view source on GitHub ↗
(&self, c: Cursor, atom: &'static dyn DynAtomSet)

Source from the content-addressed store, hash-verified

189 }
190
191 pub fn equals_atom(&self, c: Cursor, atom: &'static dyn DynAtomSet) -> bool {
192 let mut cursor_bits = c.atom_bits();
193 if cursor_bits == 0 {
194 if c != KindSet::ATOM_LIKE {
195 return false;
196 }
197 let source_cursor = self.to_source_cursor(c);
198 cursor_bits = atom.str_to_bits(&source_cursor.parse(self.bump));
199 }
200 cursor_bits == atom.bits()
201 }
202
203 pub fn to_atom<A: AtomSet + PartialEq>(&self, c: Cursor) -> A {
204 let bits = c.atom_bits();

Callers 15

parseMethod · 0.45
peekMethod · 0.45
parseMethod · 0.45
parseMethod · 0.45
keyword_is_notMethod · 0.45
keyword_is_andMethod · 0.45
keyword_is_orMethod · 0.45
keyword_is_notMethod · 0.45
keyword_is_andMethod · 0.45
keyword_is_orMethod · 0.45
peekMethod · 0.45
keyword_is_notMethod · 0.45

Calls 5

atom_bitsMethod · 0.45
to_source_cursorMethod · 0.45
str_to_bitsMethod · 0.45
parseMethod · 0.45
bitsMethod · 0.45

Tested by

no test coverage detected