Files
news.gitea.happylizard.me/bin/gems/rouge-4.7.0/lib/rouge/lexers/plist.rb
T
pizza2d1 4cee170d66
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 9s
Add bin and edit workflow
2026-09-16 13:11:16 -06:00

48 lines
1.1 KiB
Ruby

# frozen_string_literal: true
module Rouge
module Lexers
class Plist < RegexLexer
desc 'plist'
tag 'plist'
aliases 'plist'
filenames '*.plist', '*.pbxproj'
mimetypes 'text/x-plist', 'application/x-plist'
state :whitespace do
rule %r/\s+/, Text::Whitespace
end
state :root do
rule %r{//.*$}, Comment
rule %r{/\*.+?\*/}m, Comment
mixin :whitespace
rule %r/{/, Punctuation, :dictionary
rule %r/\(/, Punctuation, :array
rule %r/"([^"\\]|\\.)*"/, Literal::String::Double
rule %r/'([^'\\]|\\.)*'/, Literal::String::Single
rule %r/</, Punctuation, :data
rule %r{[\w$/:.-]+}, Literal
end
state :dictionary do
mixin :root
rule %r/[=;]/, Punctuation
rule %r/}/, Punctuation, :pop!
end
state :array do
mixin :root
rule %r/[,]/, Punctuation
rule %r/\)/, Punctuation, :pop!
end
state :data do
rule %r/[\h\s]+/, Literal::Number::Hex
rule %r/>/, Punctuation, :pop!
end
end
end
end