lib/rouge/lexers/python.rb in rouge-0.1.0 vs lib/rouge/lexers/python.rb in rouge-0.1.1

- old
+ new

@@ -150,10 +150,23 @@ state :nl do rule /\n/, 'Literal.String' end + state :escape do + rule %r(\\ + ( [\\abfnrtv"'] + | \n + | N{.*?} + | u[a-fA-F0-9]{4} + | U[a-fA-F0-9]{8} + | x[a-fA-F0-9]{2} + | [0-7]{1,3} + ) + )x, 'Literal.String.Escape' + end + state :dqs do rule /"/, 'Literal.String', :pop! rule /\\\\|\\"|\\\n/, 'Literal.String.Escape' mixin :strings end @@ -180,8 +193,9 @@ state :"escape_#{qtype}" do mixin :escape mixin :"#{qtype}" end end + end end end