[svn:parrot] r47885 - in branches/gsoc_past_optimization/runtime/parrot/library: PAST PCT
tcurtis at svn.parrot.org
tcurtis at svn.parrot.org
Sun Jun 27 00:57:41 UTC 2010
Author: tcurtis
Date: Sun Jun 27 00:57:41 2010
New Revision: 47885
URL: https://trac.parrot.org/parrot/changeset/47885
Log:
Move PAST::Pattern.new to PCT::Pattern.new.
Modified:
branches/gsoc_past_optimization/runtime/parrot/library/PAST/Pattern.nqp
branches/gsoc_past_optimization/runtime/parrot/library/PCT/Pattern.nqp
Modified: branches/gsoc_past_optimization/runtime/parrot/library/PAST/Pattern.nqp
==============================================================================
--- branches/gsoc_past_optimization/runtime/parrot/library/PAST/Pattern.nqp Sun Jun 27 00:39:10 2010 (r47884)
+++ branches/gsoc_past_optimization/runtime/parrot/library/PAST/Pattern.nqp Sun Jun 27 00:57:41 2010 (r47885)
@@ -27,22 +27,6 @@
self.attr("lvalue", $val, !pir::isnull__iP($val));
}
- method new (*@children, *%attrs) {
- my $result := Q:PIR {
- $P0 = self.'HOW'()
- $P0 = getattribute $P0, 'parrotclass'
- %r = new $P0
- };
-
- for %attrs {
- $result.attr($_, %attrs{$_}, 1);
- }
- for @children {
- pir::push($result, Tree::Pattern::patternize($_));
- }
- $result;
- }
-
method check_past_node_attributes ($node, $/) {
(self.check_pct_node_attributes($node, $/)
&& self.check_attribute($node, "returns", $/)
Modified: branches/gsoc_past_optimization/runtime/parrot/library/PCT/Pattern.nqp
==============================================================================
--- branches/gsoc_past_optimization/runtime/parrot/library/PCT/Pattern.nqp Sun Jun 27 00:39:10 2010 (r47884)
+++ branches/gsoc_past_optimization/runtime/parrot/library/PCT/Pattern.nqp Sun Jun 27 00:57:41 2010 (r47885)
@@ -34,7 +34,7 @@
my &ACCEPTSEXACTLY := method ($node) {
return Tree::Pattern::Match.new(0)
- unless $node ~~ $targetClass;
+ unless pir::isa__iPP($node, $targetClass);
my $/ := Tree::Pattern::Match.new(1);
self.check_children($node, $/);
for @attributes {
@@ -56,6 +56,22 @@
$class.HOW().add_method($class, 'ACCEPTSEXACTLY', &ACCEPTSEXACTLY);
}
+ method new (*@children, *%attrs) {
+ my $result := Q:PIR {
+ $P0 = self.'HOW'()
+ $P0 = getattribute $P0, 'parrotclass'
+ %r = new $P0
+ };
+
+ for %attrs {
+ $result.attr($_, %attrs{$_}, 1);
+ }
+ for @children {
+ pir::push($result, Tree::Pattern::patternize($_));
+ }
+ $result;
+ }
+
method attr ($name, $value, $has_value) {
my $result;
if ($has_value) {
More information about the parrot-commits
mailing list