From 953e4681779130e9243327928058f2b7f4f4b1d9 Mon Sep 17 00:00:00 2001 From: Guillaume Laforge Date: Sat, 23 Sep 2023 10:31:27 +0200 Subject: [PATCH 1/4] Add record and var keywords to Groovy syntax --- src/languages/groovy.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 { From 2c7b88b7fe16d199020199a87e87b642058cc664 Mon Sep 17 00:00:00 2001 From: Guillaume Laforge Date: Sun, 8 Oct 2023 15:56:43 +0000 Subject: [PATCH 2/4] Changes for groovy syntax --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index 3ea61a4bbe..b387da7488 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -97,6 +97,7 @@ Core Grammars: - enh(php) detect newer more flexible NOWdoc syntax (#3679) [Timur Kamaev][] - enh(python) improve autodetection of code with type hinting any function's return type (making the `->` operator legal) [Keyacom][] - enh(bash) add `select` and `until` as keywords +- enh(groovy) add `record` and `var` as keywords [Guillaume Laforge][] [arnoudbuzing]: https://github.com/arnoudbuzing [aliaegik]: https://github.com/aliaegik From 5f86768d2cf5c8c0c529a1f9d938c4f0048967da Mon Sep 17 00:00:00 2001 From: Guillaume Laforge Date: Sun, 8 Oct 2023 16:55:39 +0000 Subject: [PATCH 3/4] Added subscript link, moved enh to the unreleased version instead --- CHANGES.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index b387da7488..e847df970f 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: @@ -97,7 +98,6 @@ Core Grammars: - enh(php) detect newer more flexible NOWdoc syntax (#3679) [Timur Kamaev][] - enh(python) improve autodetection of code with type hinting any function's return type (making the `->` operator legal) [Keyacom][] - enh(bash) add `select` and `until` as keywords -- enh(groovy) add `record` and `var` as keywords [Guillaume Laforge][] [arnoudbuzing]: https://github.com/arnoudbuzing [aliaegik]: https://github.com/aliaegik @@ -118,6 +118,7 @@ Core Grammars: [Boris Verkhovskiy]: https://github.com/verhovsky [Cyrus Kao]: https://github.com/CyrusKao [Zlondrej]: https://github.com/zlondrej +[Guillaume Laforge]: https://github.com/glaforge ## Version 11.7.0 From c898c9370f4f6b579ae5d387ff302ac8dc86a20d Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Sun, 8 Oct 2023 16:11:05 -0400 Subject: [PATCH 4/4] Update CHANGES.md --- CHANGES.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index e847df970f..ac117f3bf2 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -67,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,7 +120,7 @@ Core Grammars: [Boris Verkhovskiy]: https://github.com/verhovsky [Cyrus Kao]: https://github.com/CyrusKao [Zlondrej]: https://github.com/zlondrej -[Guillaume Laforge]: https://github.com/glaforge + ## Version 11.7.0