Open p5pRT opened 11 years ago
% perl -we 'printf "%vd\n"\, "\c\"' Can't find string terminator '"' anywhere before EOF at -e line 1. % perl -we 'printf "%vd\n"\, "\c\\"' 28.92 % perl -we 'printf "%vd\n"\, "\x1c\\"' 28.92
There's no way to get a CTRL-\ (0x1C) with perl's \c notation.
The obvious syntax "\c\" is a syntax error.
The next try "\c\\" parses but ends up being a 2-character string consisting of CTRL-\ and \ (backslash).
I think the latter case is definitely a bug because the middle backslash ends up doing double duty: it is used by \c to form \c\ (0x1C)\, but then also escapes the third backslash to form \\ (0x5C). This half-reparsing shouldn't happen.
And for consistency with other control characters it would be nice if you could get a ^\ by writing "\c\".
(This bug may be a duplicate but when I search RT for "\c\" I get 693 pages of no results.)
On 08/07/2013 08:14 AM\, l.mai@web.de (via RT) wrote:
# New Ticket Created by l.mai@web.de # Please include the string: [perl #119191] # in the subject line of all future correspondence about this issue. # \<URL: https://rt-archive.perl.org/perl5/Ticket/Display.html?id=119191 >
This is a bug report for perl from l.mai@web.de\, generated with the help of perlbug 1.39 running under perl 5.18.0.
----------------------------------------------------------------- [Please describe your issue here]
% perl -we 'printf "%vd\n"\, "\c\"' Can't find string terminator '"' anywhere before EOF at -e line 1. % perl -we 'printf "%vd\n"\, "\c\\"' 28.92 % perl -we 'printf "%vd\n"\, "\x1c\\"' 28.92
There's no way to get a CTRL-\ (0x1C) with perl's \c notation.
The obvious syntax "\c\" is a syntax error.
The next try "\c\\" parses but ends up being a 2-character string consisting of CTRL-\ and \ (backslash).
I think the latter case is definitely a bug because the middle backslash ends up doing double duty: it is used by \c to form \c\ (0x1C)\, but then also escapes the third backslash to form \\ (0x5C). This half-reparsing shouldn't happen.
And for consistency with other control characters it would be nice if you could get a ^\ by writing "\c\".
(This bug may be a duplicate but when I search RT for "\c\" I get 693 pages of no results.)
From perlop:
"Also\, "\c\X" yields " chr(28) . "X"" for any X\, but cannot come at the end of a string\, because the backslash would be parsed as escaping the end quote.
...
"Also no attention is paid to "\c\" (multichar control char syntax) during this search. Thus the second "\" in "qq/\c\/" is interpreted as a part of "\/"\, and the following "/" is not recognized as a delimiter. Instead\, use "\034" or "\x1c" at the end of quoted constructs."
The latter quote from the section about the "Gory details of parsing"
The RT System itself - Status changed from 'new' to 'open'
On Wed\, Aug 7\, 2013 at 11:52 AM\, Karl Williamson \public@​khwilliamson\.comwrote:
On 08/07/2013 08:14 AM\, l.mai@web.de (via RT) wrote:
# New Ticket Created by l.mai@web.de # Please include the string: [perl #119191] # in the subject line of all future correspondence about this issue. # \<URL: https://rt.perl.org:443/rt3/**Ticket/Display.html?id=119191\https://rt-archive.perl.org/perl5/Ticket/Display.html?id=119191>
This is a bug report for perl from l.mai@web.de\, generated with the help of perlbug 1.39 running under perl 5.18.0.
------------------------------**------------------------------**----- [Please describe your issue here]
% perl -we 'printf "%vd\n"\, "\c\"' Can't find string terminator '"' anywhere before EOF at -e line 1. % perl -we 'printf "%vd\n"\, "\c\\"' 28.92 % perl -we 'printf "%vd\n"\, "\x1c\\"' 28.92
There's no way to get a CTRL-\ (0x1C) with perl's \c notation.
The obvious syntax "\c\" is a syntax error.
The next try "\c\\" parses but ends up being a 2-character string consisting of CTRL-\ and \ (backslash).
I think the latter case is definitely a bug because the middle backslash ends up doing double duty: it is used by \c to form \c\ (0x1C)\, but then also escapes the third backslash to form \\ (0x5C). This half-reparsing shouldn't happen.
And for consistency with other control characters it would be nice if you could get a ^\ by writing "\c\".
(This bug may be a duplicate but when I search RT for "\c\" I get 693 pages of no results.)
From perlop:
"Also\, "\c\X" yields " chr(28) . "X"" for any X\, but cannot come at the end of a string\, because the backslash would be parsed as escaping the end quote.
...
"Also no attention is paid to "\c\" (multichar control char syntax) during this search. Thus the second "\" in "qq/\c\/" is interpreted as a part of "\/"\, and the following "/" is not recognized as a delimiter. Instead\, use "\034" or "\x1c" at the end of quoted constructs."
The latter quote from the section about the "Gory details of parsing"
Hm. That really sounds more like it's documenting a bug. That being said\, without looking at the code\, I imagine that fixing it would make the parsing of all strings ever so slightly slower to get around one edge case\, so perhaps it's better this way.
On Wed Aug 07 07:14:53 2013\, mauke- wrote:
(This bug may be a duplicate but when I search RT for "\c\" I get 693 pages of no results.)
RT ignores backslashes\, which is annoying.
I know I have seen this before\, but I canât find the ticket. It may simply have been discussed on p5p. It was a *long* time ago *Larry Wall was involved in the discussion.) It was never fully resolved\, though at the time I think everyone considered it a bug. Just nobody know how to fix it.
--
Father Chrysostomos
On Wed Aug 07 12:41:07 2013\, sprout wrote:
On Wed Aug 07 07:14:53 2013\, mauke- wrote:
(This bug may be a duplicate but when I search RT for "\c\" I get 693 pages of no results.)
RT ignores backslashes\, which is annoying.
I know I have seen this before\, but I canât find the ticket. It may simply have been discussed on p5p. It was a *long* time ago *Larry Wall was involved in the discussion.) It was never fully resolved\, though at the time I think everyone considered it a bug. Just nobody know how to fix it.
If I recall correctly\, Larryâs suggestion was for the first pass to
treat \c\
That way "\c\" is control-backslash\, "\c\\\" is control-backslash followed by a backslash and "\c\\" is âCan't find string terminator...â.
Considering that \c\ anywhere inside a quoted string is completely buggy\, I think it is ok to change this.
--
Father Chrysostomos
On Sat Aug 24 19:19:08 2013\, sprout wrote:
On Wed Aug 07 12:41:07 2013\, sprout wrote:
On Wed Aug 07 07:14:53 2013\, mauke- wrote:
(This bug may be a duplicate but when I search RT for "\c\" I get 693 pages of no results.)
RT ignores backslashes\, which is annoying.
I know I have seen this before\, but I canât find the ticket. It may simply have been discussed on p5p. It was a *long* time ago *Larry Wall was involved in the discussion.) It was never fully resolved\, though at the time I think everyone considered it a bug. Just nobody know how to fix it.
If I recall correctly\, Larryâs suggestion was for the first pass to treat \c\
(where X is any char) as a single entity to skip over\, just as \\ is skipped over. That way "\c\" is control-backslash\, "\c\\\" is control-backslash followed by a backslash and "\c\\" is âCan't find string terminator...â.
Considering that \c\ anywhere inside a quoted string is completely buggy\, I think it is ok to change this.
You can see it on the sprout/cntrl branch\, and hereto attached.
Do we want this?
--
Father Chrysostomos
From dd6344855396df034857e5570c1e9ae1201e0c02 Mon Sep 17 00:00:00 2001 From: Father Chrysostomos \sprout@​cpan\.org Date: Sun\, 25 Aug 2013 01:06:03 -0700 Subject: [PATCH] \c
\c now escapes the following character\, the way \ does\, so "\c\" is a single control-backslash\, "\c"" is control-"\, etc.
On Sun Aug 25 01:16:06 2013\, sprout wrote:
You can see it on the sprout/cntrl branch\, and hereto attached.
There are actually two branches that need changing\, and that patch only changed one.
--
Father Chrysostomos
Migrated from rt.perl.org#119191 (status was 'open')
Searchable as RT119191$