[Prev][Next][Index][Thread]
Re: Macro loops infinitely --- GD bug?
Jason Trenouth wrote:
>
> On Thu, 04 Jan 2001 01:11:48 +0100, "Gabor Greif" <gabor@mac.com> wrote:
>
[snip]
>
> FunDev says:
>
> Serious warning at hello:22-24:
>
> Infinite auxiliary rule recursion in one-definer macro call - treating as
> invalid syntax.
Thanks!
this seems to be in line with GD's result :-)
Now it is time to improve the error message!
>
> hello:21: ---------------
> hello:22: define one uff
> hello:23: 1; 2, 3
> hello:24: end;
> hello:25: ---
>
[snip]
> >
once:
{ ?inner } => { ?inner }
{ ?inner; ... } => { ?inner, ... }
inner:
{ } => { }
{ ?:expression, ... } => { ?expression, ... }
> >
> > define one uff
> > 1; 2, 3
> > end;
>
> For this second code fragment FunDev reports:
>
> Serious warning at hello:23:
>
> Invalid syntax for inner in one-definer macro call.
>
> hello:22: -------
> hello:23: 1; 2, 3
> hello:24: -------
Now I see it, but still cannot understand...
Obviously the first rule of #"once" fails with "1; 2, 3" but then the second should be tried, which requires:
"1" to match #"inner" --> OK
"2, 3" to match #"once" --> OK by rule 1 of #"once"
This is strange. What in the DRM is responsible for the breakdown of the above argument?
The only counter-intuitive thing is that rule 1 of #"once" lets slip thru a semicolon, but this seems to be conform with the DRM.
Thanks again,
Gabor
>
> __Jason
Follow-Ups:
References: