[svn:parrot] r48023 - branches/gsoc_past_optimization/runtime/parrot/library/Tree

tcurtis at svn.parrot.org tcurtis at svn.parrot.org
Wed Jul 7 04:20:57 UTC 2010


Author: tcurtis
Date: Wed Jul  7 04:20:56 2010
New Revision: 48023
URL: https://trac.parrot.org/parrot/changeset/48023

Log:
Refactor .transform to use a method to find the transformer class to create to allow subclasses to more easily substitute a different one.

Modified:
   branches/gsoc_past_optimization/runtime/parrot/library/Tree/Pattern.nqp

Modified: branches/gsoc_past_optimization/runtime/parrot/library/Tree/Pattern.nqp
==============================================================================
--- branches/gsoc_past_optimization/runtime/parrot/library/Tree/Pattern.nqp	Wed Jul  7 03:19:44 2010	(r48022)
+++ branches/gsoc_past_optimization/runtime/parrot/library/Tree/Pattern.nqp	Wed Jul  7 04:20:56 2010	(r48023)
@@ -39,10 +39,14 @@
             pir::die('$transform must be invokable or a PAST::Transformer.');
         }
         my $transformer :=
-          Tree::Pattern::Transformer.new(self, &transSub, |%adverbs);
+          self.transformer_class.new(self, &transSub, |%adverbs);
         $transformer.walk($node);
     }
 
+    method transformer_class () {
+        Tree::Pattern::Transformer;
+    }
+
     method ACCEPTS ($node, *%opts) {
         my $global := ?%opts<g> || ?%opts<global>;
         my $pos := %opts<p> || %opts<pos>;


More information about the parrot-commits mailing list