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

[svn:parrot] r34215 - in trunk/languages/pipp: src/common t/embed

From:
bernhard
Date:
December 21, 2008 09:19
Subject:
[svn:parrot] r34215 - in trunk/languages/pipp: src/common t/embed
Message ID:
20081221171901.86641CBA12@x12.develooper.com
Author: bernhard
Date: Sun Dec 21 09:19:00 2008
New Revision: 34215

Modified:
   trunk/languages/pipp/src/common/eval.pir
   trunk/languages/pipp/t/embed/eval.t

Log:
[Pipp] Add simple implementation of 'eval'


Modified: trunk/languages/pipp/src/common/eval.pir
==============================================================================
--- trunk/languages/pipp/src/common/eval.pir	(original)
+++ trunk/languages/pipp/src/common/eval.pir	Sun Dec 21 09:19:00 2008
@@ -20,9 +20,14 @@
 
 .sub 'eval'
 
-   say '# eval() was called'
+    .param pmc code
 
-   .return (1)
+    $P0 = get_hll_global 'Str'
+
+    .local pmc compiler
+    compiler = compreg 'Pipp'
+
+    .tailcall compiler.'eval'(code)
 .end
 
 .namespace []

Modified: trunk/languages/pipp/t/embed/eval.t
==============================================================================
--- trunk/languages/pipp/t/embed/eval.t	(original)
+++ trunk/languages/pipp/t/embed/eval.t	Sun Dec 21 09:19:00 2008
@@ -31,8 +31,10 @@
     .local pmc eval_sub
     .local int ret
     eval_sub = get_hll_global [ 'Pipp' ], 'eval'
-    # call it with test output
-    eval_sub()
+    # call it with TAP diagnostics
+    eval_sub("# only sea, not islands\n")
+
+    eval_sub('<?php function no_args () { echo "# no_args was called\n"; } no_args(); ?>')
 
     # define a function
     # call it from here



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