[svn:parrot] r47779 - in branches/gsoc_past_optimization/runtime/parrot/library: PAST PCT

tcurtis at svn.parrot.org tcurtis at svn.parrot.org
Wed Jun 23 07:39:38 UTC 2010


Author: tcurtis
Date: Wed Jun 23 07:39:38 2010
New Revision: 47779
URL: https://trac.parrot.org/parrot/changeset/47779

Log:
Move PAST::Pattern.attr into PCT::Pattern, along with the accessors corresponding to PCT::Node "attributes".

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	Wed Jun 23 07:36:11 2010	(r47778)
+++ branches/gsoc_past_optimization/runtime/parrot/library/PAST/Pattern.nqp	Wed Jun 23 07:39:38 2010	(r47779)
@@ -7,28 +7,6 @@
 }
 
 class PAST::Pattern is PCT::Pattern {
-    method attr ($name, $value, $has_value) {
-        my $result;
-        if ($has_value) {
-            self{$name} := Tree::Pattern::patternize($value);
-        } else {
-            $result := self{$name};
-        }
-        $result;
-    }
-
-    method name ($val?) {
-        self.attr("name", $val, !pir::isnull__iP($val));
-    }
-
-    method source ($val?) {
-        self.attr("source", $val, !pir::isnull__iP($val));
-    }
-
-    method pos ($val?) {
-        self.attr("pos", $val, !pir::isnull__iP($val));
-    }
-
     method returns ($val?) {
         self.attr("returns", $val, !pir::isnull__iP($val));
     }

Modified: branches/gsoc_past_optimization/runtime/parrot/library/PCT/Pattern.nqp
==============================================================================
--- branches/gsoc_past_optimization/runtime/parrot/library/PCT/Pattern.nqp	Wed Jun 23 07:36:11 2010	(r47778)
+++ branches/gsoc_past_optimization/runtime/parrot/library/PCT/Pattern.nqp	Wed Jun 23 07:39:38 2010	(r47779)
@@ -18,7 +18,27 @@
 }
 
 class PCT::Pattern is Tree::Pattern {
+    method attr ($name, $value, $has_value) {
+        my $result;
+        if ($has_value) {
+            self{$name} := Tree::Pattern::patternize($value);
+        } else {
+            $result := self{$name};
+        }
+        $result;
+    }
 
+    method name ($val?) {
+        self.attr("name", $val, !pir::isnull__iP($val));
+    }
+
+    method source ($val?) {
+        self.attr("source", $val, !pir::isnull__iP($val));
+    }
+
+    method pos ($val?) {
+        self.attr("pos", $val, !pir::isnull__iP($val));
+    }
 }
 
 # Local Variables:


More information about the parrot-commits mailing list