Re: A BibTeX grammar (the real reply)

A mistake I made, no ? after "sep".


The new syntax would be:


        -term: factor;
               option;
               repeat0;
               repeat1.
      -factor: terminal;
               nonterminal;
               -"(", s, alts, -")", s.
      repeat0: factor, -"*", s;
               factor, -"**", s, sep;
      repeat1: factor, -"+", s;
               factor, -"++", s, sep.
       option: factor, -"?", s.
          sep: factor.


Steven

On Monday 21 February 2022 15:05:57 (+01:00), Steven Pemberton wrote:


Separators were there right from the start, but distinguishing them would definitely mitigate this sort of mistake.


The new syntax would be:


        -term: factor;
               option;
               repeat0;
               repeat1.
      -factor: terminal;
               nonterminal;
               -"(", s, alts, -")", s.
      repeat0: factor, -"*", s;
               factor, -"**", s, sep?;
      repeat1: factor, -"+", s;
               factor, -"++", s, sep?.
       option: factor, -"?", s.
          sep: factor.


Steven

On Monday 21 February 2022 14:56:59 (+01:00), Steven Pemberton wrote:


Separators were there right from the start, but distinguishing them would definitely mitigate this sort of mistake.


The new syntax would be:
        -term: factor;
               option;
               repeat0;
               repeat1.
      -factor: terminal;
               nonterminal;
               -"(", s, alts, -")", s.
      repeat0: factor, -"*", s, sep?;
      repeat1: factor, -"+", s, sep?.
       option: factor, -"?", s.
          sep: factor.


On Monday 21 February 2022 12:53:45 (+01:00), John Lumley wrote:

> Tend to agree - if I’m not mistaken the ‘separator’ operator position is a comparatively recent addition (and perhaps a pragma for the fuller form - term,(sep,term)*) so it could benefit from a clearly distinguishable form…..
>
> Sent from my iPad
>
> > On 21 Feb 2022, at 11:06, Norm Tovey-Walsh <norm@saxonica.com> wrote:
> >
> > 
> >>
> >> I was thinking last night, and one way would be to make repetition
> >> with separators different, by doubling the sign:
> >>
> >> numbers: number++(",", " "*).
> >> words: word**s.
> >
> > Given how easy it was to make the “missing comma” mistake, and how hard
> > it was to find, I think this might be a good idea.
> >
> > What do other folks think?
> >
> > Be seeing you,
> > norm
> >
> > --
> > Norm Tovey-Walsh
> > Saxonica
>
>
>

Received on Monday, 21 February 2022 14:09:11 UTC