On Dec 6, 2007 6:23 PM, Bill Ward <[EMAIL PROTECTED]> wrote:
> Cute experiment, but I REALLY hope nobody tries releasing useful
> modules to CPAN that depend on this...

Thank you

After it has line number support it will be more practically useful.

I'm sort of stuck on how much records of line numbers of expanded rewrites to
keep and how to encode them into the "filename" portion of the #line comment.

imagine:

#line 1000 fileF.pl
use Macrame; # line comments apply to the next line; this is line 1000
macro cheddar {"cheese"}
warn cheddar;
macro warn_wisconsin { warn cheddar}
warn_wisconsin;
__END__

the easiest thing is to keep line number information that
is available during lexing and output the line number
whenever it changes in the stringification:
#line 1002 fileF.pl
warn "cheese";
#line 1003
warn "cheese";
__END__

next tricky is to have an macros inherit their line numbers
from wherever they are invoked, giving
#line 1002 fileF.pl
warn "cheese";
#line 1004
warn "cheese";
__END__
even if the warn_wisconsin macro is several lines long

is it worth the trouble to have warnings inside macros show
a full expansion history as a debugging aid?  That's the current
goal for the next release, with a history syntax of appending
something to the filename portion of the eventual comment:

#line 1002 "fileF.pl"
warn "cheese";
#line 1004 "fileF.pl:1003"
warn "cheese";
__END__

when macros start appearing in different files from where
they are expanded, the debugging comments will start
looking something like

#line 765 "applicaiton.pl:maclib.pm:8970:234:basic_macros.pm:22"



-- 
"Common sense has prevailed"

Reply via email to