On Sun May 30 05:44:14 2010, masak wrote: > <masak> I've found a case where a line number is one-off. should I > nopaste it? > <jnthn> masak: please > <masak> I don't think it's the fault of the new backtraces thing, to > be honest. > <masak> more like a result of parsing or something. > <jnthn> Well, the other thing is that we don't have as many :node($/)s > in Actions.pm as we maybe should. > <jnthn> So could very well be some wins to be had by some careful > extra scattering of those. > <masak> http://gist.github.com/418990 > > (inlined here) > > $ cat one-off > sub bar { > pfff > } > > bar > > $ perl6 one-off > Could not find sub &pfff > in 'bar' at line 1:one-off > in main program body at line 6:one-off > > <jnthn> masak: curious > <jnthn> masak: Does it get it right if you do pfff() ? > <jnthn> as in, add parens? > * masak tries > * jnthn had a test very much like that which got it right > <masak> no. > <jnthn> ok > <masak> maybe it sees the statement as starting on line 1, or > something? > <jnthn> That's very possible. > <jnthn> I just thought that it'd been getting it right. > <jnthn> (I had a very similar test case...) > * jnthn plays spot the difference > <jnthn> masak: hmm, I agree it seems to be one off there. > * masak submits rakudobug > <jnthn> masak: Think it may be a Parrot fix. > <jnthn> masak: Thing is, the annotations in the PIR look correct. > <jnthn> Trying my first guess at a patch now. > <masak> I'll include that in the Rakudobug. :)
We needed a Parrot tweak which I did a couple of days back - but that only got us off by one in the *other* direction because it emitted the right annotation, but we were emitting the wrong line number in it. Grrr. Anyway, today I nailed it with a little tweak in Rakudo, so now: C:\Consulting\rakudo>type test.p6 sub bar { pfff } bar C:\Consulting\rakudo>perl6 test.p6 Could not find sub &pfff in 'bar' at line 2:test.p6 in main program body at line 5:test.p6 Which is spot on. \o/ Given to moritz++ for testing. Thanks, Jonathan