[svn:parrot] r47774 - in branches/gsoc_past_optimization: . config/gen/makefiles runtime/parrot/library/PAST runtime/parrot/library/PAST/Pattern runtime/parrot/library/Tree runtime/parrot/library/Tree/Pattern t/library

tcurtis at svn.parrot.org tcurtis at svn.parrot.org
Wed Jun 23 04:37:52 UTC 2010


Author: tcurtis
Date: Wed Jun 23 04:37:52 2010
New Revision: 47774
URL: https://trac.parrot.org/parrot/changeset/47774

Log:
Move PAST::Pattern::Any to Tree::Pattern::Any.

Added:
   branches/gsoc_past_optimization/runtime/parrot/library/Tree/Pattern/Any.nqp
      - copied, changed from r47773, branches/gsoc_past_optimization/runtime/parrot/library/PAST/Pattern/Any.nqp
Deleted:
   branches/gsoc_past_optimization/runtime/parrot/library/PAST/Pattern/Any.nqp
Modified:
   branches/gsoc_past_optimization/MANIFEST
   branches/gsoc_past_optimization/MANIFEST.SKIP
   branches/gsoc_past_optimization/config/gen/makefiles/root.in
   branches/gsoc_past_optimization/runtime/parrot/library/PAST/Pattern.nqp
   branches/gsoc_past_optimization/runtime/parrot/library/Tree/Pattern/   (props changed)
   branches/gsoc_past_optimization/runtime/parrot/library/Tree/Pattern.nqp
   branches/gsoc_past_optimization/t/library/pastpattern.t

Modified: branches/gsoc_past_optimization/MANIFEST
==============================================================================
--- branches/gsoc_past_optimization/MANIFEST	Wed Jun 23 04:22:11 2010	(r47773)
+++ branches/gsoc_past_optimization/MANIFEST	Wed Jun 23 04:37:52 2010	(r47774)
@@ -1,7 +1,7 @@
 # ex: set ro:
 # $Id$
 #
-# generated by tools/dev/mk_manifest_and_skip.pl Wed Jun 23 03:39:43 2010 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Wed Jun 23 04:32:25 2010 UT
 #
 # See below for documentation on the format of this file.
 #
@@ -1175,7 +1175,6 @@
 runtime/parrot/library/OpenGL/Math.pir                      [library]
 runtime/parrot/library/P6object.pir                         [library]
 runtime/parrot/library/PAST/Pattern.nqp                     [library]
-runtime/parrot/library/PAST/Pattern/Any.nqp                 [library]
 runtime/parrot/library/PAST/Pattern/Node.nqp                [library]
 runtime/parrot/library/PAST/Pattern/Transformer.nqp         [library]
 runtime/parrot/library/PAST/Transformer.pir                 [library]
@@ -1237,6 +1236,7 @@
 runtime/parrot/library/Test/Class.pir                       [library]
 runtime/parrot/library/Test/More.pir                        [library]
 runtime/parrot/library/Tree/Pattern.nqp                     [library]
+runtime/parrot/library/Tree/Pattern/Any.nqp                 [library]
 runtime/parrot/library/Tree/Pattern/Closure.nqp             [library]
 runtime/parrot/library/Tree/Pattern/Constant.nqp            [library]
 runtime/parrot/library/Tree/Pattern/Match.nqp               [library]

Modified: branches/gsoc_past_optimization/MANIFEST.SKIP
==============================================================================
--- branches/gsoc_past_optimization/MANIFEST.SKIP	Wed Jun 23 04:22:11 2010	(r47773)
+++ branches/gsoc_past_optimization/MANIFEST.SKIP	Wed Jun 23 04:37:52 2010	(r47774)
@@ -1,6 +1,6 @@
 # ex: set ro:
 # $Id$
-# generated by tools/dev/mk_manifest_and_skip.pl Wed Jun 23 03:39:43 2010 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Wed Jun 23 04:32:25 2010 UT
 #
 # This file should contain a transcript of the svn:ignore properties
 # of the directories in the Parrot subversion repository. (Needed for
@@ -656,6 +656,8 @@
 # generated from svn:ignore of 'runtime/parrot/library/Tree/Pattern/'
 ^runtime/parrot/library/Tree/Pattern/.*\.pbc$
 ^runtime/parrot/library/Tree/Pattern/.*\.pbc/
+^runtime/parrot/library/Tree/Pattern/Any\.pir$
+^runtime/parrot/library/Tree/Pattern/Any\.pir/
 ^runtime/parrot/library/Tree/Pattern/Closure\.pir$
 ^runtime/parrot/library/Tree/Pattern/Closure\.pir/
 ^runtime/parrot/library/Tree/Pattern/Constant\.pir$

