Sha256: b6c262f612a22244d41df273d1a2a4ecdb9ffd2059a8a20163c746b6020e5500

Contents?: true

Size: 542 Bytes

Versions: 4

Compression:

Stored size: 542 Bytes

Contents

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

module Rouge
  module Lexers
    load_lexer 'json.rb'

    class JSONDOC < JSON
      desc "JavaScript Object Notation with extensions for documentation"
      tag 'json-doc'

      prepend :name do
        rule %r/([$\w]+)(\s*)(:)/ do
          groups Name::Attribute, Text, Punctuation
        end
      end

      prepend :value do
        rule %r(/[*].*?[*]/), Comment
        rule %r(//.*?$), Comment::Single
        rule %r/(\.\.\.)/, Comment::Single
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rouge-3.17.0 lib/rouge/lexers/json_doc.rb
rouge-3.16.0 lib/rouge/lexers/json_doc.rb
rouge-3.15.0 lib/rouge/lexers/json_doc.rb
rouge-3.14.0 lib/rouge/lexers/json_doc.rb