[prev in list] [next in list] [prev in thread] [next in thread]
List: busybox
Subject: Re: [PATCH] bc Version 1.1
From: Gavin Howard <gavin.d.howard () gmail ! com>
Date: 2018-12-04 20:56:20
Message-ID: CAF=dzRMH2eK3HA3ySgoKwVw0RyvXKOs2CoAkCimV1oSefwCxWQ () mail ! gmail ! com
[Download RAW message or body]
Whoops. I had a bug in the code I just sent. The correct code is:
+ if (prev == BC_INST_BOOL_NOT || nexprs != 1)
+ return BC_STATUS_PARSE_BAD_EXP;
+ for (i = 0; i < next.len && t != next.tokens[i]; ++i) continue;
+ if (i == next.len) return BC_STATUS_PARSE_BAD_EXP;
Gavin Howard
On Tue, Dec 4, 2018 at 1:48 PM Gavin Howard <gavin.d.howard@gmail.com> wrote:
>
> I think a possible alternative would be:
>
> + if (prev == BC_INST_BOOL_NOT || nexprs != 1) return s;
>
> + for (i = 0; i < next.len && t != next.tokens[i]; ++i) continue;
> + if (i == next.len) return BC_STATUS_PARSE_BAD_EXP;
>
> Is that what you would like?
>
> Gavin Howard
>
> On Tue, Dec 4, 2018 at 1:33 PM Denys Vlasenko <vda.linux@googlemail.com> wrote:
> >
> > On Sat, Nov 3, 2018 at 6:17 PM Gavin Howard <gavin.d.howard@gmail.com> wrote:
> > >
> > > Hello,
> > >
> > > After making changes to the bc for Denys' requests, I have a better
> > > version of the bc.
> > >
> > > This version, pasted at https://pastebin.com/0M9sMhtM and raw at
> > > https://pastebin.com/raw/0M9sMhtM, has fulfilled every one of Denys'
> > > requests except for a few.
> >
> >
> > + s = BC_STATUS_PARSE_BAD_EXP;
> > + if (prev == BC_INST_BOOL_NOT || nexprs != 1) return s;
> > +
> > + for (i = 0; s && i < next.len; ++i) s *= t != next.tokens[i];
> > + if (s) return s;
> >
> > This is not readable
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic