Safe Haskell | Safe-Inferred |
---|
Definitions of Token
s in the CSS selector grammar as well as the data types
representing the parse result.
- data Selector
- data Comb
- = Descendant
- | Child
- | FollowingSibling
- | AnySibling
- data SimpleSelector = SimpleSelector (Maybe String) [Specifier] (Maybe Pseudo)
- data Specifier
- data Pred
- data PredOp
- = Equals
- | Includes
- | DashMatch
- | BeginsWith
- | EndsWith
- data Pseudo
- = FirstChild
- | LastChild
- data Token
- = TokenSpace
- | TokenName String
- | TokenString String
- | TokenPlus
- | TokenMinus
- | TokenSlash
- | TokenAster
- | TokenChild
- | TokenNthChild
- | TokenFirstChild
- | TokenLastChild
- | TokenNthLastChild
- | TokenAnySibling
- | TokenOB
- | TokenCB
- | TokenOP
- | TokenCP
- | TokenDigits String
- | TokenHash
- | TokenDot
- | TokenEquals
- | TokenIncludes
- | TokenDashMatch
- | TokenBeginsWith
- | TokenEndsWith
- | TokenQuote
- | TokenEOF
- | TokenPseudo
Documentation
Top level entity representing the parse tree of a CSS path expression.
Composed of one or more SimpleSelector
s combined with a Comb
relation.
Type representing the relationship between two Selector
s.
Descendant | Any descendant; represented by plain whitespace in CSS |
Child | Any direct child; represented by |
FollowingSibling | Directly following sibling node; represented by |
AnySibling | Any following sibling node; represented by |
data SimpleSelector Source
Type representing a single set of filters for selecting nodes.
Contain an optional single element name, a sequence of id, class, and attribute
Specifier
s, and an optional pseudo-element selector.
Type representing id, class, and attribute filters.
Type representing boolean operations on attribute values.
Equals | String equality |
Includes | Contains word; |
DashMatch | String equality, optional dash following; |
BeginsWith | String begins with; |
EndsWith | String ends with; |
Only supporting two pseudoelement selectors.