[svn:parrot] r44671 - in branches/ops_pct/compilers/opsc: src/Ops t
bacek at svn.parrot.org
bacek at svn.parrot.org
Sat Mar 6 01:35:12 UTC 2010
Author: bacek
Date: Sat Mar 6 01:35:08 2010
New Revision: 44671
URL: https://trac.parrot.org/parrot/changeset/44671
Log:
Properly store Ops::Op.arg_types.
Modified:
branches/ops_pct/compilers/opsc/src/Ops/Op.pm
branches/ops_pct/compilers/opsc/t/04-op.t
Modified: branches/ops_pct/compilers/opsc/src/Ops/Op.pm
==============================================================================
--- branches/ops_pct/compilers/opsc/src/Ops/Op.pm Fri Mar 5 23:51:02 2010 (r44670)
+++ branches/ops_pct/compilers/opsc/src/Ops/Op.pm Sat Mar 6 01:35:08 2010 (r44671)
@@ -123,12 +123,15 @@
method args($args?) { self.attr('args', $args, defined($args)) }
+method arg_types($args?) { self.attr('arg_types', $args, defined($args)) }
+
method full_name() {
my $name := self.name;
my @arg_types := self.arg_types;
- join('_', $name, @arg_types);
+ say("# arg_types " ~ @arg_types);
+ join('_', $name, |@arg_types);
}
method func_name($trans) {
Modified: branches/ops_pct/compilers/opsc/t/04-op.t
==============================================================================
--- branches/ops_pct/compilers/opsc/t/04-op.t Fri Mar 5 23:51:02 2010 (r44670)
+++ branches/ops_pct/compilers/opsc/t/04-op.t Sat Mar 6 01:35:08 2010 (r44671)
@@ -5,14 +5,15 @@
pir::load_bytecode("compilers/opsc/opsc.pbc");
pir::load_bytecode("nqp-settings.pbc");
-plan(6);
+plan(7);
my $op := Ops::Op.new(
code => 42,
name => 'set',
type => 'inline',
args => <foo bar baz>,
- flags => hash()
+ flags => hash(),
+ arg_types => <i i ic>,
);
ok( 1, "Op created");
@@ -20,8 +21,11 @@
ok( $op.code == 42, "... with proper code");
ok( $op.name == 'set', "... with proper name");
ok( $op.type == 'inline', "... with proper type");
+ok( +$op.arg_types == 3, "... with proper arg_types");
+say('# ' ~ $op.arg_types);
ok( $op.body == '', "... with empty body");
$op.body("SOME BODY");
ok( $op.body == 'SOME BODY', "Op.body set");
+
# vim: expandtab shiftwidth=4 ft=perl6:
More information about the parrot-commits
mailing list