From 7f298a9ef5fb7457dbb3b11f70efa8d5ca41f995 Mon Sep 17 00:00:00 2001
From: expan <expan@student.cs.uwaterloo.ca>
Date: Thu, 28 Mar 2019 23:09:44 -0400
Subject: [PATCH] Fix to use atoms

---
 parser.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/parser.c b/parser.c
index dfe5733..a819c74 100644
--- a/parser.c
+++ b/parser.c
@@ -32,7 +32,7 @@ cons_cell* parse(char* input, int size) {
 		
 		char buff_first[500];
 		strncpy(buff_first, input, first_space_idx);
-		cons_cell* car_cons = parse(buff_first, first_space_idx);
+		cons_cell* car_cons = create_cons_cell_w_atom(buff_first, NULL);
 		char buff_other[500];
 		int next_char = first_space_idx;
 	    while (input[next_char] == ' ' && input[next_char] != NULL) {
@@ -41,7 +41,8 @@ cons_cell* parse(char* input, int size) {
 
 		strncpy(buff_other, input[next_char], size - next_char);
 		cons_cell* cdr_cons = parse(buff_other, size-next_char);
-		return create_cons_cell(car_cons, cdr_cons);
+		car_cons->cdr = cdr_cons;
+		return car_cons;
 	}
 }
 
-- 
GitLab