On Tue, 30 Oct 2001, Dan Sugalski wrote:

> Okay, so I put together the code to handle checking the type of a stack 
> entry. (entrytype Ix, iy) Seems to work OK, and I'm about to commit the 
> thing. The single thing that's missing are some tests, so I take a look at 
> t/op/stacks.t, and... Eeek!
> 
> I fully admit I have no idea what's going on in there. Could someone fill 
> me, and the rest of us, in? It's a little... intimidating.
> 

Oh, I was being lazy.

The set_*_reg are a set of subroutines which generate code to
initialise all the registers, each takes as its argument a sub
ref which should expect to recieve the number of the register it is setting
as its argument, and should output what the register will be set to.

The print_*_reg generate pasm to print the contents of every register,
some of these add newlines every so often.  cgt => compare greater than,
clt => compare less than, test every register against zero and jump to
ERROR if any fail the test.

I guess I could generate the code and have that in the test instead, 
which may be necessary when we stop using perl anyhow.

There's nothing stopping you adding a test that doesn't use the
helper subs, just make sure the plan => is updated and all the new
tests have names.

Alex Gough

Reply via email to