Sha256: 9ab8fd4e7c3361d1b031e55acedcf9028863f27ece7affc686b57ee88242ff53

Contents?: true

Size: 832 Bytes

Versions: 173

Compression:

Stored size: 832 Bytes

Contents

require 'sass/script'
require 'sass/script/css_lexer'

module Sass
  module Script
    # This is a subclass of {Parser} for use in parsing plain CSS properties.
    #
    # @see Sass::SCSS::CssParser
    class CssParser < Parser
      private

      # @private
      def lexer_class; CssLexer; end

      # We need a production that only does /,
      # since * and % aren't allowed in plain CSS
      production :div, :unary_plus, :div

      def string
        return number unless tok = try_tok(:string)
        return tok.value unless @lexer.peek && @lexer.peek.type == :begin_interpolation
      end

      # Short-circuit all the SassScript-only productions
      alias_method :interpolation, :concat
      alias_method :or_expr, :div
      alias_method :unary_div, :ident
      alias_method :paren, :string
    end
  end
end

Version data entries

173 entries across 172 versions & 4 rubygems

Version Path
radiant-1.0.0.rc1 vendor/plugins/haml/lib/sass/script/css_parser.rb
haml-3.0.25 lib/sass/script/css_parser.rb
haml-3.1.0.alpha.33 vendor/sass/lib/sass/script/css_parser.rb
haml-3.0.24 lib/sass/script/css_parser.rb
haml-3.0.23 lib/sass/script/css_parser.rb
haml-3.1.0.alpha.30 vendor/sass/lib/sass/script/css_parser.rb
sass-3.1.0.alpha.23 lib/sass/script/css_parser.rb
haml-3.1.0.alpha.28 vendor/sass/lib/sass/script/css_parser.rb
haml-3.1.0.alpha.27 vendor/sass/lib/sass/script/css_parser.rb
sass-3.1.0.alpha.22 lib/sass/script/css_parser.rb
haml-3.1.0.alpha.26 vendor/sass/lib/sass/script/css_parser.rb
sass-3.1.0.alpha.21 lib/sass/script/css_parser.rb
haml-3.1.0.alpha.23 vendor/sass/lib/sass/script/css_parser.rb
sass-3.1.0.alpha.20 lib/sass/script/css_parser.rb
haml-3.1.0.alpha.22 vendor/sass/lib/sass/script/css_parser.rb
sass-3.1.0.alpha.19 lib/sass/script/css_parser.rb
haml-3.0.22 lib/sass/script/css_parser.rb
sass-3.1.0.alpha.18 lib/sass/script/css_parser.rb
haml-3.1.0.alpha.19 vendor/sass/lib/sass/script/css_parser.rb
haml-3.1.0.alpha.18 vendor/sass/lib/sass/script/css_parser.rb