Sha256: b423614b8a136168e3f7110260e38ce8d5fa45006c7ba9b6f0c077b9742289c4

Contents?: true

Size: 1.27 KB

Versions: 85

Compression:

Stored size: 1.27 KB

Contents

module Sass
  module SCSS
    # A parser for a static SCSS tree.
    # Parses with SCSS extensions, like nested rules and parent selectors,
    # but without dynamic SassScript.
    # This is useful for e.g. \{#parse\_selector parsing selectors}
    # after resolving the interpolation.
    class StaticParser < Parser
      # Parses the text as a selector.
      #
      # @param filename [String, nil] The file in which the selector appears,
      #   or nil if there is no such file.
      #   Used for error reporting.
      # @return [Selector::CommaSequence] The parsed selector
      # @raise [Sass::SyntaxError] if there's a syntax error in the selector
      def parse_selector(filename)
        init_scanner!
        seq = expr!(:selector_comma_sequence)
        expected("selector") unless @scanner.eos?
        seq.line = @line
        seq.filename = filename
        seq
      end

      private

      def variable; nil; end
      def script_value; nil; end
      def interpolation; nil; end
      def interp_string; s = tok(STRING) and [s]; end
      def interp_ident(ident = IDENT); s = tok(ident) and [s]; end
      def use_css_import?; true; end

      def special_directive(name)
        return unless  %w[media import charset].include?(name)
        super
      end
    end
  end
end

Version data entries

85 entries across 85 versions & 4 rubygems

Version Path
haml_ejs-0.0.1 vendor/sass/lib/sass/scss/static_parser.rb
haml-3.1.3 vendor/sass/lib/sass/scss/static_parser.rb
sass-3.1.7 lib/sass/scss/static_parser.rb
sass-3.1.6 lib/sass/scss/static_parser.rb
sass-3.1.5 lib/sass/scss/static_parser.rb
haml-3.2.0.alpha.8 vendor/sass/lib/sass/scss/static_parser.rb
sass-3.1.4 lib/sass/scss/static_parser.rb
sass-3.2.0.alpha.11 lib/sass/scss/static_parser.rb
sass-3.1.3 lib/sass/scss/static_parser.rb
sass-3.2.0.alpha.9 lib/sass/scss/static_parser.rb
sass-3.2.0.alpha.8 lib/sass/scss/static_parser.rb
haml-3.2.0.alpha.5 vendor/sass/lib/sass/scss/static_parser.rb
haml-3.2.0.alpha.4 vendor/sass/lib/sass/scss/static_parser.rb
haml-3.1.2 vendor/sass/lib/sass/scss/static_parser.rb
sass-3.1.2 lib/sass/scss/static_parser.rb
sass-3.2.0.alpha.7 lib/sass/scss/static_parser.rb
sass-3.2.0.alpha.6 lib/sass/scss/static_parser.rb
radiant-1.0.0.rc1 vendor/plugins/haml/lib/sass/scss/static_parser.rb
haml-3.2.0.alpha.3 vendor/sass/lib/sass/scss/static_parser.rb
sass-3.2.0.alpha.4 lib/sass/scss/static_parser.rb