Author: pmichaud
Date: Tue Dec 23 23:41:33 2008
New Revision: 34318

Modified:
   trunk/compilers/pge/PGE/Exp.pir
   trunk/compilers/pge/PGE/Match.pir

Log:
[pge]:  Temporary fix to allow callers to decide the Match object
(since we can't always provide a 'grammar' named argument).


Modified: trunk/compilers/pge/PGE/Exp.pir
==============================================================================
--- trunk/compilers/pge/PGE/Exp.pir     (original)
+++ trunk/compilers/pge/PGE/Exp.pir     Tue Dec 23 23:41:33 2008
@@ -176,7 +176,7 @@
           .local string target :unique_reg
           .local pmc mfrom, mpos :unique_reg
           .local int cpos, iscont :unique_reg
-          $P0 = get_hll_global ['PGE'], 'Match'
+          $P0 = get_hll_global ['PGE'], '$!MATCH'
           (mob, cpos, target, mfrom, mpos, iscont) = $P0.'new'(mob, adverbs 
:flat :named)
           $P0 = interpinfo %3
           setattribute mob, '&!corou', $P0
@@ -196,7 +196,7 @@
           .local string target    :unique_reg
           .local pmc mfrom, mpos  :unique_reg
           .local int cpos, iscont :unique_reg
-          $P0 = get_hll_global ['PGE'], 'Match'
+          $P0 = get_hll_global ['PGE'], '$!MATCH'
           (mob, cpos, target, mfrom, mpos, iscont) = $P0.'new'(self, adverbs 
:flat :named)
           .local int lastpos
           lastpos = length target

Modified: trunk/compilers/pge/PGE/Match.pir
==============================================================================
--- trunk/compilers/pge/PGE/Match.pir   (original)
+++ trunk/compilers/pge/PGE/Match.pir   Tue Dec 23 23:41:33 2008
@@ -15,7 +15,8 @@
     load_bytecode 'PGE/Dumper.pir'                 # FIXME, XXX, etc.
     .local pmc p6meta
     p6meta = new 'P6metaclass'
-    p6meta.'new_class'('PGE::Match', 'parent'=>'Capture', 'attr'=>'$.target 
$.from $.pos &!corou $!item')
+    $P0 = p6meta.'new_class'('PGE::Match', 'parent'=>'Capture', 
'attr'=>'$.target $.from $.pos &!corou $!item')
+    set_hll_global ['PGE'], '$!MATCH', $P0
     .return ()
 .end
 

Reply via email to