Sha256: fedfd668f0ba65de1dde350e52322f414cae08d16c98579f571a5afbd9a896c4
Contents?: true
Size: 1.03 KB
Versions: 4
Compression:
Stored size: 1.03 KB
Contents
# -*- coding: utf-8 -*- # # frozen_string_literal: true module Rouge module Lexers class INI < RegexLexer title "INI" desc 'the INI configuration format' tag 'ini' # TODO add more here filenames '*.ini', '*.INI', '*.gitconfig' mimetypes 'text/x-ini' identifier = /[\w\-.]+/ state :basic do rule /[;#].*?\n/, Comment rule /\s+/, Text rule /\\\n/, Str::Escape end state :root do mixin :basic rule /(#{identifier})(\s*)(=)/ do groups Name::Property, Text, Punctuation push :value end rule /\[.*?\]/, Name::Namespace end state :value do rule /\n/, Text, :pop! mixin :basic rule /"/, Str, :dq rule /'.*?'/, Str mixin :esc_str rule /[^\\\n]+/, Str end state :dq do rule /"/, Str, :pop! mixin :esc_str rule /[^\\"]+/m, Str end state :esc_str do rule /\\./m, Str::Escape end end end end
Version data entries
4 entries across 4 versions & 2 rubygems
Version | Path |
---|---|
rouge-3.4.1 | lib/rouge/lexers/ini.rb |
rouge-3.4.0 | lib/rouge/lexers/ini.rb |
rouge-alda-3.3.0 | lib/rouge/lexers/ini.rb |
rouge-3.3.0 | lib/rouge/lexers/ini.rb |