Modified: branches/gsoc_past_optimization/config/gen/makefiles/root.in
==============================================================================
--- branches/gsoc_past_optimization/config/gen/makefiles/root.in	Wed Jun 23 04:22:11 2010	(r47773)
+++ branches/gsoc_past_optimization/config/gen/makefiles/root.in	Wed Jun 23 04:37:52 2010	(r47774)
@@ -282,8 +282,6 @@
     $(LIBRARY_DIR)/P6object.pbc \
     $(LIBRARY_DIR)/PAST/Pattern.pbc \
     $(LIBRARY_DIR)/PAST/Pattern.pir \
-    $(LIBRARY_DIR)/PAST/Pattern/Any.pbc \
-    $(LIBRARY_DIR)/PAST/Pattern/Any.pir \
     $(LIBRARY_DIR)/PAST/Pattern/Node.pbc \
     $(LIBRARY_DIR)/PAST/Pattern/Node.pir \
     $(LIBRARY_DIR)/PAST/Pattern/Transformer.pbc \
@@ -333,6 +331,8 @@
     $(LIBRARY_DIR)/TclLibrary.pbc \
     $(LIBRARY_DIR)/Tree/Pattern.pbc \
     $(LIBRARY_DIR)/Tree/Pattern.pir \
+    $(LIBRARY_DIR)/Tree/Pattern/Any.pbc \
+    $(LIBRARY_DIR)/Tree/Pattern/Any.pir \
     $(LIBRARY_DIR)/Tree/Pattern/Closure.pbc \
     $(LIBRARY_DIR)/Tree/Pattern/Closure.pir \
     $(LIBRARY_DIR)/Tree/Pattern/Constant.pbc \
@@ -1196,6 +1196,15 @@
 	$(NQP_RX) --target=pir $(LIBRARY_DIR)/Tree/Pattern.nqp \
 	> $@
 
+$(LIBRARY_DIR)/Tree/Pattern/Any.pbc: \
+	$(LIBRARY_DIR)/Tree/Pattern/Any.pir
+	$(PARROT) -o $@ $(LIBRARY_DIR)/Tree/Pattern/Any.pir
+
+$(LIBRARY_DIR)/Tree/Pattern/Any.pir: \
+	$(LIBRARY_DIR)/Tree/Pattern/Any.nqp $(NQP_RX)
+	$(NQP_RX) --target=pir $(LIBRARY_DIR)/Tree/Pattern/Any.nqp \
+	> $@
+
 $(LIBRARY_DIR)/Tree/Pattern/Closure.pbc: \
 	$(LIBRARY_DIR)/Tree/Pattern/Closure.pir
 	$(PARROT) -o $@ $(LIBRARY_DIR)/Tree/Pattern/Closure.pir

Modified: branches/gsoc_past_optimization/runtime/parrot/library/PAST/Pattern.nqp
==============================================================================
--- branches/gsoc_past_optimization/runtime/parrot/library/PAST/Pattern.nqp	Wed Jun 23 04:22:11 2010	(r47773)
+++ branches/gsoc_past_optimization/runtime/parrot/library/PAST/Pattern.nqp	Wed Jun 23 04:37:52 2010	(r47774)
@@ -36,8 +36,6 @@
 INIT {
     pir::load_bytecode('PAST/Pattern/Node.pbc');
 
-    pir::load_bytecode('PAST/Pattern/Any.pbc');
-
     pir::load_bytecode('PAST/Pattern/Transformer.pbc');
 }
 

Deleted: branches/gsoc_past_optimization/runtime/parrot/library/PAST/Pattern/Any.nqp
==============================================================================
--- branches/gsoc_past_optimization/runtime/parrot/library/PAST/Pattern/Any.nqp	Wed Jun 23 04:37:52 2010	(r47773)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,38 +0,0 @@
-#!./parrot-nqp
-# Copyright (C) 2010, Parrot Foundation.
-# $Id$
-
-class PAST::Pattern::Any is PAST::Pattern {
-    method new (*@_) {
-        my $self := Q:PIR {
-            $P0 = self.'HOW'()
-            $P0 = getattribute $P0, 'parrotclass'
-            %r = new $P0
-        };
-        my $index := 0;
-        for @_ {
-            $self[$index++] := Tree::Pattern::patternize($_);
-        }
-        $self;
-    }
-
-    method ACCEPTSEXACTLY ($node) {
-        my $index := 0;
-        my $max := pir::elements(self);
-        my $/;
-        while ($index < $max) {
-            if ($/ := self[$index].ACCEPTS($node, :p($node))) {
-                return $/;
-            }
-            $index++;
-        }
-        Tree::Pattern::Match.new(0);
-    }
-}
-
-# Local Variables:
-#   mode: cperl
-#   cperl-indent-level: 4
-#   fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4:

