Re: Repetition syntax

The ABNF grammar used by the IETF (RFC5324) places the optional repetition
parameters around the repetition sign '*'.
I'm wondering if that couldn't work for ixml as well.
This would obviate the introduction of an additional special character in
the grammar.

Perhaps the grammar change could be the following, changing from the
current repeat0 rule:

repeat0: factor, (-"*", s; -"**", s, sep).

to

repeat0: factor, (s, lower? , s, -"*", s, upper?; s, lower?, s, -"**", s,
upper?, s, sep).

lower         : repetitions     .
upper         : repetitions     .
-repetitions  : digit1 , digit* .
-digit1       : [ #31-#39 ]     .   { 1-9 non-zero digit }
-digit        : [ #30-#39 ]     .   { 0-9                }


https://datatracker.ietf.org/doc/html/rfc5234#section-3.6

The '+' and '++' notations would not require the lower/upper parameters
because the '*' and '**' notations would already cover this.

On Mon, Dec 1, 2025 at 11:03 PM Graydon Saunders <graydonish@fastmail.com>
wrote:

> If we're feeling skittish about the XML meanings of @ and angle-brackets
> I'd expect we'd also feel skittish about the ampersand's XML use to
> indicate entities.
>
> XQuery manages to use () for sequence and (::) for comments; I don't know
> if this is bitterly regretted by the folks who have to implement it, but I
> would have expected { and *char*{ would be sufficiently distinct.
>
> If we're willing to give up on the "US keyboard" assumption, it's not
> obvious we couldn't use «» for ranges. (U+00AB LEFT-POINTING DOUBLE ANGLE
> QUOTATION MARK and U+00BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK in
> case the MTA mangles them.) (And more generally, Unicode is rife with
> brackets.)
>
> On Mon, Dec 1, 2025, at 16:25, Bethan Tovey-Walsh wrote:
>
> I don't think we can use curly braces to delimit the range without running
> into serious problems, since curly braces are used for comments.
>
> I agree about the problem with "@". I've proposed using "&" instead, in a
> comment on the GitHub pull request. Why do you say that "&" is not
> available?
>
> BTW
>
>
> ****************************************************
>
> Dr. Bethan Tovey-Walsh
>
> *linguacelta.com <http://linguacelta.com/>*
>
> Golygydd | Editor geirfan.cymru
>
> Croeso i chi ysgrifennu ataf yn y Gymraeg
>
> On 1 Dec 2025, at 20:55, Graydon Saunders <graydonish@fastmail.com> wrote:
>
> 
> If I go look at https://invisiblexml.org/1.0/ixml.ixml.html and
> presuppose a US keyboard, we've got !, $, %, and \ currently not allocated
> as well as < and >. (Accepting that & and # are not available.)
>
> I'd prefer to go with a variant on Liam's proposal of %{a,b} and %%{a,b}
> since @, like < and >, have deeply established meaning in XML context and
> it might be preferable to distribute the multiple uses more widely than (
> and ).
>
> But I don't find myself in the grip of strong opinions about this.
>
> On Mon, Dec 1, 2025, at 11:13, Norm Tovey-Walsh wrote:
>
> Hello,
>
> I think the idea of introducing repetition[1] into Invisible XML has been
> well received, there just remains the tricky and somewhat subjective
> question of what syntax to use.
>
> In retrospect, it’s a real shame that we used up single “{“ and “}” for
> comments. But we did, that’s water under the bridge.
>
> I propose <a,b> and <<a,b>> (parallel to * and **, and + and ++). I think
> it’s nice to delimit the beginning and the end, so a pair of brackets seems
> suitable. We can’t use (), [], or {} because those already mean something
> else. And we can’t use “#” as a delimiter because of hex escapes[2].
>
> I think a single character could work: /a,b/ and //a,b//, for example, but
> it doesn’t strike me as obviously better.
>
> Liam proposed @(a,b) (and, I assume, @@(a,b)). I think that could work too.
>
> Any more suggestions?
>
>                                         Be seeing you,
>                                           norm
>
> [1] https://invisiblexml.org/pr/326/autodiff.html
> [2] I mean, technically, I think we probably *could*. I don’t think it
> would be ambiguous in the grammar, but I think it would be a mistake to
> make "a"#3 and "a",#3 both be legal and mean very different things. It
> feels like an invitation to error.
>
> --
> Norm Tovey-Walsh
> Saxonica
>
>
>
>
>

Received on Monday, 1 December 2025 22:16:31 UTC