Created
June 6, 2016 20:51
-
-
Save KitaitiMakoto/740f4cbc9e47897b2f3af8e770b14184 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rouge/lexers/fluentd/version' | |
module Rouge | |
module Lexers | |
class Fluentd < Apache | |
title "Fluentd" | |
desc "configuration files for Fluentd" | |
tag "fluentd" | |
filenames "fluent.conf", "td-agent.conf" | |
@keywords = { | |
:sections => %w[match source filter system], | |
:directives => [], | |
:values => [] | |
} | |
prepend :root do | |
rule /@\w+/ do |m| | |
token Name::Builtin | |
push :directive | |
end | |
rule /\w+/ do |m| | |
token Name::Label | |
push :directive | |
end | |
end | |
prepend :section do | |
mixin :whitespace | |
rule /([^\s\.>]*)(?:(\.)([^\s\.>]+))*(>\n)/ do |m| | |
groups Literal::String::Symbol, Text, Literal::String::Symbol, Punctuation | |
pop! | |
end | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment