[I looked in the RT database and didn't find a ticket for
this (known) issue, so I'm submitting it here. Apologies for
any duplication.]
When load_bytecode is used on a .pir file, it sometimes causes
problems with the imcc compiler a bit later. Demonstration:
$ cat x.pir
.sub main :main
load_bytecode 'PGE.pbc'
load_bytecode 'dumper.pir'
load_bytecode 'PGE/Dumper.pir'
$P0 = compreg 'PGE::P5Regex'
$P1 = $P0('aabb*')
$P2 = $P1('fooaabbbar')
_dumper($P2)
.end
$ ./parrot x.pir
error:imcc:syntax error, unexpected $end
in file 'EVAL_1' line 72
Changing the .pir to .pbc causes things to magically work:
[pmichaud@orange trunk]$ cat y.pir
.sub main :main
load_bytecode 'PGE.pbc'
load_bytecode 'dumper.pbc'
load_bytecode 'PGE/Dumper.pbc'
$P0 = compreg 'PGE::P5Regex'
$P1 = $P0('aabb*')
$P2 = $P1('fooaabbbar')
_dumper($P2)
.end
$ ./parrot y.pir
"VAR1" => PMC 'PGE::Match' => "aabbb" @ 3
$
I'll add the above as tests to t/pmc/sub.t as soon
as I have the RT ticket number. :-)
Thanks,
Pm