class HTML::Selector
def next_selector(statement, values)
separators (alternate) and apply them to the selector group of the
for reuse. The only logic deals with the need to detect comma
This method is called from four places, so it helps to put it here
eventually, and array of substitution values.
Passes the remainder of the statement that will be reduced to zero
Called to create a dependent selector (sibling, descendant, etc).
def next_selector(statement, values) second = Selector.new(statement, values) # If there are alternate selectors, we group them in the top selector. if alternates = second.instance_variable_get(:@alternates) second.instance_variable_set(:@alternates, []) @alternates.concat alternates end second end