W3C home > Mailing lists > Public > public-ixml@w3.org > October 2021

Re: Strings proposal

From: C. M. Sperberg-McQueen <cmsmcq@blackmesatech.com>
Date: Fri, 22 Oct 2021 10:00:02 -0600
Cc: "C. M. Sperberg-McQueen" <cmsmcq@blackmesatech.com>, ixml <public-ixml@w3.org>
Message-Id: <90712689-2095-42BA-B5F9-A54152633AEE@blackmesatech.com>
To: Steven Pemberton <steven.pemberton@cwi.nl>
My first reaction was caution, since I find the second form of the example you give so much better than the first; my rule in SGML and XML markup has long been that if a line break or other special whitespace handling carries meaning at some point, it’s better to represent it with markup than with literal whitespace, because literal whitespace is fragile in editors that provide services like reformatting paragraphs.

Then I realized that you were not proposing to allow linebreaks inside of literals, but forbid them.  Since I avoid them already, it will not affect the way I write grammars.

So, yes, I think this is a good idea. 

Michael

> On 22,Oct2021, at 5:27 AM, Steven Pemberton <steven.pemberton@cwi.nl> wrote:
> 
> After experience with my tutorial, I want to make a syntax proposal.
> 
> In brief, strings may not extend over a line.
> 
> The reason for this is that 
> 1) It doesn't reduce functionality, since
> 
> 	
> 
> "abc
>         def"
> 
> is equivalent to 
> 
>         "abc", #d?, #a, "def".
> 
> (and also deals with the Windows anomaly).
> 
> 2) It gives far better diagnostics when parsing the ixml, since the source of the error is on the same line as where the error is discovered.
> 
> So the definition of dchar (and likewise schar) becomes:
> dchar: ~['"'; #a; #d];
>          '"', -'"'. {all characters, quotes must be 
> doubled}
> 
> Steven.
> 
Received on Friday, 22 October 2021 16:00:36 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 13 September 2022 10:02:05 UTC