Re: C vs C vs C x

2002-01-27 Thread Nicholas Clark

On Sat, Jan 26, 2002 at 06:52:19PM -0700, Sean M. Burke wrote:

 And now I'm beginning to wonder about two problems that occur when a C 
 code is empty (corresponding to an XML C/C).
 
 Notably, those problems are:
   How should C   tokenize?
 And:
   How should C  tokenize?

[latter tokenization being:]

 * a C start-code (consisting of the C and all the subsequent whitespace)
 * a literal 
 
 
 
 I'm tempted to just stipulate that codes with the syntax like C ... 
 must not be empty, which pretty much allows the latter tokenziation in both
 cases.
 
 First, there's the completely obvious argument that C ...  codes were
 devised specifically to handle the cases where the intended content
 contained a literal , as on C $foo-bar , so using them with
 no-content is daffy.

I think I'd be quite happy with C  being illegal if it contains only
whitespace. If someone wants to write C or C  then they can use single
, surely?

Nicholas Clark
-- 
ENOCHOCOLATE http://www.ccl4.org/~nick/CV.html



Re: C vs C vs C x

2002-01-26 Thread Brad Appleton

On Sat, Jan 26, 2002 at 06:52:19PM -0700, Sean M. Burke wrote:
 * starts with a capital letter (just US-ASCII [A-Z]) followed by two or
 more 's, one or more whitespace characters,

When this particular syntax was first suggested by Larry (and later accepted by p5p) 
it was for 2 _or_ _more_ '' characters, followed by /\s+/, and ending with whitespace 
and an equivalent number of ' as there were opening ''.

The reason I recall being suggested for this ... is the moment that the syntax becomes 
valid, it also becomes a prospective 'literal', so by allowing it to be 2-or-more, it 
readily resolved that problem without much extra parsing effort.

 Notably, those problems are:
   How should C   tokenize?
 And:
   How should C  tokenize?
 
 I see two possibilities:
 
 * a C start-code
 * empty-string content
 * an end-code matching the C start-code

I would have assumed it would parse a the beginning (start-code) being /\s+/ and the 
ending being /\s+/. I would assume the number of '' must equal the number of '', 
but I wouldn't assume the need for matching the exact number/content of whitespace 
characters for either delimited, and I would assume the content was an empty string, 
and that if spaces were intended they should use S  

But thats just me :)
-- 
Brad Appleton [EMAIL PROTECTED]  http://www.bradapp.net/
  And miles to go before I sleep. -- Robert Frost