]> git.eshelyaron.com Git - emacs.git/commit
cperl-mode.el: Use rx sequences for Perl grammar
authorHarald Jörg <haj@posteo.de>
Tue, 7 Sep 2021 20:11:41 +0000 (22:11 +0200)
committerHarald Jörg <haj@posteo.de>
Tue, 7 Sep 2021 20:31:06 +0000 (22:31 +0200)
commit81677cb6990a8afdea6d852a1e995139828dc8c8
tree4526b1b2fc1bc18e469fd8227b8d525117a7b3d6
parent6cca705aa6b2ae93da8e0cd0da71f87fe583058c
cperl-mode.el: Use rx sequences for Perl grammar

Following advice by Mattias Engdegård, most uses of rx-to-string
were eliminated, and rx sequences used instead to define Perl
grammar components.
* lisp/progmodes/cperl-mode.el: (cperl-block-declaration-p): New
function, replaces regexp literals.
(cperl-imenu--function-name-regexp-perl): Deleted, use rx
sequences to find imenu entries instead.
(cperl-indent-line): Use rx components instead of regexp literals.
(cperl-sniff-for-indent): use `cperl-block-declaration-p' to
increase accuracy, use rx sequence for labels to replace
inaccurate regexp literals.
(cperl-block-p): Replace inline comment by docstring.  Use
`cperl-block-declaration-p'.
(cperl-after-block-p): Use `cperl-block-declaration-p'.
(cperl-after-block-and-statement-beg): Replace inline comment by
docstring.
(cperl-imenu-package-keywords), (cperl-imenu-sub-keywords),
(cperl-imenu-pod-keywords) : New variables to sort imenu
entries into categories.
(cperl-imenu--create-perl-index): Use rx sequences to collect
imenu entries.
(cperl-init-faces): Use rx components instead of regexp literals
for labels.

* test/lisp/progmodes/cperl-mode-tests.el: Test rx sequences
instead of regexp strings
lisp/progmodes/cperl-mode.el
test/lisp/progmodes/cperl-mode-tests.el