Modified: branches/gsoc_past_optimization/runtime/parrot/library/Tree/Pattern.nqp
==============================================================================
--- branches/gsoc_past_optimization/runtime/parrot/library/Tree/Pattern.nqp	Wed Jun 23 04:22:11 2010	(r47773)
+++ branches/gsoc_past_optimization/runtime/parrot/library/Tree/Pattern.nqp	Wed Jun 23 04:37:52 2010	(r47774)
@@ -85,6 +85,7 @@
 INIT {
     pir::load_bytecode('Tree/Pattern/Match.pbc');
 
+    pir::load_bytecode('Tree/Pattern/Any.pbc');
     pir::load_bytecode('Tree/Pattern/Closure.pbc');
     pir::load_bytecode('Tree/Pattern/Constant.pbc');
 }

Copied and modified: branches/gsoc_past_optimization/runtime/parrot/library/Tree/Pattern/Any.nqp (from r47773, branches/gsoc_past_optimization/runtime/parrot/library/PAST/Pattern/Any.nqp)
==============================================================================
--- branches/gsoc_past_optimization/runtime/parrot/library/PAST/Pattern/Any.nqp	Wed Jun 23 04:22:11 2010	(r47773, copy source)
+++ branches/gsoc_past_optimization/runtime/parrot/library/Tree/Pattern/Any.nqp	Wed Jun 23 04:37:52 2010	(r47774)
@@ -2,7 +2,7 @@
 # Copyright (C) 2010, Parrot Foundation.
 # $Id$
 
-class PAST::Pattern::Any is PAST::Pattern {
+class Tree::Pattern::Any is Tree::Pattern {
     method new (*@_) {
         my $self := Q:PIR {
             $P0 = self.'HOW'()

Modified: branches/gsoc_past_optimization/t/library/pastpattern.t
==============================================================================
--- branches/gsoc_past_optimization/t/library/pastpattern.t	Wed Jun 23 04:22:11 2010	(r47773)
+++ branches/gsoc_past_optimization/t/library/pastpattern.t	Wed Jun 23 04:37:52 2010	(r47774)
@@ -488,32 +488,32 @@
 }
 
 sub test_any_matching () {
-    my $pattern := PAST::Pattern::Any.new(PAST::Pattern::Val.new(),
+    my $pattern := Tree::Pattern::Any.new(PAST::Pattern::Val.new(),
                                           PAST::Pattern::Var.new());
     my $past := PAST::Val.new();
     my $/ := $past ~~ $pattern;
     ok($/ ~~ Tree::Pattern::Match,
-       'PAST::Pattern::Any: Matching 1st option produces a match result.');
+       'Tree::Pattern::Any: Matching 1st option produces a match result.');
     ok(?$/,
-       'PAST::Pattern::Any: Matching 1st option matches.');
+       'Tree::Pattern::Any: Matching 1st option matches.');
     ok($/.from() =:= $past,
-       'PAST::Pattern::Any: Matching 1st option has correct .from.');
+       'Tree::Pattern::Any: Matching 1st option has correct .from.');
 
     $past := PAST::Var.new();
     $/ := $past ~~ $pattern;
     ok($/ ~~ Tree::Pattern::Match,
-       'PAST::Pattern::Any: Matching 2nd option produces a match result.');
+       'Tree::Pattern::Any: Matching 2nd option produces a match result.');
     ok(?$/,
-       'PAST::Pattern::Any: Matching 2nd option matches.');
+       'Tree::Pattern::Any: Matching 2nd option matches.');
     ok($/.from() =:= $past,
-       'PAST::Pattern::Any: Matching 2nd option has correct .from.');
+       'Tree::Pattern::Any: Matching 2nd option has correct .from.');
 
     $past := PAST::Block.new();
     $/ := $past ~~ $pattern;
     ok($/ ~~ Tree::Pattern::Match,
-       'PAST::Pattern::Any: None matching produces a match result.');
+       'Tree::Pattern::Any: None matching produces a match result.');
     ok(!$/,
-       'PAST::Pattern::Any: None matching does not match.');
+       'Tree::Pattern::Any: None matching does not match.');
 }
 
 sub test_deep_matching_in_children () {


More information about the parrot-commits mailing list