Class Sass::SCSS::StaticParser
In: lib/sass/scss/static_parser.rb
Parent: Parser

A parser for a static SCSS tree. Parses with SCSS extensions, like nested rules and parent selectors, but without dynamic SassScript. This is useful for e.g. \{parse_selector parsing selectors} after resolving the interpolation.

Methods

Public Instance methods

Parses the text as a selector.

@param filename [String, nil] The file in which the selector appears,

  or nil if there is no such file.
  Used for error reporting.

@return [Selector::CommaSequence] The parsed selector @raise [Sass::SyntaxError] if there‘s a syntax error in the selector

[Source]

    # File lib/sass/scss/static_parser.rb, line 16
16:       def parse_selector(filename)
17:         init_scanner!
18:         seq = expr!(:selector_comma_sequence)
19:         expected("selector") unless @scanner.eos?
20:         seq.line = @line
21:         seq.filename = filename
22:         seq
23:       end

[Validate]