Putting quotes in wysiwyg strings

Bill Baxter wbaxter at gmail.com
Wed Nov 22 08:31:03 PST 2006


Lionello Lunesu wrote:
> Bill Baxter wrote:
> 
>>  From the spec:  'There are no escape sequences inside r" ":'
>>
>> Shouldn't there be an exception for the " character itself?
>> [...]
> 
> I'd prefer doubling the ", similar to program arguments on the command 
> line:
> 
> r"foo""bar"
> 
> (This already compiles, but generates foobar instead of foo"bar; if you 
> want foobar with the suggested behavior, you could add a space: r"foo" 
> "bar")

You're right.  That would definitely be the cleaner solution.  If you 
use \ to escape the quote then you need yet another rule to handle the 
case where you want a literal \ followed by a " in the string.

--bb



More information about the Digitalmars-d mailing list