Sha256: 656d3313f3db748acc05614796ad6ac3e988308b54c48188b5bbd60869711ca6

Contents?: true

Size: 1.04 KB

Versions: 7

Compression:

Stored size: 1.04 KB

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

7 entries across 7 versions & 1 rubygems

Version Path
rouge-2.0.5 lib/rouge/lexers/biml.rb
rouge-2.0.3 lib/rouge/lexers/biml.rb
rouge-2.0.2 lib/rouge/lexers/biml.rb
rouge-2.0.1 lib/rouge/lexers/biml.rb
rouge-2.0.0 lib/rouge/lexers/biml.rb
rouge-1.11.1 lib/rouge/lexers/biml.rb
rouge-1.11.0 lib/rouge/lexers/biml.rb