class Sass::SCSS::CssParser

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.

Private Instance Methods

block_child(context) click to toggle source
# File lib/sass/scss/css_parser.rb, line 24
def block_child(context)
  case context
  when :ruleset
    declaration
  when :stylesheet
    directive || ruleset
  when :directive
    directive || declaration_or_ruleset
  when :keyframes
    keyframes_ruleset
  end
end
block_contents(node, context) click to toggle source
Calls superclass method
# File lib/sass/scss/css_parser.rb, line 17
def block_contents(node, context)
  if node.is_a?(Sass::Tree::DirectiveNode) && node.normalized_name == '@keyframes'
    context = :keyframes
  end
  super(node, context)
end
interpolation(warn_for_color = false) click to toggle source
# File lib/sass/scss/css_parser.rb, line 14
def interpolation(warn_for_color = false); nil; end
keyframes_ruleset() click to toggle source
# File lib/sass/scss/css_parser.rb, line 47
def keyframes_ruleset
  start_pos = source_position
  return unless (selector = keyframes_selector)
  block(
    node(
      Sass::Tree::KeyframeRuleNode.new(
        Sass::Util.strip_except_escapes(selector)),
      start_pos),
    :ruleset)
end
nested_properties!(node) click to toggle source
# File lib/sass/scss/css_parser.rb, line 37
def nested_properties!(node)
  expected('expression (e.g. 1px, bold)')
end
parent_selector() click to toggle source
# File lib/sass/scss/css_parser.rb, line 13
def parent_selector; nil; end
placeholder_selector() click to toggle source
# File lib/sass/scss/css_parser.rb, line 12
def placeholder_selector; nil; end
ruleset() click to toggle source
# File lib/sass/scss/css_parser.rb, line 41
def ruleset
  start_pos = source_position
  return unless (selector = selector_comma_sequence)
  block(node(Sass::Tree::RuleNode.new(selector, range(start_pos)), start_pos), :ruleset)
end
use_css_import?() click to toggle source
# File lib/sass/scss/css_parser.rb, line 15
def use_css_import?; true; end