develooper Front page | perl.cvs.parrot | Postings from December 2008

[svn:parrot] r34318 - trunk/compilers/pge/PGE

From:
pmichaud
Date:
December 23, 2008 23:41
Subject:
[svn:parrot] r34318 - trunk/compilers/pge/PGE
Message ID:
20081224074134.5C13DCBA12@x12.develooper.com
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
 



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About