cvsuser 03/09/19 01:00:57
Modified: . io.ops
t/pmc io.t
Log:
io_5: throw exception for readline
Revision Changes Path
1.35 +6 -0 parrot/io.ops
Index: io.ops
===================================================================
RCS file: /cvs/public/parrot/io.ops,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -w -r1.34 -r1.35
--- io.ops 17 Sep 2003 17:34:01 -0000 1.34
+++ io.ops 19 Sep 2003 08:00:55 -0000 1.35
@@ -369,6 +369,12 @@
inline op readline(out STR, in PMC) {
size_t len = 0;
+ opcode_t * resume = expr NEXT();
+ /* experimental error handling, mainly for t/pmc/io_5.pasm */
+ int ok = VTABLE_get_bool(interpreter, $2);
+ if (!ok)
+ real_exception(interpreter, resume, PIO_ERROR,
+ "File not found");
$1 = string_make(interpreter, NULL, 65535, NULL, 0, NULL);
memset(($1)->strstart, 0, 65535);
1.17 +2 -1 parrot/t/pmc/io.t
Index: io.t
===================================================================
RCS file: /cvs/public/parrot/t/pmc/io.t,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -w -r1.16 -r1.17
--- io.t 19 Sep 2003 06:44:57 -0000 1.16
+++ io.t 19 Sep 2003 08:00:57 -0000 1.17
@@ -124,6 +124,7 @@
print "not "
_readline_handler:
print "ok 2\n"
+ branch fin
newsub P20, .Exception_Handler, _read_handler
set_eh P20
@@ -137,13 +138,13 @@
print P0, "kill me now\n"
print "not "
_print_handler:
+fin:
print "ok 4\n"
end
CODE
ok 1
ok 2
-ok 3
ok 4
OUTPUT
}