lib/rouge/lexers/python.rb in rouge-2.0.6 vs lib/rouge/lexers/python.rb in rouge-2.0.7

- old
+ new

@@ -80,10 +80,11 @@ Text, Name::Namespace, Text, Keyword::Namespace end + rule /(import)(\s+)(#{dotted_identifier})/ do groups Keyword::Namespace, Text, Name::Namespace end rule /(def)((?:\s|\\\s)+)/ do @@ -151,27 +152,9 @@ mixin :root end state :yield do mixin :raise - end - - state :import do - # non-line-terminating whitespace - rule /(?:[ \t]|\\\n)+/, Text - - rule /as\b/, Keyword::Namespace - rule /,/, Operator - rule dotted_identifier, Name::Namespace - rule(//) { pop! } # anything else -> go back - end - - state :fromimport do - # non-line-terminating whitespace - rule /(?:[ \t]|\\\n)+/, Text - - rule /import\b/, Keyword::Namespace, :pop! - rule dotted_identifier, Name::Namespace end state :strings do rule /%(\([a-z0-9_]+\))?[-#0 +]*([0-9]+|[*])?(\.([0-9]+|[*]))?/i, Str::Interpol end