rf-web/vendor/bundle/gems/rouge-3.12.0/lib/rouge/lexers/conf.rb
2019-10-21 10:18:17 +02:00

26 lines
559 B
Ruby

# -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
class Conf < RegexLexer
tag 'conf'
aliases 'config', 'configuration'
title "Config File"
desc 'A generic lexer for configuration files'
filenames '*.conf', '*.config'
# short and sweet
state :root do
rule %r/#.*?\n/, Comment
rule %r/".*?"/, Str::Double
rule %r/'.*?'/, Str::Single
rule %r/[a-z]\w*/i, Name
rule %r/\d+/, Num
rule %r/[^\w#"']+/, Text
end
end
end
end