Sha256: 660ed6994c2f9bf0281a7b10d31fb90cdd58ec0d3cddc7ec1566efc58d62405c

Contents?: true

Size: 760 Bytes

Versions: 5

Compression:

Stored size: 760 Bytes

Contents

# -*- coding: utf-8 -*- #

module Rouge
  module Lexers
    load_lexer 'sass/common.rb'

    class Scss < SassCommon
      title "SCSS"
      desc "SCSS stylesheets (sass-lang.com)"
      tag 'scss'
      filenames '*.scss'
      mimetypes 'text/x-scss'

      state :root do
        rule /\s+/, Text
        rule %r(//.*?$), Comment::Single
        rule %r(/[*].*?[*]/)m, Comment::Multiline
        rule /@import\b/, Keyword, :value

        mixin :content_common

        rule(/(?=[^;{}][;}])/) { push :attribute }
        rule(/(?=[^;{}:\[]+:[^a-z])/) { push :attribute }

        rule(//) { push :selector }
      end

      state :end_section do
        rule /\n/, Text
        rule(/[;{}]/) { token Punctuation; reset_stack }
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
rouge-3.2.1 lib/rouge/lexers/scss.rb
rouge-3.2.0 lib/rouge/lexers/scss.rb
rouge_ecl-0.0.1 lib/rouge/lexers/scss.rb
rouge-3.1.1 lib/rouge/lexers/scss.rb
rouge-3.1.0 lib/rouge/lexers/scss.rb