lib/rouge/lexers/java.rb in rouge-3.3.0 vs lib/rouge/lexers/java.rb in rouge-3.4.0

- old
+ new

@@ -22,10 +22,12 @@ ) types = %w(boolean byte char double float int long short var void) id = /[a-zA-Z_][a-zA-Z0-9_]*/ + const_name = /[A-Z][A-Z0-9_]*\b/ + class_name = /[A-Z][a-zA-Z0-9]*\b/ state :root do rule /[^\S\n]+/, Text rule %r(//.*?$), Comment::Single rule %r(/\*.*?\*/)m, Comment::Multiline @@ -57,9 +59,11 @@ rule /(\.)(#{id})/ do groups Operator, Name::Attribute end rule /#{id}:/, Name::Label + rule const_name, Name::Constant + rule class_name, Name::Class rule /\$?#{id}/, Name rule /[~^*!%&\[\](){}<>\|+=:;,.\/?-]/, Operator digit = /[0-9]_+[0-9]|[0-9]/ bin_digit = /[01]_+[01]|[01]/