module Rouge module Lexers class TOML < RegexLexer desc 'the TOML configuration format' tag 'toml' filenames '*.toml' mimetypes 'text/x-toml' def self.analyze_text(text) return 0.1 if text =~ /\A\[[\w.]+\]\s*\w+\s*=\s*("\w+")+/ end identifier = /[\w.\S]+/ state :basic do rule /\s+/, 'Text' rule /#.*?$/, 'Comment' rule /(true|false)/, 'Keyword.Constant' rule /(?