Author: tene
Date: Sun Sep 21 01:47:14 2008
New Revision: 31294
Modified:
trunk/docs/pdds/pdd19_pir.pod
Changes in other areas also in this revision:
Modified:
trunk/compilers/bcg/t/BCG.t
trunk/compilers/pct/src/PAST/Compiler.pir
trunk/compilers/pct/src/PCT/HLLCompiler.pir
trunk/languages/APL/src/parser/actions.pm
trunk/languages/WMLScript/src/wmlsstdlibs.pir
trunk/languages/WMLScript/wmls2pbc.pir
trunk/languages/WMLScript/wmls2pir.pir
trunk/languages/WMLScript/wmlsd.pir
trunk/languages/WMLScript/wmlsi.pir
trunk/languages/dotnet/build/translator.pl
trunk/languages/dotnet/src/translator.pir
trunk/languages/ecmascript/src/parser/actions.pm
trunk/languages/forth/forth.pir
trunk/languages/forth/test.pir
trunk/languages/lua/luac2pir.pir
trunk/languages/lua/luad.pir
trunk/languages/lua/src/lib/bc.pir
trunk/languages/lua/src/lib/glut.pir
trunk/languages/lua/src/lib/lfs.pir
trunk/languages/lua/src/lib/luaaux.pir
trunk/languages/lua/src/lib/luabasic.pir
trunk/languages/lua/src/lib/luacoroutine.pir
trunk/languages/lua/src/lib/luadebug.pir
trunk/languages/lua/src/lib/luaos.pir
trunk/languages/perl6/src/builtins/control.pir
trunk/languages/perl6/src/parser/actions.pm
trunk/languages/pheme/pheme.pir
trunk/languages/squaak/src/parser/actions.pm
trunk/languages/tcl/runtime/builtin/dict.pir
trunk/languages/tcl/runtime/builtin/info.pir
trunk/languages/tcl/runtime/builtin/inline.pir
trunk/languages/tcl/runtime/conversions.pir
trunk/languages/tcl/src/macros.pir
trunk/languages/tcl/t/internals/select_option.t
trunk/languages/tcl/t/internals/select_switches.t
trunk/src/exceptions.c
trunk/src/ops/core.ops
trunk/t/compilers/pge/p5regex/p5rx.t
trunk/t/compilers/pge/perl6regex/01-regex.t
trunk/t/library/pg.t
trunk/t/op/calling.t
trunk/t/op/exceptions.t
trunk/t/op/sprintf.t
trunk/t/pmc/bigint.t
trunk/t/pmc/complex.t
trunk/t/pmc/coroutine.t
trunk/t/pmc/exception.t
trunk/t/pmc/float.t
trunk/t/pmc/namespace.t
trunk/t/pmc/resizablestringarray.t
Log:
[parrot]
Remove the second argument passed to exception handlers.
You can get the message by stringifying the exception object.
All parrot tests pass. Looks like the languages are all okay too.
Modified: trunk/docs/pdds/pdd19_pir.pod
==============================================================================
--- trunk/docs/pdds/pdd19_pir.pod (original)
+++ trunk/docs/pdds/pdd19_pir.pod Sun Sep 21 01:47:14 2008
@@ -617,18 +617,13 @@
Using the C<push_eh> op you can install an exception handler. If an exception
is thrown, Parrot will execute the installed exception handler. In order to
retrieve the thrown exception, use the C<.get_results> directive. This
-directive always takes 2 arguments: an exception object and a message string.
-
-{{ NOTE: Wouldn't it be more useful to make this flexible, or at least only
-the exception object? The message can be retrieved from the exception object.
-See RT #57436 }}
+directive always takes one argument: an exception object.
push_eh handler
...
handler:
.local pmc exception
- .local string message
- .get_results (exception, message)
+ .get_results (exception)
...
This is syntactic sugar for the C<get_results> op, but any flags set on the
@@ -636,6 +631,16 @@
The C<.get_results> directive must be the first instruction of the exception
handler; only declarations (.lex, .local) may come first.
+To resume execution after handling the exception, just invoke the continuation
+stored in the exception.
+
+ ...
+ .get_results(exception)
+ ...
+ continuation = exception['resume']
+ continuation()
+ ...
+
=head2 Syntactic Sugar
Any PASM opcode is a valid PIR instruction. In addition, PIR defines some