From e9b426db412680de1888056c5a643b3ed8c7ded6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C5=99emysl=20Janouch?=
Date: Fri, 19 May 2017 18:32:28 +0200
Subject: [PATCH] Parsing should not create a new list
The resulting program is already a sequence.
---
ell.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/ell.c b/ell.c
index c1f784f..7370eea 100755
--- a/ell.c
+++ b/ell.c
@@ -630,7 +630,7 @@ parse (const char *s, size_t len, char **e) {
print_tree (result, 0);
printf ("\n\n");
#endif
- return new_list (result);
+ return result;
}
// --- Runtime -----------------------------------------------------------------
@@ -1006,7 +1006,7 @@ main (int argc, char *argv[]) {
fclose (fp);
char *e = NULL;
- struct item *tree = parse (buf.s, buf.len, &e);
+ struct item *program = parse (buf.s, buf.len, &e);
free (buf.s);
if (e) {
printf ("%s: %s\n", "parse error", e);
@@ -1021,9 +1021,9 @@ main (int argc, char *argv[]) {
printf ("%s\n", "runtime library initialization failed");
struct item *result = NULL;
- (void) execute (&ctx, tree->head, &result);
+ (void) execute (&ctx, program, &result);
item_free_list (result);
- item_free_list (tree);
+ item_free_list (program);
const char *failure = NULL;
if (ctx.memory_failure)