Re: string_literal_quote

* Sandro Hawke <sandro@w3.org> [2013-01-09 09:30-0500]
> It's trivial, but any particular reason to diverge from SPARQL and
> rename the string literal non-terminals?
> 
> Turtle has:
> 
> [22] 	|STRING_LITERAL_QUOTE| 	::= 	'|"|' ([|^#x22#x5C#xA#xD|] || |
> ECHAR <https://dvcs.w3.org/hg/rdf/raw-file/default/rdf-turtle/index.html#grammar-production-ECHAR>
> || | UCHAR <https://dvcs.w3.org/hg/rdf/raw-file/default/rdf-turtle/index.html#grammar-production-UCHAR>)|*|
> '|"|'
> [23] 	|STRING_LITERAL_SINGLE_QUOTE| 	::= 	"|'|" ([|^#x27#x5C#xA#xD|]
> || | ECHAR <https://dvcs.w3.org/hg/rdf/raw-file/default/rdf-turtle/index.html#grammar-production-ECHAR>
> || | UCHAR <https://dvcs.w3.org/hg/rdf/raw-file/default/rdf-turtle/index.html#grammar-production-UCHAR>)|*|
> "|'|"
> [24] 	|STRING_LITERAL_LONG_SINGLE_QUOTE| 	::= 	"|'''|" (("|'|" || |
> "|''|")? [|^'\|] || | ECHAR <https://dvcs.w3.org/hg/rdf/raw-file/default/rdf-turtle/index.html#grammar-production-ECHAR>
> || | UCHAR <https://dvcs.w3.org/hg/rdf/raw-file/default/rdf-turtle/index.html#grammar-production-UCHAR>)|*|
> "|'''|"
> [25] 	|STRING_LITERAL_LONG_QUOTE| 	::= 	'|"""|' (('|"|' || |
> '|""|')? [|^"\|] || | ECHAR <https://dvcs.w3.org/hg/rdf/raw-file/default/rdf-turtle/index.html#grammar-production-ECHAR>
> || | UCHAR <https://dvcs.w3.org/hg/rdf/raw-file/default/rdf-turtle/index.html#grammar-production-UCHAR>)|*|
> '|"""|'
> 
> 
> SPARQL has:
> 
> |[156] | 	|STRING_LITERAL1| 	  ::= 	|"'" ( ([^#x27#x5C#xA#xD]) |
> ECHAR <http://www.w3.org/TR/sparql11-query/#rECHAR> )* "'"|
> |[157] | 	|STRING_LITERAL2| 	  ::= 	|'"' ( ([^#x22#x5C#xA#xD]) |
> ECHAR <http://www.w3.org/TR/sparql11-query/#rECHAR> )* '"'|
> |[158] | 	|STRING_LITERAL_LONG1| 	  ::= 	|"'''" ( ( "'" | "''" )? (
> [^'\] | ECHAR <http://www.w3.org/TR/sparql11-query/#rECHAR> ) )*
> "'''"|
> |[159] | 	|STRING_LITERAL_LONG2| 	  ::= 	|'"""' ( ( '"' | '""' )? (
> [^"\] | ECHAR <http://www.w3.org/TR/sparql11-query/#rECHAR> ) )*
> '"""'|
> 
> 
> I'd think we should just stick with the productions from SPARQL
> (modulo UCHAR which is an orthogonal issue).

A bit of history, Gavin was repairing bugs in some parser(s) relating to confusions around the STRING_LITERAL{,_LONG}{1,2} names. He felt that s/1/_SINGLE_QUOTE/ and s/2/_QUOTE/ improved the reader's understanding. I argued that we should coordinate any name changes with SPARQL. The SPARQL ship as sailed (and I'm not convinced that the LC names are better), so I'm in favor of returning to the SPARQL names.

The SPARQL *productions* don't include \uxxxx but that's pretty minor.
Switching to the SPARQL names also permits us to share String production.


>          -- Sandro
> 

-- 
-ericP

Received on Wednesday, 9 January 2013 14:49:39 UTC