From 4e475297bb8f094106a4e740eee65b7e51e389b6 Mon Sep 17 00:00:00 2001 From: Guillaume Laforge Date: Sat, 26 Aug 2023 01:58:38 +0200 Subject: [PATCH] Update groovy for record, enum, var (#1984) The 'record' keyword defines a new kind of record class. 'enum' was moved as the same level as the other types, as enums are also kind of classes. Added 'var' as an alternative to 'def' for defining variables and such. --- lib/rouge/lexers/groovy.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/rouge/lexers/groovy.rb b/lib/rouge/lexers/groovy.rb index d1a7c7760e..e794427cb1 100644 --- a/lib/rouge/lexers/groovy.rb +++ b/lib/rouge/lexers/groovy.rb @@ -23,7 +23,7 @@ def self.keywords def self.declarations @declarations ||= Set.new %w( - abstract const enum extends final implements native private + abstract const extends final implements native private protected public static strictfp super synchronized throws transient volatile ) @@ -31,7 +31,7 @@ def self.declarations def self.types @types ||= Set.new %w( - def boolean byte char double float int long short void + def var boolean byte char double float int long short void ) end @@ -56,7 +56,7 @@ def self.constants rule %r(//.*?$), Comment::Single rule %r(/[*].*?[*]/)m, Comment::Multiline rule %r/@\w[\w.]*/, Name::Decorator - rule %r/(class|interface|trait)\b/, Keyword::Declaration, :class + rule %r/(class|interface|trait|enum|record)\b/, Keyword::Declaration, :class rule %r/package\b/, Keyword::Namespace, :import rule %r/import\b/, Keyword::Namespace, :import