diff --git a/src/main.c b/src/main.c index 082f5a8..52d716b 100644 --- a/src/main.c +++ b/src/main.c @@ -1,7 +1,7 @@ -#include "eval.h" #include "lexer.h" #include "object.h" #include "parser.h" +#include "syntax.h" #include "tokens.h" #include @@ -62,10 +62,10 @@ void repl() struct Object *const program = parse(tokens); TOKENS_DELETE(tokens); - struct Object *const result = eval(program, environment); + struct Object *const result = syntax_repl(program, environment); printf("=> "); - eval( + syntax_repl( Object_build_list( 2, Object_new_symbol("displayln"), @@ -98,5 +98,5 @@ void script() TOKENS_DELETE(tokens); struct Object *const environment = Object_new_pair(NULL, NULL); - eval(program, environment); + syntax_script(program, environment); } diff --git a/src/syntax.c b/src/syntax.c index f3de3e1..ee8b98c 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -5,6 +5,20 @@ #include +struct Object *syntax_repl( + struct Object *args, + struct Object *const environment +) { + return eval(args, environment); +} + +struct Object *syntax_script( + struct Object *args, + struct Object *const environment +) { + return eval(args, environment); +} + struct Object *syntax_begin( struct Object *args, struct Object *const environment diff --git a/src/syntax.h b/src/syntax.h index fadd85e..ca28260 100644 --- a/src/syntax.h +++ b/src/syntax.h @@ -3,6 +3,9 @@ #include "object.h" +struct Object *syntax_repl(struct Object *args, struct Object *environment); +struct Object *syntax_script(struct Object *args, struct Object *environment); + struct Object *syntax_begin(struct Object *args, struct Object *environment); struct Object *syntax_define(struct Object *args, struct Object *environment); struct Object *syntax_if(struct Object *args, struct Object *environment);