cperl-mode.el: Add support for new Perl syntax in Perl 5.36 and 5.38
Perl 5.38 was released on 2023-07-03. This patch supports the new features
for 5.36 and 5.38 for font-lock, indentation, and imenu index creation.
* lisp/progmodes/cperl-mode.el (cperl-praise): Mention classes.
(defconst): Fix typo in docstring of cperl--single-attribute-rx.
Add "class" to cperl--package-rx, and adjust its docstring.
New rx sequence cperl--class-for-imenu-rx to capture classes,
use this in cperl--imenu-entries-rx.
Add "method" to cperl--sub-name-for-imenu-rx.
Add "class" to cperl--block-declaration-rx.
(cperl-sub-keywords): Add "method".
(cperl-mode): Add "ADJUST" to defun-prompt-regexp.
(cperl-after-block-p): Add new keywords for Perl 5.36 and 5.38.
(cperl-indent-exp): Add "field" to expression starters.
(cperl-imenu--create-perl-index): Rename variables refering to
"package", because they also contain classes.
(cperl-init-faces): Add new keywords for Perl 5.36 and 5.38.
(cperl-find-tags): Add support for "class".
(cperl-short-docs): Add new keywords for Perl 5.36 and 5.38.
(cperl-indent-exp): Add new keywords for Perl 5.36 and 5.38.
* test/lisp/progmodes/cperl-mode-tests.el
(cperl-test-fontify-class): New test for fontification of class
elements.
(cperl-test-imenu-index): Add tests for (nested) class
definitions.
* test/lisp/progmodes/cperl-mode-resources/cperl-indents.erts:
Add test cases for try/catch/finally, defer, class, method
* test/lisp/progmodes/cperl-mode-resources/perl-class.pl: New
resource for fontification tests of class elements.
* test/lisp/progmodes/cperl-mode-resources/grammar.pl: Add some
classes to the test resource.