Re: Proposal to change definition of 'name' (forbid final .)

On Wednesday 29 November 2023 14:21:07 (+01:00), Steven Pemberton wrote:

> 
> 
> > This is to propose a simple fix:  continue to allow . to occur in names,
> > but forbid it to appear at the end of a name.  Since no one on the call
> > remembered ever seeing an XML name with a final full stop outside of a
> > test suite, this did not seem likely to be a painful restriction.
> 
> I'm all for the change.
> 
> > or alternatively:
> > 
> >             @name: namestart, (namefollower ** '.').
> >        -namestart: ["_"; L].
> >     -namefollower: namestart; ["-·‿⁀"; Nd; Mn].
> 
> this one since it is more idiomatic ixml, though without the ( ).

On reflection, I assume that n...n is also a valid name.

How about


 name: namestart, namefollower*, ("."+, namefollower+)*.
 -namestart: ["_"; L].
 -namefollower: namestart; ["-·‿⁀"; Nd; Mn].

Tests


 name
 name.name
 name...name
 name.n
 name...n
 n.name
 n...name
 n.n
 n...n

Negative tests

 .name
 name.
 ...name
 name...
 n.
 .n
 n...
 ...n

Steven

Received on Wednesday, 29 November 2023 15:41:56 UTC