On Sun, 25 Dec 2016 12:16:39 -0800, gfldex wrote:
> Q„1“;
> # OUTPUT«===SORRY!=== Error while compiling <tmp>␤Couldn't find
> terminator ” (corresponding „ was at line 1)␤at <tmp>:1␤------>
> Q„1“;⏏<EOL>␤    expecting any of:␤        ”␤»


Thank you for the report. Unfortunatelly, I'm going to close it as wontfix.

Fancy quotes work. You're just attempting to use the *LEFT* DOUBLE QUOTATION 
MARK with 'Punctuation Initial' property
on the right side, to signal the end of the quote.

If you use the RIGHT quote, it'll work just fine:

    <Zoffix> m: dd Q„42”
    <camelia> rakudo-moar 1ee24c: OUTPUT«"42"␤»

I realize our bare strings are special-cased to handle 4 unusual combinations 
of quoters (which IMO is a somewhat warty feature).
However, I'm not seeing any worthy benefit in extending special-casing to all 
of our quoters (this would include regexes, shell-out quoters, and WHY comments 
too).
Currently, the algorithm assumes each delimiter has exactly one paired 
character for it, with all the performance benefits that stem from that.

It's worth noting that quoters allow repeated delimiters, while bare strings 
don't:

    <Zoffix> m: dd „„„42”””
    <camelia> rakudo-moar 1ee24c: OUTPUT«"„„42””"␤»
    <Zoffix> m: dd Q„„„42”””
    <camelia> rakudo-moar 1ee24c: OUTPUT«"42"␤»

Special-casing the 4 quote combinations we special-case in bare strings would 
mean mixed delimiter quotes are also valid and this code would parse as string 
"foo": „“„foo”“”

So we'd introduce weird possibilities and suffer (possibly noticeable) 
performance loss in regex, Q, qq, qw, qx quoters and WHY comments... If 
consistency is an issue, I'd rather see weird pairings removed from bare 
strings.

Considering there are about 1,000,000 characters you can use as delimiters and 
by repeating them can have an infinite number of possible quoter delimiters, 
adding several special cases throughout the codebase seems unjustified.

Cheers,
ZZ


Reply via email to