Sha256: 5bfde836804e28f1efc42443206c7096296e647325b577711cc881bb0c78f120

Contents?: true

Size: 1.04 KB

Versions: 6

Compression:

Stored size: 1.04 KB

Contents

module Rouge
  module Lexers
    class Plist < RegexLexer
      desc 'plist'
      tag 'plist'
      aliases 'plist'
      filenames *%w(*.plist *.pbxproj)

      mimetypes 'text/x-plist', 'application/x-plist'

      state :whitespace do
        rule /\s+/, Text::Whitespace
      end

      state :root do
        rule %r{//.*$}, Comment
        rule %r{/\*.+?\*/}m, Comment
        mixin :whitespace
        rule /{/, Punctuation, :dictionary
        rule /\(/, Punctuation, :array
        rule /"([^"\\]|\\.)*"/, Literal::String::Double
        rule /'([^'\\]|\\.)*'/, Literal::String::Single
        rule /</, Punctuation, :data
        rule %r{[\w_$/:.-]+}, Literal
      end

      state :dictionary do
        mixin :root
        rule /[=;]/, Punctuation
        rule /}/, Punctuation, :pop!
      end

      state :array do
        mixin :root
        rule /[,]/, Punctuation
        rule /\)/, Punctuation, :pop!
      end

      state :data do
        rule /[\h\s]+/, Literal::Number::Hex
        rule />/, Punctuation, :pop!
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

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