Sha256: 1d8031300d673bd7ab968456db991c7e1488a6ac88a0a93186604fa9f40b83c4

Contents?: true

Size: 959 Bytes

Versions: 40

Compression:

Stored size: 959 Bytes

Contents

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

module Rouge
  module Lexers
    class CMHG < RegexLexer
      title "CMHG"
      desc "RISC OS C module header generator source file"
      tag 'cmhg'
      filenames '*.cmhg'

      def self.preproc_keyword
        @preproc_keyword ||= %w(
          define elif else endif error if ifdef ifndef include line pragma undef warning
        )
      end

      state :root do
        rule %r/;[^\n]*/, Comment
        rule %r/^([ \t]*)(#[ \t]*(?:(?:#{CMHG.preproc_keyword.join('|')})(?:[ \t].*)?)?)(?=\n)/ do
          groups Text, Comment::Preproc
        end
        rule %r/[-a-z]+:/, Keyword::Declaration
        rule %r/[a-z_]\w+/i, Name::Entity
        rule %r/"[^"]*"/, Literal::String
        rule %r/(?:&|0x)\h+/, Literal::Number::Hex
        rule %r/\d+/, Literal::Number
        rule %r/[,\/()]/, Punctuation
        rule %r/[ \t]+/, Text
        rule %r/\n+/, Text
      end
    end
  end
end

Version data entries

40 entries across 40 versions & 2 rubygems

Version Path
rouge-4.5.1 lib/rouge/lexers/cmhg.rb
rouge-4.5.0 lib/rouge/lexers/cmhg.rb
rouge-4.4.0 lib/rouge/lexers/cmhg.rb
rouge-4.3.0 lib/rouge/lexers/cmhg.rb
rouge-4.2.1 lib/rouge/lexers/cmhg.rb
rouge-4.2.0 lib/rouge/lexers/cmhg.rb
rouge-4.1.3 lib/rouge/lexers/cmhg.rb
rouge-4.1.2 lib/rouge/lexers/cmhg.rb
rouge-4.1.1 lib/rouge/lexers/cmhg.rb
mumukit-content-type-1.12.1 vendor/bundle/ruby/2.7.0/gems/rouge-3.30.0/lib/rouge/lexers/cmhg.rb
mumukit-content-type-1.12.0 vendor/bundle/ruby/2.7.0/gems/rouge-3.30.0/lib/rouge/lexers/cmhg.rb
rouge-4.1.0 lib/rouge/lexers/cmhg.rb
rouge-4.0.1 lib/rouge/lexers/cmhg.rb
rouge-4.0.0 lib/rouge/lexers/cmhg.rb
rouge-3.30.0 lib/rouge/lexers/cmhg.rb
rouge-3.29.0 lib/rouge/lexers/cmhg.rb
rouge-3.28.0 lib/rouge/lexers/cmhg.rb
rouge-3.27.0 lib/rouge/lexers/cmhg.rb
rouge-3.26.1 lib/rouge/lexers/cmhg.rb
mumukit-content-type-1.11.1 vendor/bundle/ruby/2.6.0/gems/rouge-3.26.0/lib/rouge/lexers/cmhg.rb