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

[svn:parrot] r35491 - trunk/languages/befunge

From:
fperrad
Date:
January 13, 2009 09:15
Subject:
[svn:parrot] r35491 - trunk/languages/befunge
Message ID:
20090113171457.217B8CB9F9@x12.develooper.com
Author: fperrad
Date: Tue Jan 13 09:14:56 2009
New Revision: 35491

Modified:
   trunk/languages/befunge/befunge.pir
   trunk/languages/befunge/load.pir

Log:
[befunge]
- improve exception handling

Modified: trunk/languages/befunge/befunge.pir
==============================================================================
--- trunk/languages/befunge/befunge.pir	(original)
+++ trunk/languages/befunge/befunge.pir	Tue Jan 13 09:14:56 2009
@@ -10,6 +10,8 @@
 .sub "befunge" :main
     .param pmc argv
 
+    push_eh catch
+
     # disable buffering on stdout
     .local pmc stdout
     getstdout stdout
@@ -240,6 +242,11 @@
     set_global "status", status
     goto TICK
 
+  catch:
+    .local pmc ex
+    .get_results (ex)
+    printerr ex
+
 .end
 
 

Modified: trunk/languages/befunge/load.pir
==============================================================================
--- trunk/languages/befunge/load.pir	(original)
+++ trunk/languages/befunge/load.pir	Tue Jan 13 09:14:56 2009
@@ -64,8 +64,8 @@
     $S0 .= "' ("
     $S1 = err
     $S0 .= $S1
-    $S0 .= ")\n"
-    printerr $S0
+    $S0 .= ")"
+    ex = $S0
     rethrow ex
 
 .end



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