Commit dd584d6d authored by Niels Möller's avatar Niels Möller
Browse files

* src/command.c (do_call_simple_command): Deleted.

(catch_collect_body): Inherit command, not command_simple.

Rev: src/command.c:1.45
parent 5ec4ccf1
...@@ -358,17 +358,6 @@ do_command_4(struct command *s, ...@@ -358,17 +358,6 @@ do_command_4(struct command *s,
} }
void
do_call_simple_command(struct command *s,
struct lsh_object *arg,
struct command_continuation *c,
struct exception_handler *e UNUSED)
{
CAST_SUBTYPE(command_simple, self, s);
COMMAND_RETURN(c, COMMAND_SIMPLE_CALL(self, arg));
}
/* Tracing */ /* Tracing */
#if DEBUG_TRACE #if DEBUG_TRACE
...@@ -625,42 +614,45 @@ make_catch_apply(struct catch_handler_info *info, ...@@ -625,42 +614,45 @@ make_catch_apply(struct catch_handler_info *info,
/* GABA: /* GABA:
(class (class
(name catch_collect_body) (name catch_collect_body)
(super command_simple) (super command)
(vars (vars
(info object catch_handler_info))) (info object catch_handler_info)))
*/ */
static struct lsh_object * static void
do_catch_collect_body(struct command_simple *s, do_catch_collect_body(struct command *s,
struct lsh_object *a) struct lsh_object *a,
struct command_continuation *c,
struct exception_handler *e UNUSED)
{ {
CAST(catch_collect_body, self, s); CAST(catch_collect_body, self, s);
CAST_SUBTYPE(command, body, a); CAST_SUBTYPE(command, body, a);
return &make_catch_apply(self->info, body)->super; COMMAND_RETURN(c, make_catch_apply(self->info, body));
} }
static struct command * static struct command *
make_catch_collect_body(struct catch_handler_info *info) make_catch_collect_body(struct catch_handler_info *info)
{ {
NEW(catch_collect_body, self); NEW(catch_collect_body, self);
self->super.super.call = do_call_simple_command; self->super.call = do_catch_collect_body;
self->super.call_simple = do_catch_collect_body;
self->info = info; self->info = info;
return &self->super.super; return &self->super;
} }
struct lsh_object * void
do_catch_simple(struct command_simple *s, do_catch_simple(struct command *s,
struct lsh_object *a) struct lsh_object *a,
struct command_continuation *c,
struct exception_handler *e UNUSED)
{ {
CAST(catch_command, self, s); CAST(catch_command, self, s);
CAST_SUBTYPE(command, f, a); CAST_SUBTYPE(command, f, a);
COMMAND_RETURN(c,
return &(make_catch_collect_body(make_catch_handler_info(self->mask, make_catch_collect_body
self->value, self->ignore_value, f)) (make_catch_handler_info(self->mask,
->super); self->value, self->ignore_value, f)));
} }
...@@ -702,12 +694,15 @@ make_catch_report_apply(struct report_exception_info *info, ...@@ -702,12 +694,15 @@ make_catch_report_apply(struct report_exception_info *info,
return &self->super; return &self->super;
} }
struct lsh_object * void
do_catch_report_collect(struct command_simple *s, do_catch_report_collect(struct command *s,
struct lsh_object *a) struct lsh_object *a,
struct command_continuation *c,
struct exception_handler *e UNUSED)
{ {
CAST(catch_report_collect, self, s); CAST(catch_report_collect, self, s);
CAST_SUBTYPE(command, body, a); CAST_SUBTYPE(command, body, a);
return &make_catch_report_apply(self->info, body)->super; COMMAND_RETURN(c,
make_catch_report_apply(self->info, body));
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment