bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Incorrect LINENO with exported nested functions with loops


From: Tom Coleman
Subject: Re: Incorrect LINENO with exported nested functions with loops
Date: Fri, 8 Oct 2021 08:06:12 +1100

You are correct that FOR loops increment the word_top variable in the
read_token_word function, but, ARITH_FOR_EXPRS loops do not. They are
treated separately and do not increment the word_top variable from what I
can see.

#define FOR 265
#define ARITH_FOR_EXPRS 286



On Fri, Oct 8, 2021 at 7:10 AM Chet Ramey <chet.ramey@case.edu> wrote:

> On 10/7/21 12:58 AM, Tom Coleman wrote:
> > I did some experimenting and am confident on the fix. I don't know how to
> > supply a patch suggestion officially, but have pasted it below. Four
> lines
> > in parse.y need deleting. Arithmetic for loops should NOT be decrementing
> > the 'word_top' variable, they do not make use of it.
>
> I haven't looked closely at this yet, but I'm curious about your reasoning
> for the final sentence. The FOR token causes word_top to be incremented by
> read_token_word(); why should the production not decrement it after the
> entire loop is parsed?
>
> Chet
>
> --
> ``The lyf so short, the craft so long to lerne.'' - Chaucer
>                  ``Ars longa, vita brevis'' - Hippocrates
> Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]