From: Steve Hancock Date: Fri, 28 May 2021 04:52:15 +0000 (-0700) Subject: Fix parsing error at operator following a comma X-Git-Tag: 20210402.01~24 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=b537a72ac245fc040112d14e5fb02a20460d36da;p=perltidy.git Fix parsing error at operator following a comma --- diff --git a/lib/Perl/Tidy/Tokenizer.pm b/lib/Perl/Tidy/Tokenizer.pm index a9fea6e9..2e5f6bc8 100644 --- a/lib/Perl/Tidy/Tokenizer.pm +++ b/lib/Perl/Tidy/Tokenizer.pm @@ -2844,13 +2844,13 @@ EOM '&&' => sub { error_if_expecting_TERM() - if ( $expecting == TERM ); - }, + if ( $expecting == TERM && $last_nonblank_token ne ',' ); #c015 + }, '||' => sub { error_if_expecting_TERM() - if ( $expecting == TERM ); - }, + if ( $expecting == TERM && $last_nonblank_token ne ',' ); #c015 + }, '//' => sub { error_if_expecting_TERM() diff --git a/local-docs/BugLog.pod b/local-docs/BugLog.pod index 07f34efe..57f539a6 100644 --- a/local-docs/BugLog.pod +++ b/local-docs/BugLog.pod @@ -2,6 +2,26 @@ =over 4 +=item B + +The following lines are syntactically correct but some were producing a +syntax error + + print "hello1\n", || print "hi1\n"; + print "hello2\n", && print "bye2\n"; + print "hello3\n", or print "bye3\n"; + print "hello4\n", and print "bye4\n"; + +For example, the first line produced this message + + 1: print "hello1\n", || print "hi1\n"; + - ^ + found || where term expected (previous token underlined) + +This has been fixed. This fixes case c015. + +27 May 2021. + =item B An optional letter 'o' or 'O' in the octal representation of numbers, which was @@ -13,7 +33,7 @@ For example: $a = 0o100; $a = 0O100; -26 May 2021. +26 May 2021, 544df8c. =item B