iris

small scheme interpreter
git clone git://git.2f30.org/iris
Log | Files | Refs | LICENSE

commit 3bf505874b1285e0e9b91dafb755dfbaaa0d88bb
parent d59f45a20cf72fd69ddbb3728e4b1a027b86321f
Author: sin <sin@2f30.org>
Date:   Thu, 15 May 2014 12:16:36 +0100

Check for errors while parsing define

Diffstat:
Mparser.c | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/parser.c b/parser.c @@ -303,10 +303,12 @@ evaldefine(struct object *o) strcmp(ocar->d.i.s, "define") == 0) { var = cadr(o); if (var->type != OIdentifier) - return error("expected an identifier"); + return error("expected identifier"); if (!caddr(o)) return error("expected sexpression"); val = eval(caddr(o)); + if (val->type == OError) + return val; addsym(var->d.i.s, val); return lookupsym("ok"); }