W3C home > Mailing lists > Public > public-rdf-comments@w3.org > December 2011

Turtle grammar string literals issue

From: David Robillard <d@drobilla.net>
Date: Fri, 23 Dec 2011 17:28:11 -0500
Message-ID: <1324679291.13056.4.camel@verne.drobilla.net>
To: "public-rdf-comments@w3.org" <public-rdf-comments@w3.org>
The latest Turtle grammar[1] seems to only allow escapes in string
literals:

[66s] String ::= STRING_LITERAL1 
 | STRING_LITERAL2 
 | STRING_LITERAL_LONG1 
 | STRING_LITERAL_LONG2

[87s] STRING_LITERAL1 ::= "'" ( ( [^'\\\n\r] ) | ECHAR | UCHAR )* "'" 
 
[88s] STRING_LITERAL2 ::= '"' ( ( [^\"\\\n\r] ) | ECHAR | UCHAR )* '"' 
 
[89s] STRING_LITERAL_LONG1 ::= "'''" ( ( "'" | "''" )? ( [^'\\] | ECHAR
| UCHAR ) )* "'''" 
 
[90s] STRING_LITERAL_LONG2 ::= '"""' ( ( '"' | '""' )? ( [^\"\\] | ECHAR
| UCHAR ) )* '"""' 

[19] UCHAR ::= ( "\\u" HEX HEX HEX HEX ) 
 | ( "\\U" HEX HEX HEX HEX HEX HEX HEX HEX ) 

[91s] ECHAR ::= "\\" [tbnrf\\\"'] 

So, simple strings like "hello" are not allowed, only "\u1234" etc.

-dr

[1] http://dvcs.w3.org/hg/rdf/raw-file/default/rdf-turtle/turtle.bnf
Received on Friday, 23 December 2011 22:28:40 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 23 December 2011 22:28:42 GMT