diff options
author | Přemysl Janouch <p.janouch@gmail.com> | 2017-05-19 18:32:28 +0200 |
---|---|---|
committer | Přemysl Janouch <p.janouch@gmail.com> | 2017-05-21 13:19:46 +0200 |
commit | e9b426db412680de1888056c5a643b3ed8c7ded6 (patch) | |
tree | c2482e1325e3ee50e55c7441e619ec63070db8f8 /ell.c | |
parent | 53810d61f20296ce9ef207811e1180b6d10d7a24 (diff) | |
download | ell-e9b426db412680de1888056c5a643b3ed8c7ded6.tar.gz ell-e9b426db412680de1888056c5a643b3ed8c7ded6.tar.xz ell-e9b426db412680de1888056c5a643b3ed8c7ded6.zip |
Parsing should not create a new list
The resulting program is already a sequence.
Diffstat (limited to 'ell.c')
-rwxr-xr-x | ell.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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) |