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