Juergen Boemmels wrote: >>From TODO: > Metadata (source line number info, symbol table) > > Currently parrot the line number information in parrot is done via > special opcodes, namely setline/getline and setfile/getfile. This is a > good solution when you write an interpreter in parrot, and the line > number information is only known at runtime. But this approach is very > inefficient if you have a tight loop ...
Yep you are right. Actually one of my first patches WRT imcc was adding a »-g« option to perl6 and passing on this setline/setfile info through imcc to PASM. But, the biggest problem I encountered was, to get this line numbers out of the parser. May be, one more familar with Parse::RecDescent find's a solution to get line numbers for blocks, which are finished parsing not before the closing bracket. Normal statements are no problem. > Changing the packfile is not an easy task, because many parts of > parrot depend on it. The ones I remember are packfile.c assemble.pl > and somewhere in imcc. When there is a final way, how to do it, I'll adjust packout.c, which is the file imcc is using for writing PBC. > ... directory section. Naturally it would > be the first one. Since FIXUP is not used at the moment, this is not > such a drastic change as it first sounds. Yes, I would vote for an extensible, always backward compatible solution. When changing packfile, please consider the proposals towards "fingerprinting PBC files", please look at the thread with this subject. So we would need just one change in PBC to get both features in. > #line 1 "foo.c" perl6 -g imcc currently ignores these, because of block statements, but when this is solved, I'll look for this old patch and update imcc. leo