Re: more m4p bugs
Nikolaos Chatzikonstantinou <[email protected]> Mon, 19 May 2025 04:15:52 -0400
| Newsgroups | gmane.comp.gnu.m4.general |
|---|---|
| Message-ID | <CAAQmekdT2EquP=D1WsVaVgVJ5E-2+KJeP2UOMXOsa=H6Ziq1+Q@mail.gmail.com> |
On Mon, May 19, 2025 at 4:14=E2=80=AFAM Nikolaos Chatzikonstantinou <[email protected]> wrote: > > On Mon, May 19, 2025 at 12:59=E2=80=AFAM Nikolaos Chatzikonstantinou > <[email protected]> wrote: > > > > On Sun, May 18, 2025 at 11:31=E2=80=AFPM Nikolaos Chatzikonstantinou > > <[email protected]> wrote: > > > > > > On Sun, May 18, 2025 at 10:11=E2=80=AFPM Eric Blake <[email protected]= m> wrote: > > > > > > > > On Sun, May 18, 2025 at 07:52:56AM -0400, Nikolaos Chatzikonstantin= ou wrote: > > > > > > > > > > > I fixed this with 0225f85. I got argument collection wrong twice,= but > > > > > the second time I was much further from the truth. At the time yo= ur > > > > > example len((1, 2)) threw me off. I didn't realize I was just tri= mming > > > > > whitespace too aggressively, and I wrote a bad patch for it that = had > > > > > special treatment of '(' when in argument collection. Your commen= t > > > > > example with (( and )) also helped me discover that I had an > > > > > "off-by-one" error in comment parsing (I had forgotten to include= the > > > > > final delimiter). > > > > > > > > There's still an issue with argument collection where you are > > > > accidentally expanding a $@ that only exists as a result of whateve= r > > > > gets substituted into $1 and so on (tested at commit 852a0f): > > > > > > > > $ m4 > > > > define(b,`.$1$2.')dnl > > > > b($,1) > > > > .$1. > > > > b($,@) > > > > .$@. > > > > $ m4p > > > > define(b,`.$1$2.')dnl > > > > b($,1) > > > > .$1. > > > > b($,@) > > > > .$,@. > > > > > > Good catch. The info manual mentions arguments like $10 to mean the > > > 10th argument will be phased out of GNU m4. Should I still emulate > > > that or should I keep the single-digit-only expansion? > > > > For now I went with multi digit expansions to keep the 1.4.20 behavior. > > I also implemented --freeze-state and --reload-state just now. The > produced files are not compatible with GNU m4's frozen files, but I > don't think that's an issue, right? I need to implement a better test > suite so that I can include tests that include all sorts of > command-line options, so that's going to be the next goal. If you want to try this, you'll have to `pip install -e .[tests]` once more to install the dependencies. I used some more packages to serialize the Parser. Regards, Nikolaos Chatzikonstantinou