Sha256: c90b99c602e1fba0a3b9a46f0ce6b9b51346477386bb60786a309342ec0eac2b

Contents?: true

Size: 988 Bytes

Versions: 13

Compression:

Stored size: 988 Bytes

Contents

module Rouge
  module Lexers
    load_lexer 'xml.rb'

    class BIML < XML
      title "BIML"
      desc "BIML, Business Intelligence Markup Language"
      tag 'biml'
      filenames '*.biml'

      def self.analyze_text(text)
        return 1 if text =~ /<\s*Biml\b/
      end

      prepend :root do
        rule %r(<#\@\s*)m, Name::Tag, :directive_tag

        rule %r(<#[=]?\s*)m, Name::Tag, :directive_as_csharp
      end

      prepend :attr do
        #TODO: how to deal with embedded <# tags inside a attribute string
        #rule %r("<#[=]?\s*)m, Name::Tag, :directive_as_csharp
      end

      state :directive_as_csharp do
        rule /\s*#>\s*/m, Name::Tag, :pop!
        rule %r(.*?(?=\s*#>\s*))m do
          delegate CSharp
        end
      end

      state :directive_tag do
        rule /\s+/m, Text
        rule /[\w.:-]+\s*=/m, Name::Attribute, :attr
        rule /[\w]+\s*/m, Name::Attribute
        rule %r(/?\s*#>), Name::Tag, :pop!
      end
    end
  end
end

Version data entries

13 entries across 11 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/biml.rb
rouge_ecl-1.0.0 lib/rouge/lexers/biml.rb
rouge-2.2.1 lib/rouge/lexers/biml.rb
rouge-2.2.0 lib/rouge/lexers/biml.rb
rougegal-2.1.2 lib/rouge/lexers/biml.rb
tdiary-5.0.5 vendor/bundle/gems/rouge-2.0.7/lib/rouge/lexers/biml.rb
tdiary-5.0.5 vendor/bundle/gems/rouge-2.1.1/lib/rouge/lexers/biml.rb
tdiary-5.0.5 vendor/bundle/gems/tdiary-5.0.4/vendor/bundle/gems/rouge-2.0.7/lib/rouge/lexers/biml.rb
rouge-2.1.1 lib/rouge/lexers/biml.rb
rouge-2.1.0 lib/rouge/lexers/biml.rb
tdiary-5.0.4 vendor/bundle/gems/rouge-2.0.7/lib/rouge/lexers/biml.rb
rouge-2.0.7 lib/rouge/lexers/biml.rb
rouge-2.0.6 lib/rouge/lexers/biml.rb