]> git.donarmstrong.com Git - perltidy.git/commitdiff
fix tokenization issue b1280
authorSteve Hancock <perltidy@users.sourceforge.net>
Fri, 17 Dec 2021 13:55:49 +0000 (05:55 -0800)
committerSteve Hancock <perltidy@users.sourceforge.net>
Fri, 17 Dec 2021 13:55:49 +0000 (05:55 -0800)
dev-bin/run_convergence_tests.pl.data
lib/Perl/Tidy/Tokenizer.pm

index b1e48b43f0610290bbbf16a919051b69b98d4038..53295cb73f0ef328464b214af11081cc604e3063 100644 (file)
@@ -8452,6 +8452,50 @@ function(
 --maximum-line-length=30
 --variable-maximum-line-length
 
+==> b1280.in <==
+# S1
+    for my $method qw(GetBook Wishlist AddBook RemoveBook
+      PurchaseBooks) {
+        eval "sub $method";
+        *$method = sub {
+            my $self = shift->new;
+            die SOAP::Fault->faultcode('Server.RequestError')
+              ->faultstring('Could not get object')
+              unless $self;
+
+            my $smethod = "SUPER::$method";
+            my $res     = $self->$smethod(@_);
+            die SOAP::Fault->faultcode('Server.ExecError')
+              ->faultstring("Execution error: $res")
+              unless ref($res);
+
+            $res;
+        };
+      }
+# S2
+    for my $method qw(GetBook Wishlist AddBook RemoveBook
+      PurchaseBooks)
+      {
+        eval "sub $method";
+        *$method = sub {
+            my $self = shift->new;
+            die SOAP::Fault->faultcode('Server.RequestError')
+              ->faultstring('Could not get object')
+              unless $self;
+
+            my $smethod = "SUPER::$method";
+            my $res     = $self->$smethod(@_);
+            die SOAP::Fault->faultcode('Server.ExecError')
+              ->faultstring("Execution error: $res")
+              unless ref($res);
+
+            $res;
+        };
+      }
+
+==> b1280.par <==
+--brace-left-and-indent
+
 ==> b131.in <==
         unless
           ( open( SCORE, "+>>$Score_File" ) )
index a752ebbadada028c7f5a140c23afa3eb116895e2..9229a0a0069366922e1bc91acc74edad0f64a03a 100644 (file)
@@ -3500,7 +3500,11 @@ EOM
                     $routput_token_type->[$i] = $type;
 
                 }
-                $tok = $quote_character if ($quote_character);
+
+                # Removed to fix b1280.  This is not needed and was causing the
+                # starting type 'qw' to be lost, leading to mis-tokenization of
+                # a trailing block brace in a parenless for stmt 'for .. qw.. {'
+                ##$tok = $quote_character if ($quote_character);
 
                 # scan for the end of the quote or pattern
                 (
@@ -9806,4 +9810,3 @@ BEGIN {
 
     @is_keyword{@Keywords} = (1) x scalar(@Keywords);
 }
-1;