From fa9a62c2d05eb72af06a8fde95966b3dd94b1114 Mon Sep 17 00:00:00 2001 From: Guillaume Laforge Date: Sun, 8 Oct 2023 22:13:58 +0200 Subject: [PATCH] enh(groovy) Add `record` and `var` keywords (#3872) --- CHANGES.md | 4 ++++ src/languages/groovy.js | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 3ea61a4bbe..ac117f3bf2 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -42,6 +42,7 @@ Core Grammars: - enh(swift) macro attributes are highlighted as keywords [Bradley Mackey][] - enh(stan) updated for version 2.33 (#3859) [Brian Ward][] - fix(css) added '_' css variable detection [Md Saad Akhtar][] +- enh(groovy) add `record` and `var` as keywords [Guillaume Laforge][] Dev tool: @@ -66,6 +67,8 @@ Dev tool: [Yasith Deelaka]: https://github.com/YasithD [Brian Ward]: https://github.com/WardBrian [Md Saad Akhtar]: https://github.com/akhtarmdsaad +[Guillaume Laforge]: https://github.com/glaforge + ## Version 11.8.0 @@ -118,6 +121,7 @@ Core Grammars: [Cyrus Kao]: https://github.com/CyrusKao [Zlondrej]: https://github.com/zlondrej + ## Version 11.7.0 New Grammars: diff --git a/src/languages/groovy.js b/src/languages/groovy.js index 26aac79378..57e204dbda 100644 --- a/src/languages/groovy.js +++ b/src/languages/groovy.js @@ -66,7 +66,7 @@ export default function(hljs) { const CLASS_DEFINITION = { match: [ - /(class|interface|trait|enum|extends|implements)/, + /(class|interface|trait|enum|record|extends|implements)/, /\s+/, hljs.UNDERSCORE_IDENT_RE ], @@ -126,7 +126,8 @@ export default function(hljs) { "import", "package", "return", - "instanceof" + "instanceof", + "var" ]; return {