lib/sass/selector/sequence.rb
# Resolves the {Parent} selectors within this selector
# by replacing them with the given parent selector,
# handling commas appropriately.
#
# @param super_seq [Sequence] The parent selector sequence
# @return [Sequence] This selector, with parent references resolved
# @raise [Sass::SyntaxError] If a parent selector is invalid
Resolves the {Parent} selectors within this selector
by replacing them with the given parent selector,
handling commas appropriately.
Resolves the { Parent } selectors within this selector by replacing them with the given parent selector handling commas appropriately .
def resolve_parent_refs(super_seq)
        members = @members
        nl = (members.first == "\n" && members.shift)
        unless members.any? do |seq_or_op|
            seq_or_op.is_a?(SimpleSequence) && seq_or_op.members.first.is_a?(Parent)
          end
          members = []
          members << nl if nl
          members << SimpleSequence.new([Parent.new])
          members += @members
        end
        Sequence.new(
          members.map do |seq_or_op|
            next seq_or_op unless seq_or_op.is_a?(SimpleSequence)
            seq_or_op.resolve_parent_refs(super_seq)
          end.flatten)
      end
def resolve_parent_refs ( super_seq ) members = @members nl = ( members . first == "\n" && members . shift ) unless members . any? do | seq_or_op | seq_or_op . is_a? ( SimpleSequence ) && seq_or_op . members . first . is_a? ( Parent ) end members = [ ] members << nl if nl members << SimpleSequence . new ( [ Parent . new ] ) members += @members end Sequence . new ( members . map do | seq_or_op | next seq_or_op unless seq_or_op . is_a? ( SimpleSequence ) seq_or_op . resolve_parent_refs ( super_seq ) end . flatten ) end
Resolves the {Parent} selectors within this selector
by replacing them with the given parent selector,
handling commas appropriately.
Resolves the { Parent } selectors within this selector by replacing them with the given parent selector handling commas appropriately .
This selector, with parent references resolved
This selector with parent references resolved
Sequence
[Sass::SyntaxError] If a parent selector is invalid
[ Sass :: SyntaxError ] If a parent selector is invalid
super_seq
The parent selector sequence
The parent selector sequence