This commit is contained in:
1 parent
c8ac4fcae5
commit
4cee170d66
17576 files changed
+895740
-2
No files matched your search
@@ -0,0 +1,25 @@
|
||||
# -*- 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
|
||||
Reference in new issue
Block a user