Skip to content

Instantly share code, notes, and snippets.

@KitaitiMakoto
Created June 6, 2016 20:51
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save KitaitiMakoto/740f4cbc9e47897b2f3af8e770b14184 to your computer and use it in GitHub Desktop.
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