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.
Parses the text as a selector.
@param line [Fixnum] The line on which the selector appears.
Used for error reporting
@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
# File lib/sass/scss/static_parser.rb, line 18 18: def parse_selector(filename) 19: init_scanner! 20: seq = expr!(:selector_comma_sequence) 21: expected("selector") unless @scanner.eos? 22: seq.line = @line 23: seq.filename = filename 24: seq 25: end
# File lib/sass/scss/static_parser.rb, line 33 33: def interp_ident(ident = IDENT); s = tok(ident) and [s]; end
# File lib/sass/scss/static_parser.rb, line 32 32: def interp_string; s = tok(STRING) and [s]; end
# File lib/sass/scss/static_parser.rb, line 31 31: def interpolation; nil; end
# File lib/sass/scss/static_parser.rb, line 30 30: def script_value; nil; end
# File lib/sass/scss/static_parser.rb, line 36 36: def special_directive(name) 37: return unless name == 'media' || name == 'import' 38: super 39: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.