]> git.donarmstrong.com Git - perltidy.git/commitdiff
fix problem formatting function 'err'
authorSteve Hancock <perltidy@users.sourceforge.net>
Tue, 30 Aug 2022 13:42:15 +0000 (06:42 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Tue, 30 Aug 2022 13:42:15 +0000 (06:42 -0700)
CHANGES.md
lib/Perl/Tidy/Tokenizer.pm

index 767780abc10fda8fd21741af3e42e63b17c1c168..4470c4ed7a929966d02d565e5207d488e1033bbb 100644 (file)
       Also, previously a word following a '->' was given the color of a bareword,
       black by default, but now it is given the color of an identifier.
 
+    - Fixed incorrect formatting of any function named 'err'.  This was
+      due to some old code when use feature 'err' was valid.
+
+            # OLD:
+            my ($curr) = current();
+              err (@_);
+
+            # NEW:
+            my ($curr) = current();
+            err(@_);
+
     - This version runs about 5 percent faster on large files than the previous
       release.
 
index e6e26158fe0b2762c3c8475c57a4d92b6d9fcbf6..c9be062794ccb82e93895d3ee4bc64b60280d93f 100644 (file)
@@ -3671,6 +3671,12 @@ EOM
             $statement_type = $tok;    # next '{' is block
         }
 
+        # feature 'err' was removed in Perl 5.10.  So mark this as
+        # a bareword unless an operator is expected (see c158).
+        elsif ( $tok eq 'err' ) {
+            if ( $expecting != OPERATOR ) { $type = 'w' }
+        }
+
         return;
     } ## end sub do_KEYWORD