Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: rrwo [...] cpan.org
Cc:
AdminCc:

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



Subject: [RFE] option to add a space before references to string constants
Date: Tue, 28 Nov 2017 12:05:36 +0000
To: bug-Perl-Tidy [...] rt.cpan.org
From: Robert Rothenberg <rrwo [...] cpan.org>
The following code confuses syntax highlighters: \"string" \'string" (This is often used in DBIC-related code.) It would be nice to insert a space so that syntax highlighters are not confused, e.g. \ "string" \ 'string"
Subject: Re: [rt.cpan.org #123774] [RFE] option to add a space before references to string constants
Date: Tue, 28 Nov 2017 09:31:46 -0800
To: "bug-Perl-Tidy [...] rt.cpan.org" <bug-Perl-Tidy [...] rt.cpan.org>
From: Steven Hancock <s7078hancock [...] gmail.com>
Okay, I've written a patch for the next version and have to decide on a flag. Maybe something like -sbq=n (--space-backslash-quote=n), where n=0 means no space, n=1 means follow existing code, n=2 means always space. Default would be n=1 (keep a space if one is in the source code). Steve On Tue, Nov 28, 2017 at 4:06 AM, Robert Rothenberg via RT < bug-Perl-Tidy@rt.cpan.org> wrote: Show quoted text
> Tue Nov 28 07:06:29 2017: Request 123774 was acted upon. > Transaction: Ticket created by RRWO > Queue: Perl-Tidy > Subject: [RFE] option to add a space before references to string > constants > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: rrwo@cpan.org > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=123774 > > > > > The following code confuses syntax highlighters: > > \"string" > \'string" > > (This is often used in DBIC-related code.) > > It would be nice to insert a space so that syntax highlighters are not > confused, e.g. > > \ "string" > \ 'string" > >
Version 20171214 adds a flag to control a space between a backslash and a single or double quote. The new flag to control this is -sbq=n (--space-backslash-quote=n), where n=0 means no space, n=1 means follow existing code, n=2 means always space. The default is n=1, meaning that a space will be retained if there is one in the source code.