Sha256: 7b631b67ca89114d869b284224c34ddfe55cb48abd8181ec81ade809efa36bda

Contents?: true

Size: 1.28 KB

Versions: 8

Compression:

Stored size: 1.28 KB

Contents

require 'set'
module Rouge
  module Lexers
    load_lexer 'yaml.rb'

    class Digdag < YAML
      title 'digdag'
      desc 'A simple, open source, multi-cloud workflow engine (https://www.digdag.io/)'
      tag 'digdag'
      filenames '*.dig'

      mimetypes 'application/x-digdag'

      def self.analyze_text(text)
        # disable YAML.analyze_text
      end

      # http://docs.digdag.io/operators.html
      # as of digdag v0.9.10
      KEYWORD_PATTERN = Regexp.union(%w(
        call
        require
        loop
        for_each
        if
        fail
        echo

        td
        td_run
        td_ddl
        td_load
        td_for_each
        td_wait
        td_wait_table
        td_partial_delete
        td_table_export

        pg

        mail
        http
        s3_wait
        redshift
        redshift_load
        redshift_unload
        emr

        gcs_wait
        bq
        bq_ddl
        bq_extract
        bq_load

        sh
        py
        rb
        embulk
      ).map { |name| "#{name}>"} + %w(
        _do
        _parallel
      ))

      prepend :block_nodes do
        rule /(#{KEYWORD_PATTERN})(:)(?=\s|$)/ do |m|
          groups Keyword::Reserved, Punctuation::Indicator
          set_indent m[0], :implicit => true
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 5 rubygems

Version Path
files.com-1.0.55 docs/vendor/bundle/ruby/2.5.0/gems/rouge-2.2.1/lib/rouge/lexers/digdag.rb
rouge_ecl-1.0.0 lib/rouge/lexers/digdag.rb
rouge-2.2.1 lib/rouge/lexers/digdag.rb
rouge-2.2.0 lib/rouge/lexers/digdag.rb
rougegal-2.1.2 lib/rouge/lexers/digdag.rb
tdiary-5.0.5 vendor/bundle/gems/rouge-2.1.1/lib/rouge/lexers/digdag.rb
rouge-2.1.1 lib/rouge/lexers/digdag.rb
rouge-2.1.0 lib/rouge/lexers/digdag.rb