Sha256: 08a91527652aad8d9e9735826e87352828565203a9f86815cc41d376fb6bd9a9

Contents?: true

Size: 427 Bytes

Versions: 3

Compression:

Stored size: 427 Bytes

Contents

module Rouge
  module Lexers
    class Sed < Lexer
      # TODO: add rules for this
      class Regex < TextLexer
        default_option :token, 'Literal.String.Regex'
      end

      state :root do
        rule /\s+/m, 'Text'
        rule /#.*?\n/, 'Comment'

        rule /s(.)(\\.|.*?)(\1)/ do
          token re_tok
          push :flags
          push :subst
          push :regex
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rouge-0.2.8 lib/rouge/lexers/sed.rb
rouge-0.2.7 lib/rouge/lexers/sed.rb
rouge-0.2.6 lib/rouge/lexers/sed.rb