Sha256: 445a759d9869909aa8c3fa6f93b643e48b80a53580aa80b7621fbc7aa7879444

Contents?: true

Size: 803 Bytes

Versions: 13

Compression:

Stored size: 803 Bytes

Contents

# -*- coding: utf-8 -*- #
# frozen_string_literal: true

module Rouge
  module Lexers
    class SystemD < RegexLexer
      tag 'systemd'
      aliases 'unit-file'
      filenames '*.service'
      mimetypes 'text/x-systemd-unit'
      desc 'A lexer for systemd unit files'

      state :root do
        rule %r/\s+/, Text
        rule %r/[;#].*/, Comment
        rule %r/\[.*?\]$/, Keyword
        rule %r/(.*?)(=)(.*)(\\\n)/ do
          groups Name::Tag, Punctuation, Text, Str::Escape
          push :continuation
        end
        rule %r/(.*?)(=)(.*)/ do
          groups Name::Tag, Punctuation, Text
        end
      end

      state :continuation do
        rule %r/(.*?)(\\\n)/ do
          groups Text, Str::Escape
        end
        rule %r/(.*)'/, Text, :pop!
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
mumukit-content-type-1.12.1 vendor/bundle/ruby/2.7.0/gems/rouge-3.30.0/lib/rouge/lexers/systemd.rb
mumukit-content-type-1.12.0 vendor/bundle/ruby/2.7.0/gems/rouge-3.30.0/lib/rouge/lexers/systemd.rb
rouge-4.0.0 lib/rouge/lexers/systemd.rb
rouge-3.30.0 lib/rouge/lexers/systemd.rb
rouge-3.29.0 lib/rouge/lexers/systemd.rb
rouge-3.28.0 lib/rouge/lexers/systemd.rb
rouge-3.27.0 lib/rouge/lexers/systemd.rb
rouge-3.26.1 lib/rouge/lexers/systemd.rb
mumukit-content-type-1.11.1 vendor/bundle/ruby/2.6.0/gems/rouge-3.26.0/lib/rouge/lexers/systemd.rb
rouge-3.26.0 lib/rouge/lexers/systemd.rb
rouge-3.25.0 lib/rouge/lexers/systemd.rb
rouge-3.24.0 lib/rouge/lexers/systemd.rb
rouge-3.23.0 lib/rouge/lexers/systemd.rb