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

[svn:parrot] r35446 - trunk/languages/perl6/src/parser

From:
jonathan
Date:
January 12, 2009 09:50
Subject:
[svn:parrot] r35446 - trunk/languages/perl6/src/parser
Message ID:
20090112175005.CF801CB9F9@x12.develooper.com
Author: jonathan
Date: Mon Jan 12 09:50:05 2009
New Revision: 35446

Modified:
   trunk/languages/perl6/src/parser/methods.pir

Log:
[rakudo] Fix up type variable declaration handling in is_type.

Modified: trunk/languages/perl6/src/parser/methods.pir
==============================================================================
--- trunk/languages/perl6/src/parser/methods.pir	(original)
+++ trunk/languages/perl6/src/parser/methods.pir	Mon Jan 12 09:50:05 2009
@@ -50,13 +50,21 @@
 .sub 'is_type' :method
     .param string full_name
 
-    # If it starts with ::, it's a declaration.
+    # Get blocks.
+    .local pmc blocks
+    blocks = get_hll_global [ 'Perl6' ; 'Grammar' ; 'Actions' ], '@?BLOCK'
+
+    # If it starts with ::, it's a declaration; note it in the block.
     $S0 = substr full_name, 0, 2
-    if $S0 == '::' goto type_ok
+    if $S0 != '::' goto not_decl
+    $S0 = substr full_name, 2
+    $P0 = blocks[0]
+    $P0.'symbol'($S0, 'does_abstraction'=>1)
+    goto type_ok
+  not_decl:
 
     # Look in @?BLOCK first.
-    .local pmc blocks, block_it, block, sym_info
-    blocks = get_hll_global [ 'Perl6' ; 'Grammar' ; 'Actions' ], '@?BLOCK'
+    .local pmc block_it, block, sym_info
     block_it = iter blocks
     block_it_loop:
     unless block_it goto block_it_loop_end
@@ -95,7 +103,6 @@
       type_ok:
         .return (1)
       fail_it:
-        say "failed it"
         .return (0)
 .end
 



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