develooper Front page | perl.cvs.parrot | Postings from January 2009

[svn:parrot] r35201 - branches/rvar2/compilers/pge/PGE

From:
pmichaud
Date:
January 8, 2009 07:41
Subject:
[svn:parrot] r35201 - branches/rvar2/compilers/pge/PGE
Message ID:
20090108154125.765C6CB9F9@x12.develooper.com
Author: pmichaud
Date: Thu Jan  8 07:41:24 2009
New Revision: 35201

Modified:
   branches/rvar2/compilers/pge/PGE/Exp.pir

Log:
[pge]:  Improve handling of 'namespace' and 'grammar' options.


Modified: branches/rvar2/compilers/pge/PGE/Exp.pir
==============================================================================
--- branches/rvar2/compilers/pge/PGE/Exp.pir	(original)
+++ branches/rvar2/compilers/pge/PGE/Exp.pir	Thu Jan  8 07:41:24 2009
@@ -67,21 +67,14 @@
 
     .local pmc ns
     ns = adverbs['namespace']
-    if null ns goto ns_grammar
-    unless ns goto ns_grammar
-    $P0 = code.'key'(ns)
-    code.'emit'('.namespace %0', $P0)
-    goto ns_done
+    unless null ns goto ns_emit
   ns_grammar:
     .local string grammar
     grammar = adverbs['grammar']
-    if grammar == '' goto ns_root
-    $P0 = split '::', grammar
-    $P0 = code.'key'($P0 :flat)
-    code.'emit'(".namespace %0", $P0)
-    goto ns_done
-  ns_root:
-    code.'emit'('.namespace []')
+    ns = split '::', grammar
+  ns_emit:
+    $P0 = code.'key'(ns)
+    code.'emit'('.namespace %0', $P0)
   ns_done:
 
     $P0 = self.'root_pir'(adverbs :flat :named)



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