gems.sass-3.2.9.lib.sass.scss.css_parser.rb Maven / Gradle / Ivy
Go to download
Sass makes CSS fun again. Sass is an extension of CSS3, adding nested rules, variables, mixins, selector
inheritance, and more. It's translated to well-formatted, standard CSS using the command line tool or a
web-framework plugin.
This is a repackaged GEM in a JAR format of the sass-lang.gem package. The sass-gems package version
follows the sass-lang.gem versions located http://rubyforge.org/frs/?group_id=9702. Simply change
the version of this package to download and repackage the same GEM version.
The newest version!
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 placeholder_selector; nil; end
def parent_selector; nil; end
def interpolation; nil; end
def use_css_import?; true; 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