lib/css/src/selector/root.zig

daab053ee43316e1809a84551d573ddd1e5bf3d2

 1 //! The selector grammar: compounds, combinators, specificity, and bucket keys.
 2 //!
 3 //! A compound holds interned atoms rather than byte slices, so matching is a
 4 //! run of integer compares and a rule bucket is an integer key. Interaction
 5 //! pseudo-classes and the published node states share one bit word, which is
 6 //! why `:disabled` and `[state~=disabled]` are the same test.
 7 //!
 8 //! Attribute selectors cover the four keys the node model carries: `id`,
 9 //! `class`, `role`, and `state`. A selector over any other attribute parses,
10 //! reports a diagnostic, and is marked unmatchable, which is the CSS result for
11 //! an attribute no element in the model can hold.
12 //!
13 //! `Builder` runs both passes. With its placement arrays absent it counts, with
14 //! them present it fills, so the inspection and emission walks cannot drift.
15 
16 const grammar = @import("grammar.zig");
17 const nth_expression = @import("nth.zig");
18 
19 pub const nth = nth_expression;
20 
21 pub const BucketKey = grammar.BucketKey;
22 pub const Builder = grammar.Builder;
23 pub const Combinator = grammar.Combinator;
24 pub const Compound = grammar.Compound;
25 pub const PseudoClass = grammar.PseudoClass;
26 pub const Range = grammar.Range;
27 pub const Selector = grammar.Selector;
28 pub const Specificity = grammar.Specificity;
29 pub const bit = grammar.bit;
30 pub const parseList = grammar.parseList;
31 pub const parseOpaque = grammar.parseOpaque;
32 pub const pseudoByName = grammar.pseudoByName;
33 pub const stateByName = grammar.stateByName;
34 pub const states = grammar.states;
35 pub const unmatchable = grammar.unmatchable;