Class: Sass::SCSS::CssParser

Inherits:
StaticParser show all
Defined in:
lib/sass/scss/css_parser.rb

Overview

This is a subclass of Parser which only parses plain CSS. It doesn't support any Sass extensions, such as interpolation, parent references, nested selectors, and so forth. It does support all the same CSS hacks as the SCSS parser, though.

Constant Summary

Constants included from RX

RX::CDC, RX::CDO, RX::COMMENT, RX::DASHMATCH, RX::DEFAULT, RX::ESCAPE, RX::FUNCTION, RX::GREATER, RX::H, RX::HASH, RX::HEXCOLOR, RX::IDENT, RX::IMPORTANT, RX::INCLUDES, RX::INTERP_START, RX::MOZ_ANY, RX::NAME, RX::NL, RX::NMCHAR, RX::NMSTART, RX::NONASCII, RX::NOT, RX::NUM, RX::NUMBER, RX::PLUS, RX::PREFIXMATCH, RX::RANGE, RX::S, RX::SINGLE_LINE_COMMENT, RX::STATIC_SELECTOR, RX::STATIC_VALUE, RX::STRING, RX::STRING1, RX::STRING1_NOINTERP, RX::STRING2, RX::STRING2_NOINTERP, RX::STRING_NOINTERP, RX::SUBSTRINGMATCH, RX::SUFFIXMATCH, RX::TILDE, RX::UNICODE, RX::UNICODERANGE, RX::URI, RX::URL, RX::URLCHAR, RX::W

Instance Method Summary collapse

Methods inherited from StaticParser

#parse_selector

Methods inherited from Parser

#initialize, #parse, #parse_interp_ident

Methods included from RX

escape_ident

Constructor Details

This class inherits a constructor from Sass::SCSS::Parser

Instance Method Details

#parse_selector_stringString?

Parse a selector, and return its value as a string.

Returns:

  • (String, nil)

    The parsed selector, or nil if no selector was parsed

Raises:



14
15
16
17
# File 'lib/sass/scss/css_parser.rb', line 14

def parse_selector_string
  init_scanner!
  str {return unless selector}
end