W3C home > Mailing lists > Public > public-cwm-bugs@w3.org > June 2005

Re: string escapes reverted on purpose?

From: Dan Connolly <connolly@w3.org>
Date: Tue, 21 Jun 2005 10:55:29 -0400
Message-Id: <d5f42c75646d041e3d9a152d295ecedf@w3.org>
Cc: public-cwm-bugs@w3.org, Eric Prud'hommeaux <eric@w3.org>, Yosi Scharf <syosi@MIT.EDU>
To: EspeonEefi <eefi@MIT.EDU>

It's important to coordinate N3 lexical details like this with turtle  
and SPARQL.
Have you talked with Yosi about this part of n3.n3 and the parser
work he and EricP are doing?

On Jun 20, 2005, at 7:21 PM, EspeonEefi wrote:

> On Thu, 2005-02-17 at 11:37 -0600, Dan Connolly wrote:
>> Norm noticed...
>>
>> This used to be valid: :N1001D :label "T4: 'It\'s Been...'" .
>> seems to me \' would produce that traceback since 1.99          
>> (connolly
>> 14-Feb-02)
>>
>>
>> But now he gets...
>>
>> [exec] notation3.BadSyntax: Line 184 of
>> <file:/share/projects/w3c/WWW/XML/Group/xsl-query-specs/data-model/ 
>> build/dm-example.n3>: Bad syntax (bad escape) at ^ in:
>>      [exec] "... a :Text .
>>      [exec] :N1001D :parent :N1001C .
>>      [exec] :N1001D :label "T4: 'It^\'s Been...'" .
>
> I've found exactly where this is being triggered. In notation3.py  
> v1.180
> SinkParser.strconst at lines 1054-1056,
>                 k = string.find('abfrtvn\\"', ch)
>                 if k >= 0:
>                     uch = '\a\b\f\r\t\v\n\\"'[k]
> should be
>                 k = string.find('abfrtvn\\"\'', ch)
>                 if k >= 0:
>                     uch = '\a\b\f\r\t\v\n\\"\''[k]
>
> Interestingly, there is a dictionary Escapes defined in notation3.py as
> well (at line 1836). Escapes includes the single quotation mark.
> However, Escapes doesn't seem to be used anywhere else.
>
>> It should be written up somewhere... I don't think it's reasonable
>> to expect people to understand this as a specification:
>>
>> string		cfg:matches		"(\"\"\"[^\"\\\\]*(?:(?:\\\\.|\"(?!\"\"))[^\"\\\
>> \]*)*\"\"\")|(\"[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*\")";
>>
>>  -- http://www.w3.org/2000/10/swap/grammar/n3.n3
>
> Hmm... So the reason I haven't committed the above change is that I'm
> not sure what you meant by the bug. As far as I can tell, the above
> specification actually doesn't specify what are legal escapes; it seems
> that all escapes are legal (note that my regexp-foo is not very high,
> though).
>
> Do you want cwm to accept the escaped quotation mark as an escaped
> quotation mark like Python (note an escaped double quotation mark acts
> this way), or do you want to keep the current behavior (complaining  
> that
> we have an illegal escape), or do you want to dump that into the string
> as a true \'?
>
> -- eefi
Received on Tuesday, 21 June 2005 14:55:37 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:10:59 GMT