From 0a942419b7baa4c813e6c080a3d1d6a7f0439bdd Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Mon, 8 Nov 2021 17:18:38 -0800 Subject: [PATCH] Fix tokenization of $$^, issue c106 --- dev-bin/run_tokenizer_tests.pl.data | 3 +++ lib/Perl/Tidy/Tokenizer.pm | 4 +++- local-docs/BugLog.pod | 11 +++++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/dev-bin/run_tokenizer_tests.pl.data b/dev-bin/run_tokenizer_tests.pl.data index 0ed184c8..db0a24fc 100644 --- a/dev-bin/run_tokenizer_tests.pl.data +++ b/dev-bin/run_tokenizer_tests.pl.data @@ -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; diff --git a/lib/Perl/Tidy/Tokenizer.pm b/lib/Perl/Tidy/Tokenizer.pm index f0d82ce7..54c7733c 100644 --- a/lib/Perl/Tidy/Tokenizer.pm +++ b/lib/Perl/Tidy/Tokenizer.pm @@ -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 =~ /^[\),=#]/ ) { diff --git a/local-docs/BugLog.pod b/local-docs/BugLog.pod index 8f29937b..790e9950 100644 --- a/local-docs/BugLog.pod +++ b/local-docs/BugLog.pod @@ -2,6 +2,17 @@ =over 4 +=item B + +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 Automated random testing produced an error with something like the following -- 2.39.5