lib/rouge/lexers/sed.rb in rouge-2.0.7 vs lib/rouge/lexers/sed.rb in rouge-2.1.0

- old
+ new

@@ -22,14 +22,16 @@ rule /[()]/, Punctuation rule /./, Str::Regex end state :brackets do - rule /\^?/ do + rule /\^/ do token Punctuation goto :brackets_int end + + rule(//) { goto :brackets_int } end state :brackets_int do # ranges rule /.-./, Name::Variable @@ -131,10 +133,10 @@ ### address ranges ### addr_tok = Keyword::Namespace rule /\d+/, addr_tok rule /[$,~+!]/, addr_tok - rule %r((/)(\\.|.)*?(/)) do |m| + rule %r((/)((?:\\.|.)*?)(/)) do |m| token addr_tok, m[1]; delegate regex, m[2]; token addr_tok, m[3] end # alternate regex rage delimiters rule %r((\\)(.)(\\.|.)*?(\2)) do |m|