iris

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

commit 39643d45834f6ace6e475da7dba02dabaef95b8d
parent 8cef3fb9e1ef5a63979d9b322df0f596dfdcbc8d
Author: sin <sin@2f30.org>
Date:   Wed, 14 May 2014 17:20:02 +0100

Initialize env

Diffstat:
Mparser.c | 3++-
Msym.c | 3++-
Msym.h | 6+++---
3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/parser.c b/parser.c @@ -5,6 +5,7 @@ #include <string.h> #include "lexer.h" #include "parser.h" +#include "sym.h" #include "util.h" static struct object * @@ -117,8 +118,8 @@ sexpression(FILE *in) { struct tok t; + initenv(); t = gettok(in); - switch (t.type) { case TEof: return eof(&t); diff --git a/sym.c b/sym.c @@ -59,7 +59,8 @@ lookupsym(const char *s) int initenv(void) { - topenv = &env[0]; + if (!topenv) + topenv = &env[0]; return 0; } diff --git a/sym.h b/sym.h @@ -3,6 +3,6 @@ struct object; struct object *addsym(const char *, struct object *); struct object *lookupsym(const char *); -int initenv(); -int pushenv(); -int popenv(); +int initenv(void); +int pushenv(void); +int popenv(void);