]> git.donarmstrong.com Git - perltidy.git/commit
add --use-feature=class, part 1
authorSteve Hancock <perltidy@users.sourceforge.net>
Sat, 31 Dec 2022 17:24:04 +0000 (09:24 -0800)
committerSteve Hancock <perltidy@users.sourceforge.net>
Sat, 31 Dec 2022 17:24:04 +0000 (09:24 -0800)
commit4ba5a84e82bfe7d2a1890d7032e41afbf227ed4f
tree442e5fcf36c1c7be902a44b7eb8fdc58098dbfe8
parent54a4410bb20f62883d599821031b1334235c9aa7
add --use-feature=class, part 1

This version adds option --use-feature='class' to format code using "use feature 'class'" (see rt145706).  The main changes are:

'class' is treated as a generalization of 'package'. It is updated to accept
attributes and an optional BLOCK.

'method' is handled using the existing --sub-alias-list option,
  i.e. --sub-alias-list=method

'field' is treated the same as 'my'

'ADJUST' is treated like 'BEGIN'

In a future update, the new option --use-feature="class" will be set
to be the default.  That requires some additional updates to avoid
conflicts with older uses of these keywords.
lib/Perl/Tidy.pm
lib/Perl/Tidy/Formatter.pm
lib/Perl/Tidy/Tokenizer.pm