W3C home > Mailing lists > Public > public-rdf-comments@w3.org > March 2013

Re: Turtle 2013 grammar improvement suggestion

From: Eric Prud'hommeaux <eric@w3.org>
Date: Thu, 7 Mar 2013 10:20:19 -0500
To: Dave Beckett <dave@dajobe.org>
Cc: public-rdf-comments@w3.org
Message-ID: <20130307152018.GA14096@w3.org>
* Dave Beckett <dave@dajobe.org> [2013-03-06 20:49-0800]
> On 3/4/13 12:16 PM, Eric Prud'hommeaux wrote:
> > * Dave Beckett <dave@dajobe.org> [2013-03-04 09:42-0800]
> >>
> >> http://www.w3.org/TR/2013/CR-turtle-20130219/
> >>
> >> In the grammar it is easier to read if quotes inside quotes are
> >> always written in hex like #xHH
> >>
> >> e.g in rules [24] and [25] about long single and double quotes it
> >> would be easier to read if it was expressed the way it was written in
> >> rules [22] and [23] where double quote is written as #x22
> > 
> > Perhaps you only want to change the character ranges, i.e. change:
> >   [24] STRING_LITERAL_LONG_SINGLE_QUOTE ::= "'''" (("'" | "''")? [^'\]       | ECHAR | UCHAR)* "'''"
> >   [25] STRING_LITERAL_LONG_QUOTE        ::= '"""' (('"' | '""')? [^"\]       | ECHAR | UCHAR)* '"""'
> >   [159s] 	ECHAR 	::= 	'\' [tbnrf\"']
> > to read:
> >   [24] STRING_LITERAL_LONG_SINGLE_QUOTE ::= "'''" (("'" | "''")? [^#x27\] | ECHAR | UCHAR)* "'''"
> >   [25] STRING_LITERAL_LONG_QUOTE        ::= '"""' (('"' | '""')? [^#x22\] | ECHAR | UCHAR)* '"""'
> >   [159s] 	ECHAR 	::= 	'\' [tbnrf\#x22#x27]
> > 
> > Changing all quotes per <http://www.w3.org/TR/xml/#NT-Char> would be rather verbose:
> >   [22]   STRING_LITERAL_QUOTE             ::= #x22 ([^#x22#x5C#xA#xD] | ECHAR | UCHAR)* #x22
> >   [23]   STRING_LITERAL_SINGLE_QUOTE      ::= #x27 ([^#x27#x5C#xA#xD] | ECHAR | UCHAR)* #x27
> >   [24]   STRING_LITERAL_LONG_SINGLE_QUOTE ::= #x27 #x27 #x27 ((#x27  | #x27 #x27 )? [^#x27#x5C] | ECHAR | UCHAR)* #x27 #x27 #x27
> >   [25]   STRING_LITERAL_LONG_QUOTE        ::= #x22 #x22 #x22 ((#x22  | #x22 #x22 )? [^#x22#x5C] | ECHAR | UCHAR)* #x22 #x22 #x22
> >   [172s] PN_LOCAL_ESC                     ::= '\' ('_' | '~' | '.' | '-' | '!' | '$' | '&' | #x27 | '(' | ')' | '*' | '+' | ',' | ';' | '=' | '/' | '?' | '#' | '@' | '%')
> > and maybe change \ to #x5C as well.
> > 
> > Can you reply with a grammar which shows which extreme, or point between the extremes, you feel is most useful to readers?
> 
> I just said quotes inside quotes
> 
> so use '#x22#x22#x22' instead of '"""' etc.
> 
> It was just a suggestion for those squinting at tiny pixels of quotes.

Ahh, makese sense, but we'd have to augment the XML grammar notation
which allows for #xN, but not inside ""s or ''s.

  http://www.w3.org/TR/REC-xml/#sec-notation

Noting that [172s] PN_LOCAL_ESC includes '#', we'd have to invent more
escaping syntax for use inside ""s and ''s, e.g. '\#x22\#x22\#x22'.
http://www.w3.org/TR/2013/CR-turtle-20130219/#grammar-production-PN_LOCAL_ESC

In net, I think it's safer to make people squint, since cut and paste
do the right thing.

Please reply with "I couldn't be happier" to indicate that your
concearns have been addressed.


> Dave
> 
> 

-- 
-ericP
Received on Thursday, 7 March 2013 15:20:51 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:29:55 UTC