Skip Menu |

This queue is for tickets about the Perl-Tidy CPAN distribution.

Report information
The Basics
Id: 129850
Status: resolved
Priority: 0/
Queue: Perl-Tidy

People
Owner: Nobody in particular
Requestors: damien-43 [...] gmx.fr
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Missing space between some literals
Date: Wed, 19 Jun 2019 02:25:54 +0200
To: bug-Perl-Tidy [...] rt.cpan.org
From: Damien <damien-43 [...] gmx.fr>
Hello, I found some syntax which appear confuse spacing rules. ``` map { ; } [ 1 .. 2 ]; map { ; } { 1 => 2 }; map { ...; ...; } [ 1 .. 2 ]; map { ...; ...; } { 1 => 2 }; ``` Yield: ``` map { ; }[ 1 .. 2 ]; map { ; }{ 1 => 2 }; map { ...; ...; }[ 1 .. 2 ]; map { ...; ...; }{ 1 => 2 }; ``` This is reproducible with PerlTidy v20190601. Regards.
On Tue Jun 18 20:32:11 2019, damien-43@gmx.fr wrote: Show quoted text
> Hello, > > I found some syntax which appear confuse > spacing rules. > > ``` > map { ; } [ 1 .. 2 ]; > > map { ; } { 1 => 2 }; > > map { > ...; > ...; > } [ 1 .. 2 ]; > > map { > ...; > ...; > } { 1 => 2 }; > ``` > > Yield: > > ``` > map { ; }[ 1 .. 2 ]; > > map { ; }{ 1 => 2 }; > > map { > ...; > ...; > }[ 1 .. 2 ]; > > map { > ...; > ...; > }{ 1 => 2 }; > ``` > > This is reproducible with PerlTidy v20190601. > > Regards.
Hi, I assume you mean that there is no space between the '}' and '[', and between the '}' and the '{', as in the input text. These types of spaces involving specific pairs of tokens are controlled by a builtin table ('binary whitespace rules') for which there is at present no user control. I looked at this once and didn't see an easy way to give users general control of the table. If there is significant interest I could look at it again. Steve
I wrote a patch to make the output follow the input regarding this whitespace. This is the easiest way to fix this without introducing new input parameters. This will be in the next release.
Version 20190915 has a fix for this