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

[svn:parrot] r34964 - branches/pct_hll/languages/perl6/src/builtins

From:
tene
Date:
January 4, 2009 22:47
Subject:
[svn:parrot] r34964 - branches/pct_hll/languages/perl6/src/builtins
Message ID:
20090105064701.245BECB9F9@x12.develooper.com
Author: tene
Date: Sun Jan  4 22:47:00 2009
New Revision: 34964

Modified:
   branches/pct_hll/languages/perl6/src/builtins/control.pir

Log:
[rakudo]: Initial implementation of :lang for eval.

Modified: branches/pct_hll/languages/perl6/src/builtins/control.pir
==============================================================================
--- branches/pct_hll/languages/perl6/src/builtins/control.pir	(original)
+++ branches/pct_hll/languages/perl6/src/builtins/control.pir	Sun Jan  4 22:47:00 2009
@@ -301,14 +301,24 @@
     $P0 = get_hll_global 'Str'
     '!TYPECHECKPARAM'($P0, code)
 
-    unless have_lang goto no_lang
-    'die'('Lanuage parameter to eval unimplemented.')
-  no_lang:
-
     .local pmc compiler, invokable
     .local pmc res, exception
+    unless have_lang goto no_lang
+    push_eh catch
+    $S0 = lang
+    $S0 = concat 'languages/', $S0
+    $S0 = concat $S0, '/'
+    $S1 = lang
+    $S0 = concat $S0, $S1
+    $S0 = concat $S0, '.pbc'
+    load_bytecode $S0
+    $S0 = lang
+    compiler = compreg $S0
+    goto got_lang
+  no_lang:
     push_eh catch
     compiler = compreg 'Perl6'
+  got_lang:
     invokable = compiler.'compile'(code)
 
     res = invokable()



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