]> git.donarmstrong.com Git - perltidy.git/commitdiff
Fix tokenization of $$^, issue c106
authorSteve Hancock <perltidy@users.sourceforge.net>
Tue, 9 Nov 2021 01:18:38 +0000 (17:18 -0800)
committerSteve Hancock <perltidy@users.sourceforge.net>
Tue, 9 Nov 2021 01:18:38 +0000 (17:18 -0800)
dev-bin/run_tokenizer_tests.pl.data
lib/Perl/Tidy/Tokenizer.pm
local-docs/BugLog.pod

index 0ed184c8dad823df37fb4a181e9fcf55dfd932b6..db0a24fc64e47685d7b243aa520ecfefa6e169e0 100644 (file)
@@ -146,3 +146,6 @@ print $fh <>;          # syntax error
 print $fh < >;         # syntax error
 print $fh < 6>;        # error
 print $fh <6>;         # error
+
+==> c106.in <==
+my$seed=$$^$^T;
index f0d82ce7d6eb4708f9fabfd112aa56aaf0e3c8ed..54c7733c1eb6c29429a0798e2050ff6550b2af71 100644 (file)
@@ -7320,9 +7320,11 @@ EOM
                 }
                 else {
                     $id_scan_state = '';
+                    $i             = $i_save;
+                    last;    # c106
                 }
             }
-            else {    # something else
+            else {           # something else
 
                 if ( $in_prototype_or_signature && $tok =~ /^[\),=#]/ ) {
 
index 8f29937b1fcca6887504fe1cf95e7f671c1a19b6..790e995034a2cad82f1b40372ba2865e1beb16e9 100644 (file)
@@ -2,6 +2,17 @@
 
 =over 4
 
+=item B<Fix tokenization of $$^, issue c106>
+
+Automated random testing produced an error tokenizing the following fragment:
+
+   my$seed=$$^$^T;
+
+The first ^ should have been tokenized as the bitwise xor operator but was not.
+This is fixed with this update.
+
+8 Nov 2021
+
 =item B<Fix coding error, issue c104>
 
 Automated random testing produced an error with something like the following