module Rouge module Lexers class Plist < RegexLexer desc 'plist' tag 'plist' aliases 'plist' filenames *%w(*.plist *.pbxproj) mimetypes 'text/x-plist', 'application/x-plist' def self.analyze_text(text) return 0.6 if text.start_with?("// !$*UTF8*$!") end 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, :pop! end end end end