Skip to content

Internals: AST: Selectors

Marcel Greter edited this page Jan 16, 2015 · 1 revision

Selectors are pretty much the bread and butter of sass. Not only do we need to parse them correctly, there are also various operations that have to be done with selectors (like expading).

Selector Types

  • Selector_List
  • Complex_Selector
  • Compound_Selector
  • Simple_Selector
  • Type_Selector
  • Pseudo_Selector
  • Wrapped_Selector
  • Attribute_Selector
  • Selector_Placeholder
  • Selector_Qualifier
  • Selector_Placeholder
  • Selector_Reference
  • Selector_Schema

Selector_List

Comma separated list of Complex_Selectors

Complex_Selector

A Complex_Selector combines a Compound_Selector (head) and another Complex_Selector (tail). The combination can be one of:

  • ANCESTOR_OF (" ")
  • PARENT_OF (">")
  • PRECEDES ("~")
  • ADJACENT_TO ("+")

Compound_Selector

A Selector with a list of Simple_Selectors (space separated list).