Remove unnecessary code
This commit is contained in:
parent
e225caea00
commit
5b2c5af17f
26
src/eval.c
26
src/eval.c
|
@ -16,32 +16,6 @@ static struct Object *eval_list(
|
|||
struct Object *environment
|
||||
);
|
||||
|
||||
struct Object *eval_str(
|
||||
const char *const str,
|
||||
struct Object *const environment
|
||||
) {
|
||||
assert(str);
|
||||
|
||||
Tokens tokens = Tokens_new();
|
||||
assert(tokens);
|
||||
|
||||
Lexer lexer = Lexer_new(tokens);
|
||||
assert(lexer);
|
||||
|
||||
for (const char *chr = str; *chr; ++chr) {
|
||||
Lexer_lex(lexer, *chr);
|
||||
}
|
||||
Lexer_lex(lexer, '\n');
|
||||
|
||||
LEXER_DELETE(lexer);
|
||||
assert(Tokens_top(tokens));
|
||||
|
||||
struct Object *const program = parse(tokens);
|
||||
TOKENS_DELETE(tokens);
|
||||
|
||||
return eval(program, environment);
|
||||
}
|
||||
|
||||
struct Object *eval(
|
||||
struct Object *const object,
|
||||
struct Object *const environment
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
|
||||
#include "object.h"
|
||||
|
||||
struct Object *eval_str(const char * str, struct Object *environment);
|
||||
struct Object *eval(struct Object *object, struct Object *environment);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue