Sha256: b0d9b9f0799bb214f960f755bccb7c8f0400a1b43293fe9e1b1b79d07c33dcff

Contents?: true

Size: 625 Bytes

Versions: 9

Compression:

Stored size: 625 Bytes

Contents

# -*- coding: utf-8 -*- #

module Rouge
  module Lexers
    class LiterateCoffeescript < RegexLexer
      tag 'literate_coffeescript'
      desc 'Literate coffeescript'
      aliases 'litcoffee'
      filenames '*.litcoffee'

      def markdown
        @markdown ||= Markdown.new(options)
      end

      def coffee
        @coffee ||= Coffeescript.new(options)
      end

      start { markdown.reset!; coffee.reset! }

      state :root do
        rule /^(    .*?\n)+/m do
          delegate coffee
        end

        rule /^([ ]{0,3}(\S.*?|)\n)*/m do
          delegate markdown
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rouge-1.7.7 lib/rouge/lexers/literate_coffeescript.rb
rouge-1.7.4 lib/rouge/lexers/literate_coffeescript.rb
rouge-1.7.3 lib/rouge/lexers/literate_coffeescript.rb
rouge-1.7.2 lib/rouge/lexers/literate_coffeescript.rb
rouge-1.7.1 lib/rouge/lexers/literate_coffeescript.rb
rouge-1.7.0 lib/rouge/lexers/literate_coffeescript.rb
rouge-1.6.2 lib/rouge/lexers/literate_coffeescript.rb
rouge-1.6.1 lib/rouge/lexers/literate_coffeescript.rb
rouge-1.5.1 lib/rouge/lexers/literate_coffeescript.rb