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

[svn:parrot] r34045 - trunk/languages/perl6/src/builtins

From:
jonathan
Date:
December 17, 2008 12:56
Subject:
[svn:parrot] r34045 - trunk/languages/perl6/src/builtins
Message ID:
20081217205643.9ADD2CBA12@x12.develooper.com
Author: jonathan
Date: Wed Dec 17 12:56:42 2008
New Revision: 34045

Modified:
   trunk/languages/perl6/src/builtins/guts.pir

Log:
[rakudo] Fix namespacing of grammars. Patch courtesy of Chris Dolan.

Modified: trunk/languages/perl6/src/builtins/guts.pir
==============================================================================
--- trunk/languages/perl6/src/builtins/guts.pir	(original)
+++ trunk/languages/perl6/src/builtins/guts.pir	Wed Dec 17 12:56:42 2008
@@ -405,18 +405,10 @@
 
 .sub '!keyword_grammar'
     .param string name
-    .local pmc info, grammar
+    .local pmc grammar
 
-    # Need to make sure it ends up attached to the right
-    # namespace.
-    info = new 'Hash'
-    info['name'] = name
-    $P0 = new 'ResizablePMCArray'
-    $P0[0] = name
-    info['namespace'] = $P0
-
-    # Create grammar class..
-    grammar = new 'Class', info
+    $P0 = split "::", name
+    grammar = newclass $P0
 
     .return(grammar)
 .end



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