Sha256: bce8fcc6f10655713ba5f0b0c4fe6fef332d7600dd5e1a5f420338ac16ef0637

Contents?: true

Size: 1.15 KB

Versions: 116

Compression:

Stored size: 1.15 KB

Contents

require 'sass/script/css_parser'

module Sass
  module SCSS
    # 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.
    class CssParser < StaticParser
      private

      def parent_selector; nil; end
      def interpolation; nil; end
      def interp_string; tok(STRING); end
      def interp_ident(ident = IDENT); tok(ident); end
      def use_css_import?; true; end

      def special_directive(name)
        return unless name == 'media' || name == 'import'
        super
      end

      def block_child(context)
        case context
        when :ruleset
          declaration
        when :stylesheet
          directive || ruleset
        when :directive
          directive || declaration_or_ruleset
        end
      end

      def nested_properties!(node, space)
        expected('expression (e.g. 1px, bold)');
      end

      @sass_script_parser = Class.new(Sass::Script::CssParser)
      @sass_script_parser.send(:include, ScriptParser)
    end
  end
end

Version data entries

116 entries across 116 versions & 2 rubygems

Version Path
haml-edge-3.1.60 lib/sass/scss/css_parser.rb
haml-edge-3.1.59 lib/sass/scss/css_parser.rb
haml-3.0.16 lib/sass/scss/css_parser.rb
haml-edge-3.1.58 lib/sass/scss/css_parser.rb
haml-edge-3.1.57 lib/sass/scss/css_parser.rb
haml-edge-3.1.56 lib/sass/scss/css_parser.rb
haml-edge-3.1.55 lib/sass/scss/css_parser.rb
haml-edge-3.1.54 lib/sass/scss/css_parser.rb
haml-edge-3.1.53 lib/sass/scss/css_parser.rb
haml-edge-3.1.52 lib/sass/scss/css_parser.rb
haml-edge-3.1.51 lib/sass/scss/css_parser.rb
haml-3.0.15 lib/sass/scss/css_parser.rb
haml-edge-3.1.50 lib/sass/scss/css_parser.rb
haml-3.0.14 lib/sass/scss/css_parser.rb
haml-edge-3.1.49 lib/sass/scss/css_parser.rb
haml-3.0.13 lib/sass/scss/css_parser.rb
haml-edge-3.1.48 lib/sass/scss/css_parser.rb
haml-edge-3.1.47 lib/sass/scss/css_parser.rb
haml-edge-3.1.46 lib/sass/scss/css_parser.rb
haml-edge-3.1.45 lib/sass/scss/css_parser.rb