Permalink
Browse files

[opsc] pass oplib to Ops::File new_str, fix emitter test

git-svn-id: https://svn.parrot.org/parrot/branches/ops_pct@44980 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information...
1 parent c794ee0 commit 6ee2964842ea6e83a80577b2b0cadbdf196897bf cotto committed Mar 17, 2010
Showing with 13 additions and 5 deletions.
  1. +9 −3 compilers/opsc/src/Ops/File.pm
  2. +4 −2 compilers/opsc/t/07-emitter.t
@@ -199,9 +199,15 @@ method new(*@files, :$oplib!, :$nolines) {
self;
}
-method new_str($str) {
- self<ops> := list(); # Ops
- self<preamble>:= '';
+method new_str($str, :$oplib) {
+ self<ops> := list(); # Ops
+ self<preamble> := '';
+
+ self<compiler> := pir::compreg__Ps('Ops');
+ self<oplib> := $oplib;
+ self<compiler>.set_oplib($oplib);
+
+ self._set_version();
self._set_version();
@@ -15,9 +15,10 @@ my @files := <
src/ops/cmp.ops
>;
+my $lib := Ops::OpLib.new();
my $emitter := Ops::Emitter.new(
:ops_file(Ops::File.new(
- :oplib(Ops::OpLib.new()),
+ :oplib($lib),
|@files)
),
:trans($trans),
@@ -109,7 +110,8 @@ ok($restart_addr_ok, "runinterp has PARROT_JUMP_RELATIVE");
#say($source);
sub translate_op_body($trans, $body) {
- my $file := Ops::File.new_str($body);
+ my $file := Ops::File.new_str(
+ :oplib($lib), $body);
my $emitter := Ops::Emitter.new(
:ops_file($file),
:trans($trans),

0 comments on commit 6ee2964

Please sign in to comment.