[perl #48445] [TODO] [NQP] - report undeclared variable usage

Klaas-Jan Stol via RT parrotbug-followup at parrotcode.org
Mon Dec 1 14:52:00 UTC 2008


On Thu Jun 26 20:16:45 2008, coke wrote:
> On Mon Dec 10 11:49:08 2007, pmichaud wrote:
> >
> > When an NQP program uses a variable that hasn't been
> > previously declared, it should report a useful error message:
> >
> >     Use of undeclared variable '$x' at ...
> >
> > Pm

Currently it report this:

C:\[...]\parrot>parrot compilers\nqp\nqp.pbc
> $x := 1;
Scope not found for PAST::Var '$x'
>

Is that good enough?
Maybe the line can be reported as well?

> 
> Looking at this, there doesn't seem to be a way to write a self-hosted
> test (in nqp) for this
> since there's no try/catch equivalent.
> 
> Can someone add a PIR based TODO test for this (in compilers/nqp/t)
> that shows the desired
> (but not yet implemented) behavior?

I'm not sure what is suggested here, or how to do it.


kjs






More information about the parrot-dev mailing list