class Sass::SCSS::StaticParser
def parse_selector(filename)
-
(Sass::SyntaxError)
- if there's a syntax error in the selector
Returns:
-
(Selector::CommaSequence)
- The parsed selector
Parameters:
-
filename
(String, nil
) -- The file in which the selector appears, -
line
(Fixnum
) -- The line on which the selector appears.
def parse_selector(filename) init_scanner! selectors = [expr!(:_selector)] while tok(/,/) ws = str{ss} selectors << expr!(:_selector) selectors[-1] = Selector::Sequence.new(["\n"] + selectors.last.members) if ws.include?("\n") end expected("selector") unless @scanner.eos? seq = Selector::CommaSequence.new(selectors) seq.line = @line seq.filename = filename seq end