petdance/scratch — Issue #173: Parrot::Pmc2c::Emitter line # error
Author: petdance
Created: 2011-11-01 05:30:07+00:00
State: open
Labels: bug, core, Pri-normal, Sev-medium

New ticket opened from comment on list in thread 'Re: Warnings on
Solaris, Pmc2c usage/design bug', from Andrew Johnson.

----

BTW, there is a fundamental problem with this very common usage of a
Parrot::Pmc2c::Emitter:

$e->emit( <<"END", __FILE__, __LINE__ + 1 );
... code ...
END

In the above usage, __LINE__ returns the line number of the line containing
the "END" marker, not that of the line containing the "emit" call, so the
#line directive it emits points to the wrong place in the source file.

Trac ID #1201