Sha256: 76bce73c9380ef28c921332ae84119106cbdb325f8bd47b1ebff3621562b1ff8
Contents?: true
Size: 813 Bytes
Versions: 4
Compression:
Stored size: 813 Bytes
Contents
# -*- coding: utf-8 -*- # # frozen_string_literal: true module Rouge module Lexers class LiterateHaskell < RegexLexer title "Literate Haskell" desc 'Literate haskell' tag 'literate_haskell' aliases 'lithaskell', 'lhaskell', 'lhs' filenames '*.lhs' mimetypes 'text/x-literate-haskell' def haskell @haskell ||= Haskell.new(options) end start { haskell.reset! } # TODO: support TeX versions as well. state :root do rule /\s*?\n(?=>)/, Text, :code rule /.*?\n/, Text rule /.+\z/, Text end state :code do rule /(>)( .*?(\n|\z))/ do |m| token Name::Label, m[1] delegate haskell, m[2] end rule /\s*\n(?=\s*[^>])/, Text, :pop! end end end end
Version data entries
4 entries across 4 versions & 2 rubygems